unitDef= maximal possible/minimal needed distance for attack

unitDef= maximal possible/minimal needed distance for attack

Requests for features in the spring code.

Moderator: Moderators

Post Reply
User avatar
PepeAmpere
Posts: 586
Joined: 03 Jun 2010, 01:28

unitDef= maximal possible/minimal needed distance for attack

Post by PepeAmpere » 28 Jul 2013, 05:48

Currently "maximal possible"/"minimal needed" distance for attack is somehow calculated from shoot range of weapon with the longest shoot range. For units with 2+ weapons (some ordinary weapon + special weapon) its very uncomfortable solution.

I think this thing should be solved by engine, if we would agree attack command execution is engine task :).

Requested on mantis: http://springrts.com/mantis/view.php?id=3900

-------------------------------

Examples of use (in all examples unit gets attack command when 3000 from target):
Unit1 (Headhunter)
- Weapon1: Sabre - Melee (range: 30, DMG: 1500, reload: 1sec)
- Weapon2: Net (range: 800, DMG: 0-20, reload: 15sec, => stun target for 8 seconds)
Result in Spring 94.1: Unit will run to trunget, when 800 from target, it will use the Net, target is stunned, but after it Headhunter just stay 800 from target and do nothing until target moves away or Net is reloaded.

Btw in Spring 91 Unit1 this unit would work ok, because there was some ancient primary/secondary selection of weapons. But yes, i understand why it was changed.
Unit2 (Bismark Zuckerberg - battleship)
- Weapon1: Tripple plasma (range: 850, DMG: 300, reload: 3secs)
- Weapon2: Tripple plasma (range: 850, DMG: 300, reload: 3secs)
- Weapon3: Tripple plasma (range: 850, DMG: 300, reload: 3secs)
- Weapon4: Dua long plasma (range: 1000, DMG: 250, reload: 4secs)
- Weapons5-10: Some shity guns (range: 300-500, DMG: 10-100, reload: variable)
Result in Spring 94.1: Battleship goes to target, when 1000 from target, Weapon4 shoots, and ship is stopped, use only one weapon, because for rest of them target is far away from them.

-------------------------------

Solution:
  • make UnitDef called "MaxAttackDistance" (default <= range of weapon with the longest range, integer)
  • make Lua SyncedCtrl "Spring.SetMaxAttackDistance(unitID)" which can set/change the default/defined value.
Thx, if it can be in 95.0 :mrgreen:
0 x

User avatar
smoth
Posts: 22298
Joined: 13 Jan 2005, 00:46

Re: unitDef= maximal possible/minimal needed distance for at

Post by smoth » 28 Jul 2013, 06:01

why not do min attack as well? that way we can set a range for the unit to try and get within(would be handy with artillery units)
0 x

User avatar
PepeAmpere
Posts: 586
Joined: 03 Jun 2010, 01:28

Re: unitDef= maximal possible/minimal needed distance for at

Post by PepeAmpere » 28 Jul 2013, 06:03

smoth wrote:why not do min attack as well? that way we can set a range for the unit to try and get within(would be handy with artillery units)
Hm, true, currently minimal range for some long range bastards is solved by adding some second "not real weapon", isnt it?
0 x

User avatar
smoth
Posts: 22298
Joined: 13 Jan 2005, 00:46

Re: unitDef= maximal possible/minimal needed distance for at

Post by smoth » 28 Jul 2013, 06:12

I suppose some might. I wouldn't want to do that though.
0 x

raaar
Metal Factions Developer
Posts: 813
Joined: 20 Feb 2010, 12:17

Re: unitDef= maximal possible/minimal needed distance for at

Post by raaar » 06 Aug 2013, 20:41

this is a good idea

also useful for gunships (ex : big gunship with short range rockets + long range missile)
0 x

User avatar
TheFatController
Balanced Annihilation Developer
Posts: 1177
Joined: 10 Dec 2006, 18:46

Re: unitDef= maximal possible/minimal needed distance for at

Post by TheFatController » 31 Aug 2013, 13:36

There used to be a workaround for this I used for BA Chicken Defense units, the unit would move into the range of Weapon1, so theres a few units with fake weapons with smaller ranges to set their engagement range.

Something changed in a Spring update and now units just stop at the range of their longest range weapon.

Something to set the desired engage range on an attack command would be very useful to fix this.
0 x

User avatar
PepeAmpere
Posts: 586
Joined: 03 Jun 2010, 01:28

Re: unitDef= maximal possible/minimal needed distance for at

Post by PepeAmpere » 06 Sep 2013, 23:12

I made hot fix which changes (lower) the range of "longer" weapon after each shot and change it back when weapon reloaded. But its silly solution (work well just for our Dust bug which has 20 secs long range weapon reload), not general solution for every unit and weapons combinations. So touch from engine gods would be sweet ending of this summer.
0 x

Post Reply

Return to “Feature Requests”