Getting an asstank to always use a given weapon

Moderators: GSH, VSMIT, Red Devil, Commando

User avatar
Red Devil
Recycler
Posts: 4398
Joined: Fri Feb 18, 2011 5:10 pm
Location: High in the Rocky Mountains

Re: Getting an asstank to always use a given weapon

Post by Red Devil »

life is short; no need to be snarky.
Zero Angel wrote:
Red Devil wrote:just comment out the gun HP's
It had never occurred to me to cripple the power of human piloted hedouxes in order to fix an undesirable AI behavior.

EDIT: Lowered the scorch factor by 50%
User avatar
Zero Angel
Attila
Posts: 1536
Joined: Mon Feb 21, 2011 12:54 am
Contact:

Re: Getting an asstank to always use a given weapon

Post by Zero Angel »

Zax wrote:
Zero Angel wrote:Zax is right about that, and it might cause balance issues to appear -- if not now, then sometime in the future when people get more comfortable with the Hadeans.

Back on topic. I tried weaponMask with the AI settings that RTs and Asstanks use but it still went back to its default behavior of preferring to use its secondary guns against Combat class targets.
Then weaponmask is being overwritten and ignored by the isAssault.
Doesnt seem to be so. I tried setting weaponmask to 00110 (AKA: use guns only) and then set all weapons to assault class and the Hedoux would use its main cannon still. This tells me that AssaultTankProcess ignores weaponmask altogether.
User avatar
GSH
Patch Creator
Posts: 2485
Joined: Fri Feb 18, 2011 4:55 pm
Location: USA
Contact:

Re: Getting an asstank to always use a given weapon

Post by GSH »

Checking the code, most (all?) of the AI processes call UnitTask::SelectWeapon(), a function that tries to find the best match of weapon combat/assault vs target combat/assault. Changing this behavior would require a code change to be in the next public beta, but doing so could lead to BZ1-style exploits of dropping the 'right' crates on enemy units to give them a bad weapon in the hardwired slot, when a better weapon is in another slot.

For reference, that SelectWeapon call is done from the following files. As UnitTask.cpp is the base class for other *Tasks, other derived classes may call it indirectly.

ArcherProcess.cpp
ArcherProcess.cpp
ArtilleryProcess.cpp
AssaultTankProcess.cpp
AttackTask.cpp
AttackTask.cpp
GechProcess.cpp
MortarBikeProcess.cpp
MortarBikeProcess.cpp
SupportProcess.cpp
TurretTankProcess.cpp
TurretTankProcess.cpp
UnitTask.cpp
UnitTask.cpp
WingmanProcess.cpp
WingmanProcess.cpp

-- GSH
User avatar
Zero Angel
Attila
Posts: 1536
Joined: Mon Feb 21, 2011 12:54 am
Contact:

Re: Getting an asstank to always use a given weapon

Post by Zero Angel »

Well, said exploit is already possible. I've seen players drop AT-Stabs on approaching titans or TAG cannon on rocket tanks to make them more killable, but it's not big enough of a deal since most players will just shoot those powerups out of the sky or learn to keep better tabs on their idle assault units (and besides, modders who wish to disable that feature can do so via powerupAcceptMask). That said, the ideal way of controlling weapon switching would be to have it so that it is possible to specify priorities in the gfiles (ie: combatPriority = 30 / AssaultPriority = 80), and then have the AI processes read the priorities out of the weapons files and select the best weapon for the job -- but thats a lot of work that I won't ask you to do.

Anyways thanks for the info, i'll dig at the AI angle for a bit longer and then switch to some slightly less ideal plans that I have devised. If none of those work, i'll leave it as-is. Not a huge deal anyways.
User avatar
Zax
Attila
Posts: 1388
Joined: Sat Feb 19, 2011 6:56 am

Re: Getting an asstank to always use a given weapon

Post by Zax »

Zero Angel wrote:Well, said exploit is already possible. I've seen players drop AT-Stabs on approaching titans or TAG cannon on rocket tanks to make them more killable, but it's not big enough of a deal since most players will just shoot those powerups out of the sky or learn to keep better tabs on their idle assault units (and besides, modders who wish to disable that feature can do so via powerupAcceptMask). That said, the ideal way of controlling weapon switching would be to have it so that it is possible to specify priorities in the gfiles (ie: combatPriority = 30 / AssaultPriority = 80), and then have the AI processes read the priorities out of the weapons files and select the best weapon for the job -- but thats a lot of work that I won't ask you to do.

Anyways thanks for the info, i'll dig at the AI angle for a bit longer and then switch to some slightly less ideal plans that I have devised. If none of those work, i'll leave it as-is. Not a huge deal anyways.
Or perhaps forceWeaponMaskOverride and default to false.
User avatar
S.cavA.rmyG.en
Sabre
Posts: 296
Joined: Fri Mar 04, 2011 3:15 am
Location: ISDF Junk Yard
Contact:

Re: Getting an asstank to always use a given weapon

Post by S.cavA.rmyG.en »

try this

Code: Select all

isAssault = 0
aiName = "SupportProcess"
aiName2 = "SupportProcess"
weaponMask = 00001
weaponAssault1 = 1
User avatar
Zero Angel
Attila
Posts: 1536
Joined: Mon Feb 21, 2011 12:54 am
Contact:

Re: Getting an asstank to always use a given weapon

Post by Zero Angel »

S.cavA.rmyG.en wrote:try this

Code: Select all

isAssault = 0
aiName = "SupportProcess"
aiName2 = "SupportProcess"
weaponMask = 00001
weaponAssault1 = 1
As I expected, that did not accomplish what I wanted it to. It did, however make the Hedoux drive around its target while shooting (SupportProcess w/ no Attack/SubAttack entries), which I found interesting.
User avatar
Red Devil
Recycler
Posts: 4398
Joined: Fri Feb 18, 2011 5:10 pm
Location: High in the Rocky Mountains

Re: Getting an asstank to always use a given weapon

Post by Red Devil »

for the love of Mike, since you're already modifying something, you might as well make AI-specific ships... :roll:
User avatar
Zero Angel
Attila
Posts: 1536
Joined: Mon Feb 21, 2011 12:54 am
Contact:

Re: Getting an asstank to always use a given weapon

Post by Zero Angel »

Cluttering the build menu is not something that's on my Todo list.
User avatar
MrTwosheds
Recycler
Posts: 3059
Joined: Sat Feb 19, 2011 8:37 am
Location: Outer Space
Contact:

Re: Getting an asstank to always use a given weapon

Post by MrTwosheds »

You have to be the first modder ever to have a problem with getting a unit to not use all its weapons. :)

If you had rec/factory consoles you could just give it the one weapon as default, and players could add a gun if they wanted to.
Without consoles a commander has to build every weapon upgrade from the armoury, so adding a gun to a hedoux is just one more upgrade. Personally I always found this lack of consoles a be a big annoyance with the Hadeans. Trying to reintroduce the limitations 1.2 put on units seems like a daft way to go about implementing them in 1.3.
User avatar
Red Devil
Recycler
Posts: 4398
Joined: Fri Feb 18, 2011 5:10 pm
Location: High in the Rocky Mountains

Re: Getting an asstank to always use a given weapon

Post by Red Devil »

good idea, mts; :idea: i may try adding consoles to them; annoys me, too.
User avatar
Zero Angel
Attila
Posts: 1536
Joined: Mon Feb 21, 2011 12:54 am
Contact:

Re: Getting an asstank to always use a given weapon

Post by Zero Angel »

MrTwosheds wrote:You have to be the first modder ever to have a problem with getting a unit to not use all its weapons. :)

If you had rec/factory consoles you could just give it the one weapon as default, and players could add a gun if they wanted to.
Without consoles a commander has to build every weapon upgrade from the armoury, so adding a gun to a hedoux is just one more upgrade. Personally I always found this lack of consoles a be a big annoyance with the Hadeans. Trying to reintroduce the limitations 1.2 put on units seems like a daft way to go about implementing them in 1.3.
It may be something that I will experiment around with after VSR Beta 4.0 gets out the door (which is in a few hours)
User avatar
Ded10c
Recycler
Posts: 3815
Joined: Sun Feb 20, 2011 11:05 am
Location: Stoke-on-Trent
Contact:

Re: Getting an asstank to always use a given weapon

Post by Ded10c »

I'm against it, the lack of consoles was one of the defining factors that shaped the Hadean design.
User avatar
General BlackDragon
Flying Mauler
Posts: 2408
Joined: Sat Feb 19, 2011 6:37 am
Contact:

Re: Getting an asstank to always use a given weapon

Post by General BlackDragon »

AHadley wrote:I'm against it, the lack of consoles was one of the defining factors that shaped the Hadean design.
Yeah. They controlled their weapon loadouts with their minds :shock:
User avatar
MrTwosheds
Recycler
Posts: 3059
Joined: Sat Feb 19, 2011 8:37 am
Location: Outer Space
Contact:

Re: Getting an asstank to always use a given weapon

Post by MrTwosheds »

I'm against it, the lack of consoles was one of the defining factors that shaped the Hadean design.
The fact that consoles couldn't be used, shaped the Hadean design. I am sure if they had worked in 1.2 the Fe devs would have used them.
I'm not saying the hadean design should change, consoles can only improve it and make a greater variety of strategies simpler to achieve. Having to drop power ups on every unit you wish to alter is time consuming for a commander.
I cant see any good reason why the Hadeans should not adopt this aspect of alien technology, while maintaining their traditional regimental structures. Traditionalists would be free to not use them if they wish.
Post Reply