Intelligent behavior of units - Request list

Intelligent behavior of units - Request list

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderator: Moderators

Post Reply
User avatar
Gabba
Posts: 319
Joined: 08 Sep 2004, 22:59

Intelligent behavior of units - Request list

Post by Gabba »

We haven't had a thread about this since the forums were hacked, so I think it's time to start a new one:
Basically this is the place to post to say how you want units to behave in the game, from pathfinding to formations to attacking a target. It's better to add new ideas than to criticize those of others, since in the end the SYs will pick what they like.

My own hopes:
- you can define precise paths: have units move through a precise space, instead of just telling them to move from one point to the next

- the ability to define a waypoint as an area: tell units to occupy a specific space in a specific formation (i.e. in range to bombard a target area you define) when they reach their destination

- you can define priority targets for All units, and also for a specific group; in that system you should be able to define priority between suicide (destroy the most priority targets before dying) or fighting (destroy serious threats before priority targets), and similar choices. These priorities should be managed with a simple queues, i.e. moving important items to the top by click-and-drag

- when attacking, units share the job efficiently to destroy priority targets first, i.e.:
--- no overkill: 50 flashes won't fire all at the same time at the same metal extractor, because 10 of them destroy it in one shot anyways; instead, 10 of them will attack the first one, and the remaining will intelligently attack the next mexx.
--- no useless turret turning: units won't start turning to attack a target if other units are firing at it and it will blow up even before the turret faces the target.
--- take into account the status of friendly units: if a target is being attacked from friendly units but it looks like they'll get destroyed before finishing off their target, more units get assigned to attack that target.
--- keep moving if there's room to manoeuver: moving around generally confuses enemy turrets/units, so units shouldn't stop when they're in range of the target; they should circle/try to avoid enemy fire, while keeping aim on their target.
--- evaluate their chance of success according to the priorities: if the goal set by the player it to destroy the most enemy units, your tanks won't all gang up on a Krogoth theyno chance of destroying; they'll rather avoid firing at him and shoot at smaller units they can destroy before dying. On the other hand if the priority is to damage tough units, your task force will damage the Krogoth as much as possible: of course the poor grunts don't know why, but you know that you're preparing a bombing run to finish him off.
--- distracting/drawing fire: if facing units with a low rate of fire, and still out of their firing range, a single unit of the squad should purposedly move forward to draw fire from all enemies, allowing his friends to march forward and fire at the opponent who is reloading. Of course this depends of how many units there are on the squad, and how valuable they are. It makes sense to sacrifice a flea, maybe not a goliath.

- Construction units working on the same queue should also share the job efficiently: especially with small structures that build very fast, constructors should not attempt to help out a construction that's about to finish (i.e. they don't even have time to get there/open their nanolathe before it's finished), or that they can't reach: they should just move on to the next thing to build. You have to be able to send a group of idle constructors to join in the work of others already working, so that they all try to finish the same build queue

- When being fired at by an unseen enemy, your units should try to calculate the position of the enemy from the trajectory, and fire back with low accuracy. If there's any weak scout around, he should probably go look for the offender. That's another thing to set in your priorities: how much you want expendable units to sacrifice to scout/draw fire from the enemy.

- Priority zones to defend: if you have identified a corridor of attack against your base, it would be a nice feature to be able to tell your base defenses to watch this area in priority - which means they'll stay aimed in that direction when idle, instead of resetting back to a default position. If you don't define a priority zone, your units should remember from which direction the enemy comes more often and aim there.

- Preparing: if your units see a large force coming up on radar, they should prepare to receive them, by preparing their aim, with patrolling units that cover that area coming back, and vulnerable construction units fleeing the site of the coming carnage.

- Hard to express but important: waiting to fire: if a column of tanks is moving up a canyon and there's a detected target on the left side, which you can only fire at through a small breach, units should not fire at it while their LOS is blocked, as they do in TA. Since they are ordered to move forward, not to attack that target, they can only fire at it while they pass in front of the breach, so each tank will get a single shot: if they don't turn their turret in advance and wait for the right time to fire, chances are they won't be reloaded and won't be able to shoot the target.

- When on the move to some place, if the location of some enemy unit/radar tower is known (i.e. a peeper just flied above it), your units will try to avoid getting detected by moving just outside its LOS/radar range. Of course they shouldn't deviate much from their path to do that, but sometimes you get an idiot who tries to go around the others, instead of waiting to go through a tight place, and then he gets shot at by an enemy which was already known.
In the same way, when travelling with radar jammers, units should try to stay within the jammed area.

- Radars should probably be able to detect and identify each other as such, on the minimap and game map: you can't send a stream of waves to bounce off the enemy and stay hidden at the same time. In the same way, jammer effects should probably be shown as a shroud or shimmer on the minimap, instead of being totally invisible. Of course this is a gameplay issue, it could make jammers less useful.

- Unit collisions should cause damage, and units should use this feature to ram lighter units if possible, and to push out of the way wrecks or enemies lighter than them to make way for the rest of the army. Fast units such as fleas could kamikaze on enemies if that causes more damage than their puny laser. Planes should also crash on enemy buildings instead of randomly, if possible.
When coming down a slope, units should "brake", to avoid coming down too fast and losing control - unless they have the opportunity to ram enemy units at the bottom of the slope, in which case they should go crazy. This works better for tracked/wheeled units than with Kbots, of course.

- Repair units should automatically repair surrounding damaged units. Here again, a priority queue would be very useful: it could contain very general items such as "repair armed units first", or specific ones such as "repair flashes first". You could override the queue for a specific unit/group. Creating an item in that queue would be a simple matter of clicking on something from the map, or selecting from well-organised list or treee.

- Repair units should be able to repair "on the move", without constantly opening and closing their nanolathe when their target is moving. The target being repared and the repair units should try to synchronize their movement to allow for the repair.

- Units moving together should collaborate to clear the path: if there are rocks in the way or trees don't fall as soon as you touch them, units with appropriate weapons should destroy the obstacle without player intervention.

-*Important*: An appropriate way of overriding all these automatic behaviors has to be devised, so that if your units are doing something stupid (which will happen, as it does with real soldiers), you can immediately take over. Something that gets me crazy when I play Warcraft III is that when you want to retreat units on the default agressive setting and you click away from the enemy, your units will often turn back to attack them, and get killed. Sometimes you just want manual control!!!

Yay a long list! I hope you help me make it longer. :wink:
sparkyhodgo
Posts: 128
Joined: 24 Feb 2005, 19:05

Post by sparkyhodgo »

I agree with everything you said, except that unit collisions cause damage. Not sure if you noticed, but unit "collisions" are important to Spring movement already--units don't get stuck anymore because they push each other out of the way. If they hurt each other while doing so, it would undermine the purpose of the movement feature.
User avatar
Gabba
Posts: 319
Joined: 08 Sep 2004, 22:59

Post by Gabba »

sparkyhodgo wrote:If they hurt each other while doing so, it would undermine the purpose of the movement feature.
To avoid that problem, collisions with friendly units should only cause damage if the shock is very hard (friendly planes colliding already kill each other, I think). What I'm interested in is ramming enemy units.
User avatar
WillRiker
Posts: 207
Joined: 27 Mar 2005, 04:02

Post by WillRiker »

it would be cool to have, offensive/evasive mode for air units. so when going through air defensive umbrellas they can move faster/turn faster but cant fire, but when they get closer to there target they just go for it.
--- no overkill: 50 flashes won't fire all at the same time at the same metal extractor, because 10 of them destroy it in one shot anyways; instead, 10 of them will attack the first one, and the remaining will intelligently attack the next mexx.
bad idea, it gets really confusing and frustrating when your units dont do what you told them to do. there is a game called stalingrad in which something seamelar happends. its just really annoying coz ur units end up attacking think you dont want them to and they scatter all over the place.
Sean Mirrsen
Posts: 578
Joined: 19 Aug 2004, 17:38

Post by Sean Mirrsen »

Legacy, even if half of what you wrote is asked, it is asking too much. Other than that, nice list.

I'll try to make a more comprehensive one, though:

1)Ability to define area waypoints, both for move and attack actions, by dragging the mouse instead of just clicking. Can be used to define 'precise waypoint systems' for going through canyons, etc. Basically, for movement, this is specifying the distance from the actual waypoint so that it is considered reached.

2)Ability to define 'area guard' commands. If used on the ground, all units in the area are monitored. If a monitored unit is attacked within the defined area, guarding units will attempt to track and destroy the attacker like they would if it they were under attack. Useful to set up squads of base defenders.

3)Ability to define alert zones. Basically, this is an equivalent of a guard area, except that it is used to monitor enemy units passing through. Once an enemy is detected inside a defined Alert zone, units asigned to it will move in and attack them, and return to their positions afterwards. Key shortcut could be dragging on ground with patrol command.

4)Using double-click on an enemy unit to attack all these units on screen, similar to double-click selecting of your units. Shouldn't work on radar blips, or should tell to attack all enemy blips.

5)Refining an idea by Legacy, ability to define avoid zones. Your units will attempt to steer clear of these zones when pathfinding. Shortcut could be set to ctrl-drag on the ground with the move command. I don't think these areas should be defined as global.

6)Ability to change more of the unit's behavior parameters on the fly. These could include UFO-like Aggressive/Standard/Standoff attack styles, closest/farthest and strongest/weakest attack priorities, and even things like Berserk/Standard/Track fire styles, where the first will make the unit fire it shots at any cost, even if the target is obstructed by terrain, friendly units, and if it's not even lined up to fire properly, and the third will make it turn its turret after the target even if it's not in direct line of sight and obstructed, but fire only when a clear shot is guaranteed.

And, generally, I'd like to keep pop-up menus out of the GUI, and I'd like my units to only have the intelligence I provide them with, so they don't do something stupid unless I told them to do so (by mistake or no).
User avatar
Redfish
Posts: 289
Joined: 27 Feb 2005, 16:12

Post by Redfish »

I think what you're proposing is impossible AI wise. For instance how does the computer 'know' which thing is important. e.g. 10 flashes coming near a mex. First which one will be closest, how many does it take to disable, where should they go if they don't have any los on other enemy units etc etc. Just too many questions that make the equation all too difficult. I think you want spring to be a game where you just build your base. Then tell all units, the enemy is somewhere over there, and just let the AI fight the battle for you(overstated of course). Seems a bit dull to me. It's actually unit control that seperates the newbs from the good players. Being able to control 2 jeffies on 2 sides of your enemy base is something that requires practice. And having the AI attack like that by default for instance doesn't do it for me.

And also I like the way TA plays. Units just do what you tell them to do, instead of wonder around.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7049
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

Nice ideas Gabbas, but I don't think half of them are feasible. I mean, let's envision your "no overkill" hope: how would a flashes now that a nearby mexx is about to be destroyed? It could see that other flashes are targetting it, and count the others flashes vs mexx armour and deduce the time of the death of the mexx, but what if other flashes are killed before the mexx explode? What if a slasher passes by between the other flashes and the mexx and absorb the EMG? What if a nearby cons decide to go and repair the mexx? There's too many impredictable factors that can possibly change the output of a fight.

Also, I'm strongly against the "drawing fire" idea, as I can already imagine my units disobeing order and go die one by one to the the enemy, and I'm also strongly against "ulnerable construction units fleeing the site of the coming carnage", as I can already imagine me trying to hastily build some def when seeing the enemy coming and have my cons run away seconds before the def is complete.

And having different settings that let units more or less free to disobey orders isn't the solution, because in TA units are often build in masses, so you can't individually tweak them, in large PD game I even have trouble changing indivual factory settings. And also because I'm sure I'll only remember to change behavior settings only after my unit has done a stupid thing.

Having units move around when a cons want to build there is all the initiative the units should have I think.
User avatar
[K.B.] Napalm Cobra
Posts: 1222
Joined: 16 Aug 2004, 06:15

Post by [K.B.] Napalm Cobra »

Thats it, I'm going to make an ai that causes a peewee that sees a krogoth to run in a circle then self-d just for the sake of it. :twisted:
User avatar
Charlemagne
Posts: 174
Joined: 18 Apr 2005, 17:59

Post by Charlemagne »

[K.B.] Napalm Cobra wrote:Thats it, I'm going to make an ai that causes a peewee that sees a krogoth to run in a circle then self-d just for the sake of it. :twisted:
Realistic behavior. If I was a peewee, I would do just that, or try to run away.
the kitchen sink
Posts: 6
Joined: 24 Feb 2005, 12:40

Post by the kitchen sink »

a comparatively simple suggestion but when construction units are put on patrol they should not sit at the base of a hill continually trying to assist with a building being built up above which they cannot reach.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

And here you ll are saying no this is overkill and I'm saying NO NO NO discuss it I want to ehar how you think it should eb doen. Afterrall I and other people will ahve to do these things for the Skirmish AI project., and I'm interested in getting as much help as possible to speed thigns up.


Good work Gabba, maybe I shall have use of you at some point.
User avatar
Redfish
Posts: 289
Joined: 27 Feb 2005, 16:12

Post by Redfish »

I think it would be nice to have L1 go in front as cannon fodder when there is level 2 present in the group.
User avatar
Gabba
Posts: 319
Joined: 08 Sep 2004, 22:59

Post by Gabba »

Ok I don't want to let this thread die, especially now that we have access to the source code! I don't know if this would fit better in the development forum?
Thanks Alantai for your support - as I said elsewhere I can only code very basic programs in Java for now, but count on me to adapt to C++ and AI programming. If you have any specific ressources to suggest, they'll be welcome. As you said, these ideas will be useful both for low-level AI and for Skirmish AI, so I hope we can work together!
zwzsg wrote:I mean, let's envision your "no overkill" hope: how would a flashes now that a nearby mexx is about to be destroyed? It could see that other flashes are targetting it, and count the others flashes vs mexx armour and deduce the time of the death of the mexx, but what if other flashes are killed before the mexx explode? What if a slasher passes by between the other flashes and the mexx and absorb the EMG? What if a nearby cons decide to go and repair the mexx? There's too many impredictable factors that can possibly change the output of a fight.
On the contrary I think this is an interesting challenge to program. There should always be a slight overkill, so you're absolutely sure that the target dies, and it should take into account how heavy the enemy fire is (how much damage the group is receiving). I think that all the factors you mention above can be taken into account - the tricky part might be how to detect/evaluate them in-game. Then again, it's a good thing to have the devs handy! At the minimum this "no overkill" rule will prevent a Flash from turning his turret towards the mexx when there are already 50 projectiles heading for it
Also, I'm strongly against the "drawing fire" idea, as I can already imagine my units disobeing order and go die one by one to the the enemy, and I'm also strongly against "ulnerable construction units fleeing the site of the coming carnage", as I can already imagine me trying to hastily build some def when seeing the enemy coming and have my cons run away seconds before the def is complete.
I am strongly against units taking any initiative at all, so the "drawing fire" behavior, for instance, has to apply only when your units are already moving forward as a group toward the enemy. Some units are gonna get shot at first anyways, so slightly tweaking the speed of one of the front units should be enough to draw fire. If it doesn't work, too bad, the rest of the pack goes charging in as usual.

And having different settings that let units more or less free to disobey orders isn't the solution, because in TA units are often build in masses, so you can't individually tweak them, in large PD game I even have trouble changing indivual factory settings. And also because I'm sure I'll only remember to change behavior settings only after my unit has done a stupid thing.
I never had time to tweak the agressivity settings of units either, in TA or any other game. The solution IMHO (apart from a "dumb mode", for emergencies, where the unit just follows your explicit orders) is a general priority queue that you can define in the quieter moments before the battle - or even outside the game. Example: you usually know what you're ready to sacrifice units for. So with this queue you can set your units to generally stay on their positions or retreat from heavy fire, except if their group has LOS to the enemy Commander, in which case they should go crazy. In time you'll find the priority queues that fit best your playing style, and my idea is that they are automatically saved so you can edit them after the game. You can share with other players, pick your best ones, and then assign them to hotkeys so you can change battle plans on-the-fly during game - instead of having to find the units, click on their settings, etc.

Thanks all for your input. I'll try to update the list in the original post with your ideas as soon as I get the time. Seeya - preferably in a Spring game. :wink:
Post Reply

Return to “General Discussion”