Opened 9 years ago

Last modified 17 months ago

#995 new enhancement

[PATCH] Trampling

Reported by: historic_bruno Owned by:
Priority: Should Have Milestone: Work In Progress
Component: Simulation Keywords: patch
Cc: Patch: Phab:D1838

Description (last modified by fatherbushido)

Units with trample damage passively damage opponents in trample range.

There's some outdated info in the design doc:

Attachments (4)

ticket995_trampling_1.diff (1.6 KB ) - added by bb 5 years ago.
Fist simple and ugly patch for this ticket. The maurian chariot no tramples nearby enemy's with 1 HP per second. Work in progress…
ticket995_trampling_3.diff (6.5 KB ) - added by bb 5 years ago.
New version, allow actionmultipliers so an idle unit won't trample.
ticket995_trampling_4.diff (6.2 KB ) - added by bb 5 years ago.
should clean all rubbish…
ticket995_trampling_5.diff (11.7 KB ) - added by bb 5 years ago.
included elephants and a bit of balancing

Download all attachments as: .zip

Change History (37)

by bb, 5 years ago

Attachment: ticket995_trampling_1.diff added

Fist simple and ugly patch for this ticket. The maurian chariot no tramples nearby enemy's with 1 HP per second. Work in progress...

comment:1 by bb, 5 years ago

Milestone: BacklogAlpha 20

Some things need to be done:

  • "Icon" for this aura.
  • Maybe change the "2 HP per second" in a proper hack/pierce attack. (It is 2 not 1 in the patch, my mistake)
  • Include for all units with trample attack.
  • Other number for walking/running/charging (when implanted).
  • Balancing.

Any other things?

Last edited 5 years ago by bb (previous) (diff)

comment:2 by elexis, 5 years ago

Keywords: patch added
Summary: Trampling[PATCH] Trampling
  • are you sure this actually harms the enemy and doesn't heal him?
  • also the damage would be applied if the elephant is standing, which might be a bit weird when playing

comment:3 by stanislas69, 5 years ago

Also Im not sure its the intended fix i thin it needs stamina then charging then trample

by bb, 5 years ago

Attachment: ticket995_trampling_3.diff added

New version, allow actionmultipliers so an idle unit won't trample.

comment:4 by bb, 5 years ago

New patch allows "actionMultipliers", so a different value can be set for different "unitStates". In the patch there is only a value for "IDLE", "WALKING" and "APPROACHING" others need to be entered (just by putting them into the template). Trampling is only implanted for champion horse archers (read chariots), needs to be done for elephants and hero's too. Also the Aura icon is still a placeholder and numbers should be tweaked.

The idea of "actionMultipliers" can also solve #3606 by implanting those for techs too. Maybe FSM.js should call a combined function for auras and techs. Or even this function should be called from UnitAI.js.

comment:5 by stanislas69, 5 years ago

Why does the name have to be in caps ?

in reply to:  5 comment:6 by bb, 5 years ago

Replying to stanislas69:

Why does the name have to be in caps ?

This way it is already stored in game, so we get the current state this way from the "getCurrentState" function.

comment:7 by elexis, 5 years ago

Keywords: review added

comment:8 by Palaxin, 5 years ago

100m trample radius should be adjusted to something like 2m...

comment:9 by elexis, 5 years ago

  • Needs to be rebased since recent aura-updates (redundant code was removed, maybe your code will be shorter too now, specifically Auras.prototype.ApplyBonus)
  • Name of the action in CAPS -> UnitAI state
  • if (this.auras[name].actionMultiplier[action]) sure that this works intentionally for 0?
  • ActionMultiplier -> StateMultiplier?
  • ++x instead of x++
  • The change to StatusBars.js looks okay, but do you recall why it is needed?
  • That what Palaxin said, but likely more than 2m (can be checked using the aura icon)
  • Indentation problem with the XML

If the code works as advertized, it should be committed IMO :)

by bb, 5 years ago

Attachment: ticket995_trampling_4.diff added

should clean all rubbish...

comment:10 by bb, 5 years ago

Replying to elexis:

  • Needs to be rebased since recent aura-updates (redundant code was removed, maybe your code will be shorter too now, specifically Auras.prototype.ApplyBonus)
  • Name of the action in CAPS -> UnitAI state
  • ++x instead of x++
  • ActionMultiplier -> StateMultiplier?
  • Indentation problem with the XML

Done

  • if (this.auras[name].actionMultiplier[action]) sure that this works intentionally for 0?

With testing it works...

  • The change to StatusBars.js looks okay, but do you recall why it is needed?

Yes, if we have an "add" modification of 0 or "multiply of 1, we don't change anything so no icon needs to be showed and this is what the code does. (Also the modifications are not called through to the Auramanager, BTW). Removing auras is done for any aura (e.g. because of moving out of range) also aura's without any modification (e.g add == 0) are removed. What happens than is that we try to remove an icon which is never added and that will trow an error.

  • That what Palaxin said, but likely more than 2m (can be checked using the aura icon)

Made it 5 now (it was 100 for easy testing --> lazy me)

comment:11 by elexis, 5 years ago

  • Elephants (including gaia) should also deal trample damage
  • Radius can be increased, 10m seems to be okay, maybe even more
  • There is a problem, the aura is small and only active while the unit moves. The patch above doesn't inflict any damage at all due to that fact.
  • Usually being kicked by horses and elephants isn't too healthy and should therefore be quite devastating (i.e. stronger than 1HP (/sec?))
  • On the other side, it may not become so OP, that you can kill so many units just by running pass them (which could yield a game where only that unit becomes relevant)

comment:12 by fatherbushido, 5 years ago

The radius is hard to set. Unit must at first charge and gets really close to attacked unit, then if it runs then it makes trample damage. So radius must be small. As charge attack is not yet implemented, it's really hard to deal with that.

It is explained in design docs :

Also while in charge mode they will ignore the bounding boxes of mobile enemy units and attempt to pathfind straight through them. Some units (cavalry, including chariots and elephants, and military ships) have the Run.Trample attributes so gain "trample damage" when in charge mode: opponents within a specified range (typically one cell -- contact range) of the unit suffer a specified amount of damage. Since the unit has to stay in motion in order to retain the charge, they're considered to be crushed under hooves or chariot wheels, rammed by a ship, etc.

In irc logs i saw that too " (an elephant or chariot could charge right through, pushing units out of the way and dealing to them their "tample" aura damage)."

Imo, we really need charging before trampling.

Last edited 4 years ago by fatherbushido (previous) (diff)

comment:13 by Lionkanzen, 5 years ago

Why don't the radius to type of damage, example is not same type damage by scythed chariot, ( by the blades) than a Elephant( by crush?)

by bb, 5 years ago

Attachment: ticket995_trampling_5.diff added

included elephants and a bit of balancing

comment:14 by bb, 5 years ago

Patch above has this balance:

20 chariots decline 36 hp when walking over a unit 10 war elephants: 48 hp 20 archer elephant: 15 hp

We will need to update some tooltips but that will be a different patch (to prevent megapatches).

comment:15 by fatherbushido, 5 years ago

As player, i really want to have this. It's very nice you work on it. (I still think we must have charge before.)

Don't forget it for some warship too (trireme) as roaming is trampling.

I have another question. Wouldn't it be cleaner/better to use a Trample component (like the Heal one) ?

comment:16 by Lionkanzen, 5 years ago

I want test this one, what I need to do, I'm using tortoise SVN , I have experience using patches ( apply over the SVN ) but I don't know how make build, so this need a build? Or compile or that kind stuff.

comment:17 by Lionkanzen, 5 years ago

Double post ooops...

Last edited 5 years ago by Lionkanzen (previous) (diff)

in reply to:  15 ; comment:18 by bb, 5 years ago

I have another question. Wouldn't it be cleaner/better to use a Trample component (like the Heal one) ?

Not sure it is need but can be considered (we mainly need to duplicate almost all aura code to the new component)

I want test this one, what I need to do, I'm using tortoise SVN , I have experience using patches ( apply over the SVN ) but I don't know how make build, so this need a build? Or compile or that kind stuff.

I don't need to rebuild here for this patch, so I think u can just apply patch and try it out ;)

in reply to:  18 comment:19 by Lionkanzen, 5 years ago

Replying to bb:

I don't need to rebuild here for this patch, so I think u can just apply patch and try it out ;)

Thank You.

comment:20 by fatherbushido, 5 years ago

Trampling is finally the same as healing. We can heal with an entity can heal with Aura or Heal component. Imo, but it's vague, we don't have to modify Aura this way, and a Trample component (in the same way as Heal) would be cleaner and will be more robust for future. I don't knwow what you think about that.

in reply to:  20 comment:21 by elexis, 5 years ago

Replying to fatherbushido: Heal affects only one target, while an aura affects all units in range

comment:22 by fatherbushido, 5 years ago

Yes elexis, that why we need another component (but we need only some mods). Moreover, heal have been recently modified to check state of target. In a same way, trample can check state of the source.

comment:23 by Lionkanzen, 5 years ago

Ok here go my feedback, work fine better than I though, only need some visual consistency, a melee animation, specially elephants that are ranged.

comment:24 by Itms, 5 years ago

Milestone: Alpha 20Alpha 21

comment:25 by fatherbushido, 4 years ago

Description: modified (diff)
Keywords: review removed

As aura code has been modified, i put the patch out of the review queue.

Moreover i have some remarks.

  • it seems that in the current version, a unit can only receive damages be under the trample aura of one elephant if there are 10 elephants around it (see stackable auras).
  • for the unitAI states, taking there are some other case as APPROACHING, ATTACKING, WALKINGTOPOINT. Perhaps we should take care about that. We can also just check GetCurrentSpeed in CmpUnitMotion (a low speed for elephants, and a higher for melee cav and chariots). I have not look at that in details.
  • at least, perhaps it would be better to wait for #3610.
Last edited 4 years ago by fatherbushido (previous) (diff)

comment:26 by scythetwirler, 4 years ago

I think we should take the direction of travel into account with the aura (maybe like a 90 degree sweep centered on the forward direction) because imo it would look very strange for an elephant to be running away from a melee cavalry attacking its rear and have trample damage applied to the cavalry.

comment:27 by elexis, 4 years ago

Milestone: Alpha 21Backlog

Backlogging due to lack of progress.

comment:28 by fatherbushido, 3 years ago

Description: modified (diff)
Owner: set to fatherbushido

(I plan to work on that soon)

comment:29 by fatherbushido, 3 years ago

WIP

comment:30 by fatherbushido, 3 years ago

Owner: fatherbushido removed

comment:31 by Imarok, 19 months ago

Component: UI & SimulationSimulation

Move tickets to Simulation as UI & Simulation got some sub components.

comment:32 by Freagarach, 17 months ago

https://code.wildfiregames.com/D1838 Things not yet implemented:

  • Speed-dependency
  • Animation

Could this be used to passively capture units (e.g. goats)?

comment:33 by Freagarach, 17 months ago

Milestone: BacklogWork In Progress
Patch: Phab:D1838
Note: See TracTickets for help on using tickets.