Limited fire-arc behaviour problem
Moderator: Moderators
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Limited fire-arc behaviour problem
In IW, our stormtroopers have a limited fire arc so that they cannot twist their torsos 360 degrees.
However, in many instances when a stormtrooper is attacked from behind, or even anywhere outside his fire arc, he will not turn to face the attacker in order to move the attacker into his fire arc.
As far as I can tell this is a spring-related problem, not mod-related.
This is not a consistent problem - sometimes units will turn to face the attacker, other times they will sit around and be shot in the back. My guess is that if units need to move to intercept a unit that is in LOS but not range then they will turn around, because the 'move to intercept' orients them the right way, but if the unit is in range and LOS at the same time, then the unit does not turn to engage.
A fix for this would be greatly appreciated, limited-arc behaviour is common to many non-TA mods, so this sort of behaviour is really essential.
However, in many instances when a stormtrooper is attacked from behind, or even anywhere outside his fire arc, he will not turn to face the attacker in order to move the attacker into his fire arc.
As far as I can tell this is a spring-related problem, not mod-related.
This is not a consistent problem - sometimes units will turn to face the attacker, other times they will sit around and be shot in the back. My guess is that if units need to move to intercept a unit that is in LOS but not range then they will turn around, because the 'move to intercept' orients them the right way, but if the unit is in range and LOS at the same time, then the unit does not turn to engage.
A fix for this would be greatly appreciated, limited-arc behaviour is common to many non-TA mods, so this sort of behaviour is really essential.
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Re: Limited fire-arc behaviour problem
So, according to that thread, the problem will be fixed next Spring release?
Re: Limited fire-arc behaviour problem
I wrote all of that whilst getting your infantry functional, over a year ago.
And no, it still doesn't work perfectly. The invisa-weapon thing doesn't really fix it completely. I've considered other things, but haven't experimented with them yet- among other things, Lua could almost certainly handle this, by giving the unit a new heading. That'd badly break patrol behaviors, though, without a lot of complex overhead.
And I know for a fact that units will turn if fired upon, but won't automatically turn to engage the closest target that's in LOS.
The CAI code is supposed to make units turn to a heading that will allow Weapon1 to fire, always. It doesn't work. I dunno whether it's because it's not reading the vector right, isn't reading the right vector, or has another problem, but that's almost certainly what's wrong with this. I don't know vector mathematics, though, so I could be wrong. My guess, though, is that it's always reading from the Y vector, and doesn't deal with the cones right, because it doesn't read from the center of the cones, or reads it as if the cone points straight up. Because when the unit is turned the right way, it engages correctly.
And no, it still doesn't work perfectly. The invisa-weapon thing doesn't really fix it completely. I've considered other things, but haven't experimented with them yet- among other things, Lua could almost certainly handle this, by giving the unit a new heading. That'd badly break patrol behaviors, though, without a lot of complex overhead.
And I know for a fact that units will turn if fired upon, but won't automatically turn to engage the closest target that's in LOS.
The CAI code is supposed to make units turn to a heading that will allow Weapon1 to fire, always. It doesn't work. I dunno whether it's because it's not reading the vector right, isn't reading the right vector, or has another problem, but that's almost certainly what's wrong with this. I don't know vector mathematics, though, so I could be wrong. My guess, though, is that it's always reading from the Y vector, and doesn't deal with the cones right, because it doesn't read from the center of the cones, or reads it as if the cone points straight up. Because when the unit is turned the right way, it engages correctly.
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Re: Limited fire-arc behaviour problem
Yeah, I thought you might've. At the moment our infantry require a hell of a lot of babysitting, or else they can die without firing a shot, which is shockingly frustrating for players.
Re: Limited fire-arc behaviour problem
My ships in THIS won't turn at all if they have secondary weapons that can shoot at the target, it's the reason I limited all turrets to forward firing on ships that have forward weapons.
Re: Limited fire-arc behaviour problem
WZ, take a look at turretless vehicles in S'44 svn (Marder has this for sure, and maybe StuG III). We have a script that makes them turn to face the enemy, it involves the use of This may work for your inf, too.
Code: Select all
set HEADING
Re: Limited fire-arc behaviour problem
set HEADING is not ideal, imo.
It flat-out changes the unit's heading, and it looks rough, if not done very slowly. Getting to KDR's point, though- wtf? I thought Weapon1 was always supposed to provide the heading the CAI turns the unit to... hmm, I guess I'll take a look at the code for this again, but meh, not for a few days.
It flat-out changes the unit's heading, and it looks rough, if not done very slowly. Getting to KDR's point, though- wtf? I thought Weapon1 was always supposed to provide the heading the CAI turns the unit to... hmm, I guess I'll take a look at the code for this again, but meh, not for a few days.
Re: Limited fire-arc behaviour problem
Could I get a beta copy of IW so I can take another crack at fixing this engine side?
Re: Limited fire-arc behaviour problem
Meh. Units don't turn any smoother than what you can do with set HEADING anyway. The pointer in KP turns perfecly fine.Argh wrote:It flat-out changes the unit's heading, and it looks rough, if not done very slowly.
Re: Limited fire-arc behaviour problem
Argh: you don't have to set HEADING right to the needed value at once. Do a loop and set it in small increments, the unit will look like it's turning on its own (Spring lacks a 'Turn this direction' interface button btw, OTA had little use for that, but newer mods would need it. LuaUI job?). As I said before, take a look at new S'44 Marder script, it has that (I'm not sure you have S'44 svn access though, ask on S'44 forums if you want to get it).
Re: Limited fire-arc behaviour problem
Test case used: Give enemy imp_i_stormtrooper. Give self rep_i_veterantrooper. Set trooper to hold fire and cloak. Move behind storm. Uncloak. Storm should turn and fire. Cloak. Move behind again. Uncloak. Prior to fix, storm will not turn and fire, but post fix it should.Revision 5996 wrote:Add a section of MobileCAI::IdleCheck() that checks for the targetUnit, and assigns an attack command on it. This should remove at least one case where a unit with restricted fire-arc weapons fails to turn to attack.
Hopefully that is the only problematic case. If you still have problems, please let me know, preferably with specific units to use to test, or even a full test case.
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Re: Limited fire-arc behaviour problem
Thanks Titan, we really appreciate the effort.
Re: Limited fire-arc behaviour problem
If it's committed, I'll test it when I get home...
Re: Limited fire-arc behaviour problem
If it wasn't committed, it wouldn't have a revision number
Re: Limited fire-arc behaviour problem
LOL, yes, well I got done driving a long way, then I did a bunch of stuff involving 90% humidity and trees, so I apparently lost the ability to read
Home in air-conditioning now, thank goodness, and compiling.

Home in air-conditioning now, thank goodness, and compiling.
Re: Limited fire-arc behaviour problem
Tested with Rev. 6005.
No real change in behavior seen. Units did not turn to face enemy Units until attacked, then moved towards attackers. Roam behavior seemed to indicate that units were only leaving patrol paths to see enemies who came within the cone of the aiming arc.
I tested this with P.U.R.E., not IW, but meh, I wrote most of that stuff in IW over a year ago, and what I'm doing in P.U.R.E. is essentially the same. Whatever reaction is occuring, happens far too slowly to matter, at least in P.U.R.E., where by the time a unit starts changing direction, it's probably already dead. I'm sure the same happens in IW, with all of the troops. The reaction needs to happen as soon as stuff enters LOS, or it's not effective.
No real change in behavior seen. Units did not turn to face enemy Units until attacked, then moved towards attackers. Roam behavior seemed to indicate that units were only leaving patrol paths to see enemies who came within the cone of the aiming arc.
I tested this with P.U.R.E., not IW, but meh, I wrote most of that stuff in IW over a year ago, and what I'm doing in P.U.R.E. is essentially the same. Whatever reaction is occuring, happens far too slowly to matter, at least in P.U.R.E., where by the time a unit starts changing direction, it's probably already dead. I'm sure the same happens in IW, with all of the troops. The reaction needs to happen as soon as stuff enters LOS, or it's not effective.
Re: Limited fire-arc behaviour problem
Could you tell me a specific unit in PURE to test with?
Re: Limited fire-arc behaviour problem
Sure. Use Heavy Shells.
Testing routine's straightforward, just /give some to yourself, north of some you give to the enemy (to really watch the whole dynamic, put them far enough away they don't start in LOS).
Since, when you /give, units always face South, you can then march your units up behind the Heavy Shells, and see what happens next. When I just tested it, the Heavy Shells didn't even start turning, until well after the units behind them had gotten into range and attacked them. I think it's the weapon range that is causing this to happen, so this may be the real issue- maybe try increasing the range of the Heavy Shell's gun to the same length as LOS, see if it keeps happening?
Testing routine's straightforward, just /give some to yourself, north of some you give to the enemy (to really watch the whole dynamic, put them far enough away they don't start in LOS).
Since, when you /give, units always face South, you can then march your units up behind the Heavy Shells, and see what happens next. When I just tested it, the Heavy Shells didn't even start turning, until well after the units behind them had gotten into range and attacked them. I think it's the weapon range that is causing this to happen, so this may be the real issue- maybe try increasing the range of the Heavy Shell's gun to the same length as LOS, see if it keeps happening?
Re: Limited fire-arc behaviour problem
Careful, spawned and never turned units can have weird reactions that units that were moved even once don't exhibit.