Jump to content
  • Advertisement
Sign in to follow this  

collision detection / collision avoidance for RTS games

This topic is 3630 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

I'm writing an RTS game for my university project, and I've got quite far in developing the game. You can click
"> here to watch a youtube clip. I can think of two ways of implementing collision detection in an RTS game: 1) The 'old school' way (think Warcraft 1/2) Each unit occupies a single tile, and only one unit can occupy a tile. This basically restricts each of the units to a grid. The advantage of this is that it is very easy to implement and it is fairly stable. The disadvantage is that for modern games it looks horrible. The movement of your units become very mechanical as they stick to the grid pattern. 2) A more modern approach (think empires: dawn of the modern world, most 3-D RTS games) Every unit is free to walk around the game area and is not restricted to the grid based movement. The advantage is that it looks very fluid and natural. The disadvantage is that its much more difficult to implement. The approach I have currently implemented is the second one. Each unit is modeled as a sphere, and I use a simple collision detection technique. The problem is that I often get problems when large crowds of units are clumped together. As they all try to move, they end up pushing each other around etc. I have observed in "Empires: Dawn of the Modern World" that it seems to be using more of a 'collision avoidance' technique. Where each unit tries to walk away from surrounding units, although however in some cases they walk straight through each other. Can anyone advise me of the best way to implement collision detection/avoidance for this type of game, and how a collision avoidance tends to function? James

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • 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!