Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Movement system for RTS game?

This topic is 5515 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi! I was thinking of a good movement system to implement for an RTS game (e.g. Starcraft, Warcraft, C&C, etc.) I am new to the industry (obviously), so the best idea I could come up with is as follows: - Separate the map into a grid of tiles - Tiles are only used for pathfinding e.g. (AStar) - Units can be positioned independently from Grid, and use the path generated by AStar to follow grid tiles, however with slight collision detection to make sure they don''t clash with other units. So pretty much, the only use for the grid in an/my RTS is for pathfinding and stationary obstacle avoidance, "fog of war", and stationary obstacle placement. The rest is pretty much simple movement with even simpler collision detection (e.g. distance between two points). The only thing I don''t know how to solve is the problem if variable unit size. Any suggestions? Improvements? Do you know a better way of doing this? Am I on the right path? Thanks for your time, - Cyril.

Share this post

Link to post
Share on other sites
Hello there!

I´m also developing a RTS game in the way you mentioned.
First of all; I think you should separate the tiles from the collision map/fog etc..


_ _
|_|_| for every tile there´s four collision tiles.

And the variable size of units, why not simply check (using a for function or whatever you feel pleasant) if all collision tiles in the area the unit wants to go to is available?
^ this is how I've done it.

bool Collision(float/int sizex, sizey)
int Check = int Ok = 0;

for (sizex of unit)
{ for (sizey of unit)
if (CollisionMap[x][y].Available == true)


if (Check == Ok)
return false;
return true;

Hope this helps!

[edited by - Rasmadrak on August 20, 2003 1:01:41 PM]

[edited by - Rasmadrak on August 20, 2003 1:02:27 PM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!