AI Unit Type and AI Behavior?

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

AI Unit Type and AI Behavior?

Post 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!
Xavious
Sith Master
Sith Master
Posts: 2783
Joined: Mon Jun 12, 2006 3:46 pm

Re: AI Unit Type and AI Behavior?

Post 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.
myers73
Lieutenant General
Lieutenant General
Posts: 690
Joined: Fri Apr 03, 2009 11:04 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Atlanta, GA xfire=myers73 IngameName=mYers

Re: AI Unit Type and AI Behavior?

Post 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
User avatar
Eggman
Master Bounty Hunter
Master Bounty Hunter
Posts: 1516
Joined: Mon Jul 16, 2007 1:30 pm
Projects :: Battlefront Chronicles
Location: Las Vegas

Re: AI Unit Type and AI Behavior?

Post 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.
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

Re: AI Unit Type and AI Behavior?

Post 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.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: AI Unit Type and AI Behavior?

Post 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.
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

Re: AI Unit Type and AI Behavior?

Post 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.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: AI Unit Type and AI Behavior?

Post 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?
User avatar
[RDH]Zerted
Gametoast Staff
Gametoast Staff
Posts: 2982
Joined: Sun Feb 26, 2006 7:36 am
Projects :: Bos Wars AI - a RTS game
Games I'm Playing :: SWBF2 and Bos Wars
xbox live or psn: No gamertag set
Location: USA
Contact:

Re: AI Unit Type and AI Behavior?

Post 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.
User avatar
trainmaster611
Sith Lord
Sith Lord
Posts: 1779
Joined: Thu Aug 24, 2006 5:22 pm
Projects :: No Mod project currently.
Games I'm Playing :: I have not listed any games yet
xbox live or psn: No gamertag set
Location: Building a railway to Coruscant
Contact:

Re: AI Unit Type and AI Behavior?

Post 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?
mswf
Master Bounty Hunter
Master Bounty Hunter
Posts: 1674
Joined: Tue Mar 31, 2009 3:40 pm
Location: Twello, The Netherlands
Contact:

Re: AI Unit Type and AI Behavior?

Post 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)
User avatar
Frisbeetarian
Jedi
Jedi
Posts: 1233
Joined: Wed Sep 12, 2007 3:13 pm

Re: AI Unit Type and AI Behavior?

Post 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.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: AI Unit Type and AI Behavior?

Post 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.
Post Reply