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

Started by
10 comments, last by Extrarius 15 years, 2 months ago
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.
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.
Hm, there must be some way to do it though where the enemy isn't pushed back when new units come out?
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.
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. ;)
Create-ivity - a game development blog Mouseover for more information.
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.
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. ;)
Create-ivity - a game development blog Mouseover for more information.
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. :)
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
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 =) )

This topic is closed to new replies.

Advertisement