Page 1 of 1

AI Unit Type and AI Behavior?

Posted: Tue Sep 15, 2009 9:08 pm
by trainmaster611
I'm wondering if anyone knows if there is some relationship between the UnitType ODF parameter and the behavior they exhibit on the battlefield. Another possible factor is the 'class designation' in the SetupTeams section in the LUA. Like so:
SetupTeams{
rep = {
team = REP,
units = 32,
reinforcements = 200,
soldier = { "rep_inf_ep3_rifleman",9, 25},
assault = { "rep_inf_ep3_rocketeer",6,15},
sniper = { "rep_inf_ep3_sniper",2,5},
officer = {"rep_inf_ep3_officer",3,7},
engineer = { "rep_inf_ep3_engineer",1,2},
I know there must be some connection because the AI know that they should only use Snipe hintnodes if they are snipers.

I've already done all the research I could on this topic before asking this question, so please refrain from answering unless you have information (ie, no speculating). Thanks!

Re: AI Unit Type and AI Behavior?

Posted: Tue Sep 15, 2009 9:12 pm
by Xavious
trainmaster611 wrote:I know there must be some connection because the AI know that they should only use Snipe hintnodes if they are snipers.
Nope, that's just the UnitType as defined in the unit odf that tells the AI to use sniper nodes. As far as I know, the class labels used in the setup teams section serve no purpose save easy identification and organization.

Re: AI Unit Type and AI Behavior?

Posted: Tue Sep 15, 2009 9:16 pm
by myers73
Xavious wrote:As far as I know, the class labels used in the setup teams section serve no purpose save easy identification and organization.
I second that, otherwise you souldnt be able to change the class labels in the setup_teams.lua

Re: AI Unit Type and AI Behavior?

Posted: Tue Sep 15, 2009 9:18 pm
by Eggman
From my own experiences with that section, the 'soldier,' 'assault,' etc. labels only affect where the unit appears on the unit selection screen. So whatever you place in the 'soldier' section appears in the first slot, the 'assault' unit is in the second slot, and so on.

Re: AI Unit Type and AI Behavior?

Posted: Tue Sep 15, 2009 9:39 pm
by trainmaster611
Eggman wrote:From my own experiences with that section, the 'soldier,' 'assault,' etc. labels only affect where the unit appears on the unit selection screen. So whatever you place in the 'soldier' section appears in the first slot, the 'assault' unit is in the second slot, and so on.
Cool, I've checked some stuff and so far you all appear to be right. As you can see, I mixed up the position of the engineer but its still in the selection list where it should be. I also used Scout for the UnitType and the unit now waits at snipe nodes.

Now my question is, other than scout, what AI behavior characteristics are associated with each type? For example, there's trooper, assault, pilot, support, etc.

Re: AI Unit Type and AI Behavior?

Posted: Tue Sep 15, 2009 9:46 pm
by AQT
Units with the UnitType "pilot" automatically repair flyers while in them and I think that's the only function. Not sure about the remaining types though.

Re: AI Unit Type and AI Behavior?

Posted: Tue Sep 15, 2009 9:54 pm
by trainmaster611
AQT wrote:Units with the UnitType "pilot" automatically repair flyers while in them and I think that's the only function. Not sure about the remaining types though.
It could be my imagination, but it seems like they do a lot of 'repairing'. Ie, a pilot unit will more readily use a repair weapon and infact run around with a repair weapon more often than their other primary weapon. But like I said, that could be my imagination.

Re: AI Unit Type and AI Behavior?

Posted: Tue Sep 15, 2009 10:16 pm
by AQT
No, it's not your imagination, they do that a lot. I've noticed many times that an engineer unit would just walk by an enemy unit while holding a fusion cutter and get shot at. But is this due to being a "pilot" or is the fusion cutter the problem?

Re: AI Unit Type and AI Behavior?

Posted: Wed Sep 16, 2009 12:04 am
by [RDH]Zerted
The SetupTeams labels are a little more then just names. When you're playing metagames (Campaign maps) and you buy a new unit, the game stores which one you bought (soldier, assault, sniper, etc...). It enables only those units in metagame maps. So if you just drop your map into Galactic Conquest and then the player buys the sniper unit, whatever unit you have stored as the sniper will be the one that gets enabled ingame.

If you store a metagame state before the map loads (from the last map or from within the map selection screen), the game will automatically attempt to load it then next time the SetupTeams section is run. You can use this to enable/disable the map's units, but only across map loads.

Re: AI Unit Type and AI Behavior?

Posted: Thu Sep 17, 2009 9:23 pm
by trainmaster611
[RDH]Zerted wrote:The SetupTeams labels are a little more then just names. When you're playing metagames (Campaign maps) and you buy a new unit, the game stores which one you bought (soldier, assault, sniper, etc...). It enables only those units in metagame maps. So if you just drop your map into Galactic Conquest and then the player buys the sniper unit, whatever unit you have stored as the sniper will be the one that gets enabled ingame.

If you store a metagame state before the map loads (from the last map or from within the map selection screen), the game will automatically attempt to load it then next time the SetupTeams section is run. You can use this to enable/disable the map's units, but only across map loads.
Ok, so it basically gives the game a way to differentiate units, at least scripting wise.

@AQT: That's what I thought. I also gave a unit with the UnitType = "pilot" a repair weapon that actually heals unit health instead of buildings and objects. The AI would still run around with this 'repair' weapon despite the fact that there would be no ally in sight and even if he was under fire.

I'm gonna mess around with the unittypes and see if anything comes up that is noticeably apparent.


EDIT
After an hour and a half of stalking AI with freecam and tweaking their ODFs, I think I've found some behavior patterns for the trooper and assault.

The trooper units tend to be in the lead. They will be the ones that most actively pursue the objective (which was cp capturing when I was watching them). The assault units are noticeably more conservative. You will more frequently find them ducking into Cover nodes and they are a bit more passive in pursuing the objective. They seem to do more loafing and wandering. It might be my imagination, but it seems that when there is an assault unittype present and a trooper unittype present, the assaults tend to let the troopers lead and they'll be slightly behind them. However, if there are no troopers present, the assaults will head for their objective anyway.

I've been intently studying the support unittype, and frankly, this one really has me stumped. I think there's something different about them but I can't quite put my finger on exactly what it is. Anybody have a clue?

Re: AI Unit Type and AI Behavior?

Posted: Fri Sep 18, 2009 6:07 am
by mswf
Well, I haven't done any research myself, but my guess is that the support tends to go around dealing out supplies and rarely goes into offensive (come to think of it, I usually don't see an engineer capture a CP by itself)

Re: AI Unit Type and AI Behavior?

Posted: Fri Sep 18, 2009 6:36 am
by Frisbeetarian
I think that anything you find will be a product of ODF work. There is nothing magic about the setup_teams.lua script that tells units what to do based on whichever name they're listed under. The best way to test this, of course, would be to to switch around the names the stock units are assigned to and see that nothing changes.

Re: AI Unit Type and AI Behavior?

Posted: Fri Sep 18, 2009 7:49 pm
by AQT
mswf wrote:Well, I haven't done any research myself, but my guess is that the support tends to go around dealing out supplies and rarely goes into offensive (come to think of it, I usually don't see an engineer capture a CP by itself)
The supports are actually the officer classes while the engineers are pilots.