Author Topic: "Autocast" attacks  (Read 8234 times)

Zoythrus

  • Guest
"Autocast" attacks
« on: 14 September 2010, 01:20:27 »
ok, something simple: when a unit has two attacks (a ranged and a melee), the melee should be able to be set to auto. auto would mean that enemies that come in range would feel the wrath of the melee attack (not the ranged).

this is really needed...

Topic moved from MegaGlest board by Ultifd
« Last Edit: 18 July 2011, 05:11:40 by Omega »

Valetdepik

  • Guest
Re: "Autocast" attacks
« Reply #1 on: 14 September 2010, 01:36:13 »
Yeeeeaaaaah, Zoythrus  as correct...
Cause it's a bit ennoyin' to say "hey you, you're attacked" if ya see what I mean ^^ ...
The characters are just crazy ^^
             Â±END¤CONNEXION±

emscape

  • Guest
Re: "Autocast" attacks
« Reply #2 on: 16 September 2010, 20:05:03 »
indeed I agree

Mark

  • Guest
Re: "Autocast" attacks
« Reply #3 on: 21 September 2010, 02:01:26 »
This has something to do with my charge idea, because it involves switching attacks.  If one is implemented, the other is easily implemented as well.

claymore

  • Guest
Re: "Autocast" attacks
« Reply #4 on: 12 October 2010, 19:11:04 »
Bump. This would be really useful.

Little Helper

  • Guest
Re: "Autocast" attacks
« Reply #5 on: 20 October 2010, 22:27:58 »
I really would see this in Megaglest and just a quick question guys, how do you save your game in MG? ::)

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: "Autocast" attacks
« Reply #6 on: 20 October 2010, 23:16:54 »
I really would see this in Megaglest and just a quick question guys, how do you save your game in MG? ::)
You can't save in MG, only in GAE.

Zoythrus

  • Guest
Re: "Autocast" attacks
« Reply #7 on: 20 October 2010, 23:19:48 »
GAE needs this too!

Little Helper

  • Guest
Re: "Autocast" attacks
« Reply #8 on: 20 October 2010, 23:33:41 »
Darn I hoped the latest MG would have SG  :( guess I have to wait.  :angel:

the warlord of the reich

  • Guest
Re: "Autocast" attacks
« Reply #9 on: 5 December 2010, 01:55:44 »
nope it should hold its ground and shoot like any person with sense. if the enemy'ss a ranged too it should shoot a few and charge.

also how about a mod allows cavalry to dismount or allows units to attack while moving and charging?

would be fun

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Re: "Autocast" attacks
« Reply #10 on: 11 July 2011, 20:16:30 »
what is if the range attack is better then the melee and what is if there are 2 range ( one with range 3 and one with 9 for example ) and one melee?
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.

Zoythrus

  • Guest
Re: "Autocast" attacks
« Reply #11 on: 11 July 2011, 20:37:55 »
what is if the range attack is better then the melee and what is if there are 2 range ( one with range 3 and one with 9 for example ) and one melee?

well, im not too sure.....i cant solve everything....

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: "Autocast" attacks
« Reply #12 on: 11 July 2011, 21:09:30 »
what is if the range attack is better then the melee and what is if there are 2 range ( one with range 3 and one with 9 for example ) and one melee?

well, im not too sure.....i cant solve everything....
The solution would be modder defined priorities. Have a <priority value="1" /> tag in the attack skill, where lower numbers (1 = first priority) would be used over higher numbers. So if there are two ranged skills, one priority 1, and the other priority 2, it will always use the priority 1 until it cannot anymore. If it can't use priority one, but can use priority two (let's say 1 is a ranged attack that has a minimum range, and 2 is dropping a rock, which has no minimum range, but can't fire as far). Finally, when right up to the foe, use the melee attack. Obviously the CPU will not be perfect, a human player may decide to force the use of the range attack on a different unit, based on the situation.
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: "Autocast" attacks
« Reply #13 on: 11 July 2011, 21:59:37 »
The solution would be modder defined priorities. Have a <priority value="1" /> tag in the attack skill, where lower numbers (1 = first priority) would be used over higher numbers. So if there are two ranged skills, one priority 1, and the other priority 2, it will always use the priority 1 until it cannot anymore. If it can't use priority one, but can use priority two (let's say 1 is a ranged attack that has a minimum range, and 2 is dropping a rock, which has no minimum range, but can't fire as far). Finally, when right up to the foe, use the melee attack. Obviously the CPU will not be perfect, a human player may decide to force the use of the range attack on a different unit, based on the situation.
I think an easier syntax would be to prioritize them based on what order they occur in the XML, i.e. first skill listed is first skill used.

Mr War

  • Guest
Re: "Autocast" attacks
« Reply #14 on: 11 July 2011, 22:20:03 »
maybe the engine should calculate the most effective (strength & speed) and use whichever is more powerful for a given range. So if they are both in range, it'll chose the more powerful, If both equal, chose first. It think it could ignore attack type (piercing, impact etc) and opponent armor type but those are also variables it could use to make the most effective decision.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: "Autocast" attacks
« Reply #15 on: 11 July 2011, 23:38:04 »
maybe the engine should calculate the most effective (strength & speed) and use whichever is more powerful for a given range. So if they are both in range, it'll chose the more powerful, If both equal, chose first. It think it could ignore attack type (piercing, impact etc) and opponent armor type but those are also variables it could use to make the most effective decision.
I think it's better to let the order (as per john) or priority (as per me above) do this. Not only does the engine no longer have to perform a calculation each attack, but the modder probably knows the effectiveness of the attacks better than any AI could calculate, especially if there are other things to take into attribute, such as special effects the attack may have, splash, etc. As well, if the engine stuttered due to pathfinding, who's to say mass calculations during a large scale battle wouldn't do the same?
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

Zoythrus

  • Guest
Re: "Autocast" attacks
« Reply #16 on: 12 July 2011, 02:03:17 »
i think that it should go with Omega's way - set priorities; but John's could be the default behavior (if priorities arent set)

Mr War

  • Guest
Re: "Autocast" attacks
« Reply #17 on: 12 July 2011, 06:16:35 »
I agree John's way is simplest and likely to incur least overhead.
the modder probably knows the effectiveness of the attacks better than any AI could calculate, especially if there are other things to take into attribute, such as special effects the attack may have, splash, etc.
hehe, I doubt that man, we're talking math.

Omega

  • MegaGlest Team
  • Dragon
  • ********
  • Posts: 6,167
  • Professional bug writer
    • View Profile
    • Personal site
Re: "Autocast" attacks
« Reply #18 on: 12 July 2011, 07:09:32 »
I agree John's way is simplest and likely to incur least overhead.
the modder probably knows the effectiveness of the attacks better than any AI could calculate, especially if there are other things to take into attribute, such as special effects the attack may have, splash, etc.
hehe, I doubt that man, we're talking math.
Well, MG is pretty simple, but throw in some GAE effect tags and then things get a bit more complicated. If the priority tag was used, suppose you could have the same priority to two skills, which would cause a calculation? Or if priority isn't specified, it would do the calculation.

Either way really works, and both are inferior to Lua allies so, so badly.
Edit the MegaGlest wiki: http://docs.megaglest.org/

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

titi_son

  • Draco Rider
  • *****
  • Posts: 283
  • titi_son
    • View Profile
Re: "Autocast" attacks
« Reply #19 on: 14 July 2011, 00:16:14 »
is this really NEEDED??? I mean won't the gameplay be boring if the units "Autocast" attacks.
This may be included to improve the cpu but not for humans i think  :|
at the moment there is only the battle_machine right ? (and the ones with air attacks) i think if you have a faction where you only have one unit and you always do upgrades to unlock new attacks (or something like this) the cpu will be very bad!
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.

Zoythrus

  • Guest
Re: "Autocast" attacks
« Reply #20 on: 14 July 2011, 02:05:42 »
@PT - you realize that this is for realism, right? the point is that it doesnt make much sense for an archer to attempt to fire at a guy who is an inch away from him! also, many times the melee attack is better than the range, so you'd think that the unit would use their melee if an enemy unit is using melee against them.

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: "Autocast" attacks
« Reply #21 on: 14 July 2011, 02:23:17 »
I think it's also good for flow, too.  There's a balance between being macro-focused and being micro-focused, but sadly you can't please everybody all the time.

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: "Autocast" attacks
« Reply #22 on: 14 July 2011, 04:19:33 »
@PT - you realize that this is for realism, right? the point is that it doesnt make much sense for an archer to attempt to fire at a guy who is an inch away from him! also, many times the melee attack is better than the range, so you'd think that the unit would use their melee if an enemy unit is using melee against them.
Sure its more realistic, but that's for the player to do. DO NOT automate MG.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

Zoythrus

  • Guest
Re: "Autocast" attacks
« Reply #23 on: 14 July 2011, 14:33:56 »
I think it's also good for flow, too.  There's a balance between being macro-focused and being micro-focused, but sadly you can't please everybody all the time.
:thumbup:
you need a balance, too much in either direction and it's not fun. you really need to have some ability for the units to "think" for themselves. it doesnt make much sense if a unit who can prevent another unit from dying (like, from a poison attack or something) just sits there and doesnt do anything. there's nothing worse than having to babysit a bunch of units when instead you could be preparing for another attack

ElimiNator

  • Airship
  • ********
  • Posts: 3,391
  • The MegaGlest Moder.
    • View Profile
Re: "Autocast" attacks
« Reply #24 on: 14 July 2011, 15:08:24 »
What you say for them to do, the units should do.
Get the Vbros': Packs 1, 2, 3, 4, and 5!

 

anything