MegaGlest Forum

MegaGlest => Feature requests => Topic started by: Mr War on 10 June 2011, 13:36:56

Title: Minimum range for weapon
Post by: Mr War on 10 June 2011, 13:36:56
One prob with artillery in glest is that they engage targets close to them. How easy/counterproductive is having an optional minimum range for an attack?
Title: Re: Minimum range for weapon
Post by: Omega on 11 June 2011, 06:35:19
One prob with artillery in glest is that they engage targets close to them. How easy/counterproductive is having an optional minimum range for an attack?
Only serious problem with this is that immobile units such as a defense tower could end up becoming helpless to any melee unit, so that one swordman with half health can solo kill a defense tower...
Title: Re: Minimum range for weapon
Post by: Mr War on 11 June 2011, 10:08:06
That's just poor mod design, the Modder would cause that not he engine in my view. In the units I have in mind that weakness is a good thing, stops them being unbeatable.

Title: Re: Minimum range for weapon
Post by: Ishmaru on 11 June 2011, 10:42:04
I agree with mr war.
Both my MRLS unit and Mortar Units could use this... units with arcing projectiles shouldn't be able to hit whats directly in front of them. Of course its an optional thing on a per unit basis.
Title: Re: Minimum range for weapon
Post by: will on 12 June 2011, 22:11:04
I'm still in the exploring-the-code stage on this feature.

Right now the logic seems very simple: when you attack an enemy, you pick the *first* weapon that can engage the appropriate field and then, if beyond range, you move towards it, stopping when in range.

The complication with minimum range becomes where to move to if you are trying to engage a target that is too close.  Ideas anyone?

Generally when in this particular bit of code it would be tempting to evaluate all available weapons that can engage the enemy, and if at that point multiple ones can be used to pick the most lethal.  Or something along those lines.  More ideas anyone?
Title: Re: Minimum range for weapon
Post by: Ishmaru on 12 June 2011, 23:37:54
The complication with minimum range becomes where to move to if you are trying to engage a target that is too close.  Ideas anyone?

If a unit that has no attack skill is approached by an enemy unit it "runs away" Perhaps this behavior could be applied in this situation?

Generally when in this particular bit of code it would be tempting to evaluate all available weapons that can engage the enemy, and if at that point multiple ones can be used to pick the most lethal.  Or something along those lines.  More ideas anyone?
Perhaps you could define in in unit xml.
Code: [Select]
<command>
<type value="multi_attack"/>
<name value="artillery"/>
<image path="../../../../../../icons/icons/gun.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<move-skill value="move_skill"/>
<attack-skill value="artillery_skill"/>
<attack-skill value="machine_gun_skill"/>
</command>

artillery range is 5-10
machine_gun range is 6

behavior should be that since artillery is listed higher than machine_gun it takes higher priority than machine_gun, it would attempt to use artillery. If it cannot, either because of enemy being less than 5 range, or because insufficient ep(if it uses ep), it would attempt to attack with machine gun.

maybe a hold position skill as well:
Code: [Select]
<command>
<type value="multi_attack_stopped"/>
<name value="hold_position"/>
<image path="../../../../../../icons/icons/hold.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<stop-skill value="stop_skill"/>
<attack-skill value="artillery_skill"/>
<attack-skill value="machine_gun_skill"/>
</command>

Unit would not move just use machine_gun for 1-4 range or use artillery at 5-10 range.
Title: Re: Minimum range for weapon
Post by: titi_son on 10 July 2011, 10:23:58
One prob with artillery in glest is that they engage targets close to them. How easy/counterproductive is having an optional minimum range for an attack?
Only serious problem with this is that immobile units such as a defense tower could end up becoming helpless to any melee unit, so that one swordman with half health can solo kill a defense tower...

and how will you teach a cpu to move away with the unit to attack???
Title: Re: Minimum range for weapon
Post by: ElimiNator on 10 July 2011, 21:36:54
Have it auto, if a enemy is in his sight and too close for him to attack then he turns around and moves away until he can attack again.
Title: Re: Minimum range for weapon
Post by: Zoythrus on 10 July 2011, 22:06:24
Have it auto, if a enemy is in his sight and too close for him to attack then he turns around and moves away until he can attack again.

this is how most games do it
Title: Re: Minimum range for weapon
Post by: titi on 11 July 2011, 12:50:02
As the initial idea has aproblem ( discussed above ) this idea may solve another issue!

Imagine you have two attacks ( like the battlemachine ). Now you can make the range attack the default attack and limit it to a distance. If this distance is reached you can be switched automatically to the melee attack of the unit. ( not shure how to handle air attacks , maybe simply ignore the settings or have seperate ones for air and ground ? )
Title: Re: Minimum range for weapon
Post by: Zoythrus on 11 July 2011, 16:13:54
Imagine you have two attacks ( like the battlemachine ). Now you can make the range attack the default attack and limit it to a distance. If this distance is reached you can be switched automatically to the melee attack of the unit. ( not shure how to handle air attacks , maybe simply ignore the settings or have seperate ones for air and ground ? )

i posted this idea right here: https://forum.megaglest.org/index.php?topic=5891.0
Title: Re: Minimum range for weapon
Post by: titi on 11 July 2011, 18:36:30
I know, but this is the way how to implement it!  8)
Title: Re: Minimum range for weapon
Post by: roflcopter on 17 August 2011, 10:56:56
Have it auto, if a enemy is in his sight and too close for him to attack then he turns around and moves away until he can attack again.
Ideally the unit would move backward, playing its animation in reverse while continuing to face the target. That would be more lifelike than the zero-turn-radius catapults we usually see.
Title: Re: Minimum range for weapon
Post by: andy_5995 on 13 January 2020, 20:20:47
Only serious problem with this is that immobile units such as a defense tower could end up becoming helpless to any melee unit, so that one swordman with half health can solo kill a defense tower...

It's a good point, but I don't see it as a serious problem. If a single swordman is attacking my defense tower and I can't have any units to kill the swordman, than I have a bigger problem than losing a defense tower.

Though one way around that is to allow an upgrade "remove minimum range" (0 A.D. has that implemented).

It really makes no sense for catapults to destroy themselves though, to fire at itself. Setting a min range for catapults would make them more fun to use, and make playing against the AI just a little more challenging and less predictable.
Title: Re: Minimum range for weapon
Post by: Coldfusionstorm on 17 March 2020, 22:30:41
Just throwing my 2 cents inhere i agree a minimum range is a good idea!
Title: Re: Minimum range for weapon
Post by: titi on 17 March 2020, 22:44:10
lol, pushing this up after 9 years ? seriously andy ?  :O :D

yeah its a good idea. not sure how hard to do
Title: Re: Minimum range for weapon
Post by: andy_5995 on 18 March 2020, 05:47:44
lol, pushing this up after 9 years ? seriously andy ?  :O :D

Yes, seriously, titi! It's still relevant and needed a bump, imo. :)