Author Topic: Minimum range for weapon  (Read 2187 times)

Mr War

  • Guest
Minimum range for weapon
« 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?

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: Minimum range for weapon
« Reply #1 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...
Edit the MegaGlest wiki: http://docs.megaglest.org/

My personal projects: http://github.com/KatrinaHoffert

Mr War

  • Guest
Re: Minimum range for weapon
« Reply #2 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.


Ishmaru

  • Behemoth
  • *******
  • Posts: 1,066
  • um wat??
    • View Profile
    • DelphaDesign
Re: Minimum range for weapon
« Reply #3 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.
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
Re: Minimum range for weapon
« Reply #4 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?

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,066
  • um wat??
    • View Profile
    • DelphaDesign
Re: Minimum range for weapon
« Reply #5 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.
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Re: Minimum range for weapon
« Reply #6 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???
My first Tilseset: SPRING :) (included in Megaglest )

Secret Hint: To play online join the IRC #megaglest-lobby on freenode which is the lobby chat ingame. So you can chat with or wait for people in the lobby without running megaglest all the time.

ElimiNator

  • Airship
  • ********
  • Posts: 3,390
  • The MegaGlest Moder.
    • View Profile
Re: Minimum range for weapon
« Reply #7 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.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

Zoythrus

  • Guest
Re: Minimum range for weapon
« Reply #8 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

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,225
    • View Profile
    • http://www.titusgames.de
Re: Minimum range for weapon
« Reply #9 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 ? )
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Zoythrus

  • Guest
Re: Minimum range for weapon
« Reply #10 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

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,225
    • View Profile
    • http://www.titusgames.de
Re: Minimum range for weapon
« Reply #11 on: 11 July 2011, 18:36:30 »
I know, but this is the way how to implement it!  8)
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

roflcopter

  • Guest
Re: Minimum range for weapon
« Reply #12 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.

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 441
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
Re: Minimum range for weapon
« Reply #13 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.

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
Re: Minimum range for weapon
« Reply #14 on: 17 March 2020, 22:30:41 »
Just throwing my 2 cents inhere i agree a minimum range is a good idea!
WiP Game developer.
I do danish translations.
"i break stuff"

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,225
    • View Profile
    • http://www.titusgames.de
Re: Minimum range for weapon
« Reply #15 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
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

andy_5995

  • Moderator
  • Ornithopter
  • ********
  • Posts: 441
  • Debian Linux user
    • View Profile
    • Andy Alt's home page
Re: Minimum range for weapon
« Reply #16 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. :)