Jump to content
  • Advertisement
Sign in to follow this  

What to do when there's no room to move units in an RTS?

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

Hello. In the simple picture below, assume the red is an enemy army surrounding your barracks (in gray), when you build a new unit, there is nowhere for your new units to leave from (the exit for the barracks is at the bottom of the barracks). What could I do about this? I can't push back the enemy units as it may push them back out of attacking range if too many units exit the barracks. Does anybody know how other games handle this issue, I know they do, but to be honest I can't say I've even noticed how exactly they do it? Thanks, NB.

Share this post


Link to post
Share on other sites
Advertisement
In RTS games with a move-out-of-barrack animation, i assume pushing back the enemy at the gate is not so bad. Often collision avoidance is implemented as some sort of force pushing nearby units away. Such a mechanism could be used to push away the enemy. The enemy will probably start attacking the new unit or attack the barrack at from other position.

A similar example: In Age of Empires II, when building a new house on an area containing units, the units immediately leaves the area.

Share this post


Link to post
Share on other sites
Make the unit temporarily invulnerable and also give it the ability to move through units until it is in the clear. From there, disable invulnerability and enable collision and then give the order for that unit to go to the rally point.

If you do that as well as make it so the unit cannot be controlled by the player until it has been fully deployed (that is, clear of the units surrounding the barracks) then you have solved the problem. Units aren't pushed back and the exiting of the barracks is all part of the 'construction' animation. The unit technically isn't in play until it is controllable by the player and in an acceptable location. It also cannot be damaged until it is in play. That should take care of it, you just need to find the shortest available location for the unit to be and not reactivate the unit until it can be switched in to play.

Share this post


Link to post
Share on other sites
Or just block the barracks from building new units. Obviously that player doesn't need them for a while anyway, until he has solved his population density problem. ;)

Share this post


Link to post
Share on other sites
Quote:
Original post by Captain P
Or just block the barracks from building new units. Obviously that player doesn't need them for a while anyway, until he has solved his population density problem. ;)


The issue there is the enemy could surround the barracks with cheap units and prevent you from building anything. If this is supposed to be a valid strategy, then by all means block unit construction.

Share this post


Link to post
Share on other sites
Quote:
Original post by binchawpz
Quote:
Original post by Captain P
Or just block the barracks from building new units. Obviously that player doesn't need them for a while anyway, until he has solved his population density problem. ;)


The issue there is the enemy could surround the barracks with cheap units and prevent you from building anything. If this is supposed to be a valid strategy, then by all means block unit construction.

That's exactly what I've been doing in Advance Wars: occupy a factory with a jeep and hold out until infantry arrives to capture the factory. Careless guys leaving their properties unguarded, tsk tsk. ;)

Share this post


Link to post
Share on other sites
binchawpz, yes, that is quite a good idea. Sadly Captain P blocking the barracks would ruin things a little bit too much.

Thanks everybody for the comments. :)

Share this post


Link to post
Share on other sites
If the enemy can park units around your barracks then chances are a new unit will be destroyed the moment it is created anyway. As long as a single enemy right outside the entrance doesn't break it... e.g new units can turn left/right as they leave.
Alternatively, the building can include one special tile that is marked as impassable to enemy units.

If you don't like the strategic issues raised here, then don't have unit-created animations and just place them at the nearest available tile to the building

Share this post


Link to post
Share on other sites
Quote:
Original post by d000hg
If you don't like the strategic issues raised here, then don't have unit-created animations and just place them at the nearest available tile to the building


This can lead to interesting situations like this:

(yes, that dragoon spawned from the gateway below the impassable cliff =) )

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!