Page 1 of 1

Unit "Rules of Engagement" State

Posted: 17 May 2015, 18:46
by SpikedHelmet
I am having trouble getting multi-weapon units to behave how I want them to, mainly because FireState and MoveState are somewhat limited in terms of controlling when, where and how a unit attacks another unit. Specifically, the fact that a unit will stop and engage an enemy as soon as any one of its weapons are in range means a unit with a weak long-range support weapon and a powerful close-range main weapon will stand there firing the weak weapon, rather than close in to engage with its powerful weapon.

The only "way" around this is slaving the longer-range weapon to the short-range weapon but this is not ideal, and only works if the unit is set to hold position.

So I request an additional state command that tells a unit at what range it can stop moving towards a target and just fire. Call it 'engagementState', if you will.

It would have two modes:

Default/Normal/Passive, in which case the unit will behave as it does now, only approaching targets until any of its weapons are in range (aka its longest-ranged weapon starts shooting);

and

Aggressive/Full/etc, in which case the unit will approach the target until ALL of its weapons, or at least its Weapon 1, are in range (but will still fire its long-range weapons as it's closing in).

That is all, thank you for your time!

Re: Unit "Rules of Engagement" State

Posted: 17 May 2015, 18:49
by FLOZi

Re: Unit "Rules of Engagement" State

Posted: 17 May 2015, 19:26
by SpikedHelmet
As far as I can tell this would only determine what range beyond maximum weapon range a unit would move to engage? It still wouldn't move any closer to a unit than it needs to start firing any (aka its maximum range) weapon.

Re: Unit "Rules of Engagement" State

Posted: 17 May 2015, 19:32
by FLOZi
yeah we need to be able to set maxRange too.

I had a pull request but it was rejected. Someone else had one too.. BrainDamage maybe?

https://github.com/spring/spring/pull/194

But that only recalculates it - we need to be able to set it directly.

edit: herp... looks like it wasn't rejected afterall? https://github.com/spring/spring/pull/126

Re: Unit "Rules of Engagement" State

Posted: 29 May 2015, 17:53
by FLOZi
I can't read github apparantly. Wasn't rejected but was never accepted. I know devs have a distaste for SetUnitValue but where else would this go? Seems ridiculous to add Spring.{Get,Set}UnitMaxRange just for this

Re: Unit "Rules of Engagement" State

Posted: 29 May 2015, 18:38
by hokomoko
Spring.{Get,Set}UnitMaxRange
cleaner than SetCOBValue

Re: Unit "Rules of Engagement" State

Posted: 29 May 2015, 20:54
by FLOZi
I disagree (it is not SetCOBValue and there are other unit-script constants that can still only be set by this function) - but I am willing to implement it via its own callin. What is quite upsetting is receiving zero feedback on the PR for 6 months :|

Re: Unit "Rules of Engagement" State

Posted: 29 May 2015, 22:27
by FLOZi

Re: Unit "Rules of Engagement" State

Posted: 30 May 2015, 00:34
by hokomoko
What is quite upsetting is receiving zero feedback on the PR for 6 months :|
The current state of mind of the repository owners makes contributions difficult.
Partly justified due to lots of bad suggestions/code/patches but in the end there's a lot to lose in good contributions that will benefit everybody.

Like DRM this hurts the good users more than the bad users.

Re: Unit "Rules of Engagement" State

Posted: 19 Jul 2015, 18:38
by PicassoCT
Lua it?

MultiStateButton <-> UnitRectionOnAttack(State)

Could be even tweaked to allow for things like intelligent reaction on gamedev side for the unit?

(React with Retreat out of Range with follow up attack on old position) etc.

TL,DR;