One thing I have always been annoyed with in the popular RTS games is that I have to do micro-management. I just hate doing a pretty successfull attack only to find out I didn't notice that all my wood-gatherers had just been idle because they couldn't find any wood. I got a little idea which might, or might not work, I haven't implemented it myself and doubt I ever will. There will most likely be a lot of grammatic and spelling errors in it, I apoligize. I have run the document through a spelling checker and read it over a couple of times, but lots of errors might still be there.
Problem In many of the more traditional RTS games today (Red Alert-/Star Craft-/Warcraft-style) micro management is a very big problem. Often you have to take care of many small groups of units, for example in Warcraft and Age Of Empires you have to make sure your workers gather wood from the correct places and don't start looking for wood near the enemies bases or too far from where it's returned. In most RTS games you have to keep creating units, upgrading your technology and expanding your base, while you attack the enemy, in addition you might also have to make sure your workers gather resources from the correct areas. If you are attacked you have yet another thing to take care of. If the units were able to attack on their own, if the workers could stay close to the base etc. then you might be able to take care of everything, but units have basically no AI. Often you choose a group of units, you can then attack a single unit at a time, when this unit is dead your units start attacking, either at random or follows some very bad algorithm. This gives very bad results compared to when a player guides the attack. Having units attack a mill, while a hostile catapult or a whole army is attacking them, is not rare.
How to reduce the micro-management? The main problem is the stupidity of the units (lack of AI). The have very simple, hard-coded rules. Just imagine the gain you could get if you could choose between ten different strategies when attacking, maybe strategies like:
- All attack strongest enemy
- Attack closest enemy
- Choose strongest enemy, where there aren't enough attacking units
- etc.
Actually we could get much smarter strategies, but they would be hard to present in a list form. Now imagine you could also specify input parameters to the strategies, now you could say find the strongest enemy which isn't attacked by a force n times his own, if you believe taking out the strong enemies first is a priority you should have n high, if you like to battle all the units keep n low. Some of the strategies would be hard to describe as text though, and shouldn't. The player shouldn't need to know the exact formulas used to determine which enemy to attack. Consider the following pseudo code.
STRATEGY
{
// Input from the user
USER_IN
{
MAX_DISTANCE_FROM_BATTLE_CENTER = 0< feet
RULE_STRICTNESS = 1 to 100
}
// Input from the game
GAME_IN
{
BATTLE_CENTER = POINT
}
// Code for each individual unit
UNIT_PROCESS
{
// Check if we are to far away from BATTLE_CENTER
DIST = DIST ( BATTLE_CENTER, POS ) IN FEET
IF ( DIST > MAX_DISTANCE_FROM_BATTLE_CENTER )
{
MOVEMENT_GOAL = RETURN_TO_BATTLE;
// Calculate how important it's that we return
// If the value is low the unit might choose to keep out of battle
MOVEMENT_GOAL.IMPORTANCE = (DIST- MAX_DISTANCE_FROM_BATTLE_CENTER) / RULE_STRICTNESS;
}
REL_F = RELATIVE_FORCE(THIS.CURRENT_SQUAD, CURRENT_ATTACKERS)
// If we have double the force of the enemy and someone needs assitance
IF( REL_F > 2 && FRIENDS_NEED_ASSISTANCE )
{
SQUAD.SEND_FRACTION_TO ( REL_F/(REL_F-2), SQUAD_IN_NEED_OF_ASSISTANCE)
}
ELIF ( REL_F < 1)
{
CALL_FOR_ASSITANCE( IMPORTANCE = 1/REL_F)
}
}
}
A very simple and very general strategy. In a real project we would use much more sophisticated strategies, but this was just to show the flexibility. Now imagine if we called this the "general attack strategy", we could also have a "cooperative attack strategy", "take out magicians attack", "protect buildings defense", "defensive attack", "base attack" (quickly kill enemy workers, barracks etc., but still keep defensive) etc. These strategies of course wouldn't be limited to attacking, we could assign a little group of workers with a "close the base gathering" strategy which make sure workers are always close to the defense, and maybe even build towers at strategic positions. Another group of gatherers could get assigned to "valuable resources" strategy, which makes sure they always try to find the best resources even if there are no friendly units nearby and fog of war still covers the area. Assigning a strategy to a group of units would feel a little weird to the user, in my opinion at least, so I would instead call these "strategies" generals; since it makes more sense to say a general is leading units than they just have this strategy. So you have an offensive attack general, cooperative attack general etc. This introduces yet another strategic choice; a general can only be attached to one group of units so if you start to like one general you will still have to use different generals, since you many groups of units. If I were to implement a system like this, I would do it in a hierarchy-way. For example imagine this:
RESOURCE SUPERVISOR
/ \
BASE_GOLD_GROUP \
\
/ \
/ \
/ \
/ \
BASE_WOOD_GROUP EXPLORING_GOLD_GROUP
The groups BASE_GOLD_GROUP, EXPLORING_GOLD_GROUP and BASE_WOOD_GROUP might make requests to the supervisor. For instacne if we have too much gold, but not enough wood some workers from the gold group might be transferred to the wood group. In the same way in an attack against a base we might have a "strategic buildings and towers" group of catapults and a couple of heavy-armed warriors (something like a Grunt in Warcraft), to protect the catapults. Another group of light warriors, maybe with horses, is assigned to a "worker killing group". Then we have a main group of different units which attacks all the enemy units. Above all of the groups we have a supervisor making sure all three groups are close to each other, possibly transferring units between the groups. The supervisor might also send requests, either directly to other generals or to the player who then have to decide (s)he you can make the request. So do you have any thoughts on this idea? Do there already exist games using this kind of stuff? Do you think it would completely ruin or game? Or do you actually think it could work if properly implemented?