RTS tutorials

I’m new to panda3d and haven’t done much yet. I’d like to start working on an RTS game and since doing it in 3d would be a himalayan task, I was looking everywhere for reading materials that’d help me implement it in isometric view or something. Quite dissatisfied (and bewildered) by the amount of work i’ll have to put in if i use ,say visual c++, I crawl back (on my fours) back to panda3d. I’m not exactly looking forward to put together warcraft IV. All I need is a tutorial/easy-enuf-sample-source-code which will just show me the basics of point and click stuff and overhead view you see in most of the RTS games.

That is, all i want is a ‘unit’ that’d respond to my mouse clicks and has certain ‘stats’ to go with it. I understand that I’ll have to begin by creating a unit (model), and then program each aspect of it (like unit selection using mouse, response to right mouse clicks etc) but it’d seriously take some load of my brains if i can get my hands on a similar work.

I searched the forums a bit and so far I havent hit anything that’s “my level”. So I was wondering if there were some simple RTS style code snippets running around. And of course, any links to RTS game programming in general would be a great help. I really really dont want to re-invent the wheel. And thanks in advance :slight_smile:

I doubt there is “RTS tutorial” for you anywhere. There is no universal recipe for cooking a game. I would advice you to search for bits of what you need.

Most basic RTS would consist of a plane (terrain) with some units that you can select and move.
So you need:

  1. Terrain
  2. Ability to select units
    • Capture “mouse-down” event, record position on screen and cast a ray to terrain to find out where mouse points in the world
    • When mouse is pressed down and mouse moves draw a rectangle on screen from recorded start position to current cursor position (two coordinates describe opposite corners of rectangle)
    • When mouse is released cast another ray to find end position on terrain and include in selection anything that is within that box
  3. Ability to move units
    • Clicking anywhere in the world should cast the ray to terrain and make units move to that position.
    • Units are to be moved using tasks and there is even tutorial for that.

Understanding individual pieces of what you need is critical to succeeding. Only by knowing what you need - you can achieve this. Hopefully my minimalistic example gives you better idea on how to work on your project.

Good Luck! :slight_smile:

Thanks. At least now I know I have to ‘think it all up’ :slight_smile:

Also you probably need some sort of pathfinding, including avoidance and maybe even group behaviours - to name a few aspects of the AI.