News:

If you are a developer, please build MegaGlest on your own and get in touch to contribute (or post your patches on the forums).

Main Menu

"Autocast" attacks

Started by Zoythrus, 14 September 2010, 01:20:27

Zoythrus

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

Valetdepik

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


Mark

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

Bump. This would be really useful.

Little Helper

I really would see this in Megaglest and just a quick question guys, how do you save your game in MG? ::)

John.d.h

Quote from: Little Helper 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? ::)
You can't save in MG, only in GAE.

Zoythrus


Little Helper

Darn I hoped the latest MG would have SG  :( guess I have to wait.  :angel:

the warlord of the reich

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

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

Quote from: PT 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?

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

Omega

Quote from: Zoythrus on 11 July 2011, 20:37:55
Quote from: PT 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?

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

Quote from: Omega on 11 July 2011, 21:09:30
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

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

Quote from: Mr War 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.
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

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

I agree John's way is simplest and likely to incur least overhead.
Quote from: Omega on 11 July 2011, 23:38:04
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

Quote from: Mr War on 12 July 2011, 06:16:35
I agree John's way is simplest and likely to incur least overhead.
Quote from: Omega on 11 July 2011, 23:38:04
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

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

@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

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

Quote from: Zoythrus 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.
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

Quote from: John.d.h 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.
: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

What you say for them to do, the units should do.
Get the Vbros': Packs 1, 2, 3, 4, and 5!