UnitType ODF parameter

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
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

UnitType ODF parameter

Post by Sporadia »

The ODFs have a parameter called UnitType which affects the AI behaviour. Does anyone know if there's any documentation or thread which compares how the different UnitType options behave? So far, I've only found bits and pieces about some of them.

Edit: I actually have some more specific questions related to this. Which UnitType options will slice into vehicles with a fusion cutter (if it affects this behaviour at all)? Does UnitType affect mines and detpacks?
MileHighGuy
Jedi
Jedi
Posts: 1194
Joined: Fri Dec 19, 2008 7:58 pm

Re: UnitType ODF parameter

Post by MileHighGuy »

I think the engineer's unit type will slice into stuff. I also think it affects whether they want to place a mine or not. I think the standard trooper unittype makes it more keen to try to doge your fire too? I don't really know. I did some digging on this in the forums a while ago.
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: UnitType ODF parameter

Post by Sporadia »

Done some digging of my own, and I'm dumping all the information I've found for future reference. I haven't tested any of this. A lot of the stuff people have written about UnitType starts with "I think..." "If I remember..." etc. Or it's something that I've only seen posted once. So I'm writing claim before the things which don't have much evidence, and linking all the sources (links in italics).

This is all about AI behaviour unless stated otherwise. ie. It doesn't apply to human players.

Hint Nodes
Land Node: JetJump Node: Snipe Node: VehicleCover Node: Mine Node: Fortification Node:
UnitType ODF parameter

Trooper Assault
  • Assumption: Does something extra with the rocket launcher. (reason: The ODF parameter doc. See below.)
  • Claim: Won't use the health and ammo dispenser at all. (From a test.)
  • Doesn't do repairs. (Verified.)
  • Claim: Doesn't slice into vehicles. (From a test.)
  • Claim: More likely to take cover. ie. Potentially more responsive to the Cover hint node.
Anti-Armor
  • Assumption: Does something extra with the rocket launcher. (reason: The ODF parameter doc. See below.)
  • Claim: Won't use the health and ammo dispenser at all. (From a test.)
  • Doesn't do repairs. (Verified.)
  • Claim: Doesn't slice into vehicles. (From a test.)
Scout
  • Claim: The only UnitType that will use the Snipe hint node. (Very likely, see above.)
  • Claim: Won't use the health and ammo dispenser at all. (From a test.)
  • Doesn't do repairs. (Verified.)
  • Claim: Doesn't slice into vehicles. (From a test.)
Pilot Support
  • Will actively seek other players so it can dispense health and ammo. (Verified.)
  • One of the only UnitType values that uses the fusion cutter to do repairs. (Verified.)
  • Slices into vehicles with the fusion cutter. (Verified.)
  • 3 of the officers use this UnitType, and I haven't come across a reason why. Also note that the Bothan Spy doesn't use this UnitType.
  • I don't know how this behaves differently to Pilot on land maps. So why are they both used?
Repair
  • Will actively seek other players so it can dispense health and ammo. (Verified.)
  • One of the only UnitType values that uses the fusion cutter to do repairs. (Verified.)
  • Slices into vehicles with the fusion cutter. (Verified.)
Special
  • Will actively seek other players so it can dispense health and ammo. (Verified.)
  • One of the only UnitType values that uses the fusion cutter to do repairs. (Verified.)
  • Slices into vehicles with the fusion cutter. (Verified.)

  • I've seen a few threads which mention this:

    Code: Select all

    Scout
    Anti-Armor rocket
    Assault rocket
    Repair
    Support repair
    Pilot
    Trooper
    Special - repair 
    It's taken from Psych0Fred's ODF parameters doc. Under the Soldier class, if you scroll down to the bottom of it's parameters you will eventually find that list. The document isn't laid out very well and I didn't trust this information at first. But I've tested 2 things based on this extract so far and they've both been true. 1) Repair, Anti-Armor and Special are real values of UnitType. 2) The Special UnitType will do repairs with the fusion cutter and the Anti-Armor won't. So it looks like this really is a list of the different UnitType values. I still don't know why it's not placed under UnitType in the doc; it's a messy doc.

Bonus: The ODF parameter AISizeType will change what path a unit follows ie. When people are making maps, they can (and usually do) add filters to the AI pathing so that it only affects a specific AISizeType. It's not relevant to the UnitType parameter; it's just something else to be aware of.

Psych0Fred Docs: AI related docs folder.

All links: Updated: 10/12/2021
Last edited by Sporadia on Fri Dec 10, 2021 12:28 am, edited 9 times in total.
MileHighGuy
Jedi
Jedi
Posts: 1194
Joined: Fri Dec 19, 2008 7:58 pm

Re: UnitType ODF parameter

Post by MileHighGuy »

Much appreciated research!
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: UnitType ODF parameter

Post by Sporadia »

Claim Testing

I've taken a look at this to see if these are real UnitType values:

Code: Select all

Scout
Anti-Armor rocket
Assault rocket
Repair
Support repair
Pilot
Trooper
Special - repair 
Spoiler alert, they are. Whenever you use a value for UnitType that isn't real it will leave a severity 2 error in the debug log. The extra values of "anti-armor", "repair" and "special" do not leave this error. I've also tested them with the fusion cutter since that's one of the things I was interested in. And I've looked at the claim that some UnitType values don't use the powerup dispenser.

See Test:
Hidden/Spoiler:
Set-up: I modded the Kashyyyk clone wars conquest mission. So all this is happening with the Conquest AIGoal. I also removed the local team. I gave both teams a unit with a pistol, fusion cutter and dispense health and ammo (this is the test unit). I deleted all the other units from the teams. I cleaned and remunged the side between tests.

With each test I changed the UnitType on my test unit and played a few games to see if I could coax the AI into doing everything I wanted. I also checked for UnitType error in the debug log. This is what I got:

Anti-Armor
[list][*]AI doesn't do repairs
[*]AI doesn't seem to dispense health and ammo
[*]AI doesn't seem to slice into vehicles
[*]I didn't see this unit get the fusion cutter out. Not once.
[*]The dash is important. Got an error with "antiarmor" and "anti armor"[/list]

Repair
[list][*]AI can repair (includes vehicles, turrets and the wookiee barricade)
[*]AI can dispense health and ammo
[*]AI can slice into vehicles[/list]

Special
[list][*]AI can repair (includes vehicles, turrets and the wookiee barricade)
[*]AI can dispense health and ammo
[*]AI can slice into vehicles[/list]

I also did a test to see if "rocket" was a valid UnitType; it's not.

Conclusions: The fact that anti-armor doesn't repair is very clear. The lack of slicing and powerup dispensing could be luck, but it currently looks like anti-armor doesn't do them at all. The behaviour of anti-armor supports the claim that some UnitType values don't use the powerup dispenser, and that some UnitType values don't repair.

Update: These seem far less plausible now that I've done test 2:
New hypothesis 1: AI repair and AI vehicle slicing are connected. The AI will either use the fusion cutter or it won't.
New hypothesis 2: The "Support", "Repair" and "Special" UnitType values are all the same. Likewise the "Assault" and "Anti-Armor" UnitType values are the same. This is based on the extra note about repair and rocket (which could just easily be talking about specific weapons). And it's now a gut feeling since the "Repair" and "Special" felt so similar.
New hypothesis 3: The "Pilot" UnitType is just the "Support"/"Repair" UnitType with the PilotRepairScale funcionality. (This one I kinda want to test, but I'd have to do it on a space map. It doesn't really explain the difference between Support and Pilot in the land units though. I thought it could be the fusion cutter award, but it's not).
Test 2

I tested every UnitType to see if it could repair space vehicles. The only one which could was the Pilot.

I've also extended test 1 to see how the other UnitType values behave.
See Test:
Hidden/Spoiler:

Support
[list][*]AI repaired everything
[*]AI can dispense health and ammo
[*]AI sliced into vehicles several times a round, and at one point got to 98%. In test 1, Special and Repair were a lot less aggressive with the slicing, and seemed to give up after about 15% max[/list]

Pilot
[list][*]AI repaired everything
[*]AI can dispense health and ammo
[*]AI sliced into vehicles. Hard to tell how much[/list]

Trooper
[list][*]AI doesn't seem to do repairs
[*]AI doesn't seem to dispense health and ammo
[*]AI doesn't seem to slice into vehicles
[*]I didn't see this unit get the fusion cutter out[/list]

Scout
[list][*]AI doesn't seem to do repairs
[*]AI doesn't seem to dispense health and ammo
[*]AI doesn't seem to slice into vehicles
[*]I didn't see this unit get the fusion cutter out[/list]

Assault
[list][*]AI doesn't seem to do repairs
[*]AI doesn't seem to dispense health and ammo
[*]AI doesn't seem to slice into vehicles
[*]I didn't see this unit get the fusion cutter out[/list]

New hypothesis 1: Vehicle slicing isn't a binary option. Some UnitType values are more aggressive with it than others.
New hypothesis 2: Every UnitType is unique.
New hypothesis 3: If a UnitType doesn't repair or slice at all, then it won't voluntarily equip the fusion cutter.
Last edited by Sporadia on Thu Dec 09, 2021 11:53 pm, edited 1 time in total.
MileHighGuy
Jedi
Jedi
Posts: 1194
Joined: Fri Dec 19, 2008 7:58 pm

Re: UnitType ODF parameter

Post by MileHighGuy »

so whats the difference between "assault rocket" and "assault"?
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: UnitType ODF parameter

Post by Sporadia »

Question:
MileHighGuy wrote:
Thu Dec 09, 2021 11:52 pm
so whats the difference between "assault rocket" and "assault"?
Answer:

Code: Select all

Message Severity: 3
C:\Battlefront2\main\Battlefront2\Source\EntitySoldier.cpp(11349)
Unrecognized UnitType "assault rocket" in soldier "tes_inf_cisguy"
"assault rocket" doesn't work. At this point I think the word rocket is pointing out that the AI does something special with the rocket launcher for Assualt and Anti-Armor. Same as the word repair in support repair. Edit: But since it doesn't say pilot repair I'm not sure it's that reliable.
Last edited by Sporadia on Fri Dec 10, 2021 12:40 am, edited 1 time in total.
MileHighGuy
Jedi
Jedi
Posts: 1194
Joined: Fri Dec 19, 2008 7:58 pm

Re: UnitType ODF parameter

Post by MileHighGuy »

okay, interesting!

EDIT: I wonder if you could decipher the full list of unit types by looking for their strings in the decompiled game exe?
Post Reply