Unit "Rules of Engagement" State

Unit "Rules of Engagement" State

Requests for features in the spring code.

Moderator: Moderators

Post Reply
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Unit "Rules of Engagement" State

Post 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!
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Unit "Rules of Engagement" State

Post by FLOZi »

SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Re: Unit "Rules of Engagement" State

Post 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.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Unit "Rules of Engagement" State

Post 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
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Unit "Rules of Engagement" State

Post 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
hokomoko
Spring Developer
Posts: 593
Joined: 02 Jun 2014, 00:46

Re: Unit "Rules of Engagement" State

Post by hokomoko »

Spring.{Get,Set}UnitMaxRange
cleaner than SetCOBValue
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Unit "Rules of Engagement" State

Post 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 :|
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Unit "Rules of Engagement" State

Post by FLOZi »

hokomoko
Spring Developer
Posts: 593
Joined: 02 Jun 2014, 00:46

Re: Unit "Rules of Engagement" State

Post 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.
User avatar
PicassoCT
Journeywar Developer & Mapper
Posts: 10450
Joined: 24 Jan 2006, 21:12

Re: Unit "Rules of Engagement" State

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

Return to “Feature Requests”