Jump to content

(Secondary) attack types (https://code.wildfiregames.com/D368)


Recommended Posts

Hi! If it is of any interest, i've found that if you copy the <melee> attack of a spearman.xml and add it to a javelineer.xml file it will show on the ui, but the javelineer will still only use it's ranged attack. However, if you change the <PreferredClasses datatype="tokens"> of that <melee> attack from "Human" to "Structure", when you order those Javelineers to attack a structure, they will use the melee attack instead of the ranged one. I even changed the damage of the melee attack to something stupid like 250 Hack just to be sure that it wasn't using the damage values of the ranged attack.

I might be wrong, but this small experiment leads me to believe that it might be possible to implement the secondary attack mechanic by making use of this preference thing.

Also, i found in the component Attack.js a GetBestAttackAgainst function (lines 343 to 378), that draws a distinction between Slaughter, Capture and other forms of attack. I don't know if this function is used or not since i haven't found another reference to it, but it might be possible to add more distinctions to it (maybe even one based on distance between units and stuff).

I don't know if this will help but, who knows?

Link to comment
Share on other sites

6 hours ago, Micfild said:

Hi! If it is of any interest, i've found that if you copy the <melee> attack of a spearman.xml and add it to a javelineer.xml file it will show on the ui, but the javelineer will still only use it's ranged attack. However, if you change the <PreferredClasses datatype="tokens"> of that <melee> attack from "Human" to "Structure", when you order those Javelineers to attack a structure, they will use the melee attack instead of the ranged one. I even changed the damage of the melee attack to something stupid like 250 Hack just to be sure that it wasn't using the damage values of the ranged attack.

I might be wrong, but this small experiment leads me to believe that it might be possible to implement the secondary attack mechanic by making use of this preference thing.

Also, i found in the component Attack.js a GetBestAttackAgainst function (lines 343 to 378), that draws a distinction between Slaughter, Capture and other forms of attack. I don't know if this function is used or not since i haven't found another reference to it, but it might be possible to add more distinctions to it (maybe even one based on distance between units and stuff).

I don't know if this will help but, who knows?

Well it already works in @bb_'s patch

Link to comment
Share on other sites

  • 4 months later...
  • 2 years later...

From what I see it is wanted mostly to give to some units the abilities to switch between ranged and melee attacks. But I think it is more complex than that.

The cases I identified are:

  1. Infantry ranged and infantry melee.
  2. Cavalry melee and cavalry trampling.
  3. Cavalry charged attack and cavalry melee.
  4. Naval ranged and naval melee (ramming).
  5. Siege ranged and siege melee.
  6. Elephant ranged and elephant melee.

In some cases, the wanted feature is a switch between melee and ranged that would be manually activated.

In other cases it is multiple attacks simultaneously like archers on elephants and siege towers with battering ram.

  • Like 2
Link to comment
Share on other sites

1 hour ago, Genava55 said:

A poll on aoe forum suggests people want an automatic switch from ranged to melee when fighting in close combat:

https://forums.ageofempires.com/t/poll-should-ranged-units-switch-to-melee-attack-in-close-combat/240872

I agree with the results.

personally I would rather have different stances that define the automatic switching logic, than let users do all the switching.

  • Like 1
Link to comment
Share on other sites

13 hours ago, Genava55 said:

From what I see it is wanted mostly to give to some units the abilities to switch between ranged and melee attacks. But I think it is more complex than that.

The cases I identified are:

  1. Infantry ranged and infantry melee.
  2. Cavalry melee and cavalry trampling.
  3. Cavalry charged attack and cavalry melee.
  4. Naval ranged and naval melee (ramming).
  5. Siege ranged and siege melee.
  6. Elephant ranged and elephant melee.

In some cases, the wanted feature is a switch between melee and ranged that would be manually activated.

In other cases it is multiple attacks simultaneously like archers on elephants and siege towers with battering ram.

Right, some of these are wholly different features. Such as the mentioned archer in elephant tower.

 

2 hours ago, alre said:

I agree with the results.

personally I would rather have different stances that define the automatic switching logic, than let users do all the switching.

Agreed as well. For a battalion system where you are controlling only 10-20 battalion "entities" manual switching makes way more sense. When you have 200 individual little soldiers to control, manual makes less sense.

Link to comment
Share on other sites

1 hour ago, wowgetoffyourcellphone said:

Right, some of these are wholly different features. Such as the mentioned archer in elephant tower.

 

Agreed as well. For a battalion system where you are controlling only 10-20 battalion "entities" manual switching makes way more sense. When you have 200 individual little soldiers to control, manual makes less sense.

Controls will be needed for battalions in the long run and they will fight a little more in order.

Also the bonuses from the formations.

 

 

Edited by Lion.Kanzen
Link to comment
Share on other sites

57 minutes ago, wowgetoffyourcellphone said:

Agreed as well. For a battalion system where you are controlling only 10-20 battalion "entities" manual switching makes way more sense. When you have 200 individual little soldiers to control, manual makes less sense.

even in total war, the only real reason for manual switch is that ammo is limited. but still, soldiers do automatically switch to melee if engaged.

Link to comment
Share on other sites

2 hours ago, alre said:

even in total war, the only real reason for manual switch is that ammo is limited. but still, soldiers do automatically switch to melee if engaged.

The biggest difference in total war is that ranged units are locked by melee units when the fight is engaged. It is difficult to disengage the ranged units without taking massive losses.

3 hours ago, wowgetoffyourcellphone said:

Right, some of these are wholly different features. Such as the mentioned archer in elephant tower.

Yes. But it means the implementation of the attacks in javascript should take in account the different possibilities we could use. And the IA is the biggest issue because it should be adapted to use the features.

3 hours ago, wowgetoffyourcellphone said:

Agreed as well. For a battalion system where you are controlling only 10-20 battalion "entities" manual switching makes way more sense. When you have 200 individual little soldiers to control, manual makes less sense.

Obviously the best is to group all the units with this feature and to associate them to the same key.

Edited by Genava55
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...