Opened 10 years ago

Last modified 2 years ago

#1912 new enhancement

Continuous damage after hit detection

Reported by: Pureon Owned by:
Priority: Nice to Have Milestone: Backlog
Component: Simulation Keywords:
Cc: vikasmk@… Patch: Phab:D1252

Description (last modified by fatherbushido)

A projectile produces damage for a short period once it has landed/hit the target? Case: Ballista fires burning rock that continues to cause fire damage once it has landed. It can also be used for burning oil and other such weapons.

Attachments (2)

ProofOfConcept.patch (10.3 KB ) - added by Leander Hemelhof 7 years ago.
Proof of concept of the continuous damage system.
ContinuousAttack.patch (9.4 KB ) - added by Leander Hemelhof 7 years ago.
Patch for continuous damage, without edited templates

Download all attachments as: .zip

Change History (28)

comment:1 by Josh, 10 years ago

Owner: set to Josh
Status: newassigned

comment:2 by Siddharth, 9 years ago

Where would I look in the code to find a similar example ? I am interested in implementing this feature.

comment:3 by Josh, 9 years ago

This ticket is currently blocked on #1496 which restructures some things and would make adding this a little more straightforward.

Thank you nondescript for your interest in implementing this, even though that is not exactly a viable option at this time.

Last edited 9 years ago by Josh (previous) (diff)

comment:4 by Josh, 9 years ago

Owner: Josh removed
Status: assignednew

As I've moved on to mostly UI/network programming in 0AD, this ticket would serve better as a starter task for someone new to the simulation.

comment:5 by Ashish Madeti, 8 years ago

I am a starter and would like to work on this task. Can anyone point me to the files which I need to change for this task? Or point me to some place where a similar thing has been attempted.

comment:6 by Josh, 8 years ago

If you haven't yet, make sure you have everything setup as detailed on GettingStartedProgrammers.

Once you have your workspace all setup, the relevant files you'll want to look at are in binaries/data/mods/public/simulation/components and binaries/data/mods/public/simulation/helpers. Most, if not all, your changes should be limited to binaries/data/mods/public/simulation/components/Attack.js and binaries/data/mods/public/simulation/helpers/Damage.js. I'd start by modeling a function (something like Damage.CauseContinuousDamage) off of the existing Damage.CauseDamage function in Damage.js which is a good model of proper code.

Now that you've written the function that does the work in Damage.js we need to call it. This is where Attack.js comes in. Look at how it currently calls the CauseDamage function and model how it calls your function off of that.

Good luck! 0 A.D. can be a little overwhelming at first, but persevere and you won't regret it. If you have any questions, go ahead and ask (however, it is nice if you would search Trac and Google first).

comment:7 by Ashish Madeti, 8 years ago

Owner: set to Ashish Madeti

comment:8 by historic_bruno, 8 years ago

Any updates?

comment:9 by leper, 8 years ago

Owner: Ashish Madeti removed

comment:10 by vikas MK, 7 years ago

Cc: vikasmk@… added

Hi, I'm a beginner and would like to take a shot at this. I've gone through the "getting started guide". I've a bit of experience with C,Cpp and python. Java script is new to me ( willing to learn though). 

I will go through the Damage.js and Attack.js code and get back to you.

comment:11 by Stan`, 7 years ago


nice to see someone working on this. If you want you can drop by on IRC #0ad-dev. Once you have a working patch, don't forget to submit it here, and to accept the ticket as your own :)

comment:12 by wraitii, 7 years ago

Milestone: BacklogAlpha 20

As Stanislas said, feel free to ask questions on IRC (even if no-one answer immediately, we often read the logs and we have your email) or on the forums.

Thkans for working on this :)

comment:13 by elexis, 7 years ago

Milestone: Alpha 20Backlog

Backlogging due to lack of progress.

by Leander Hemelhof, 7 years ago

Attachment: ProofOfConcept.patch added

Proof of concept of the continuous damage system.

by Leander Hemelhof, 7 years ago

Attachment: ContinuousAttack.patch added

Patch for continuous damage, without edited templates

comment:14 by fatherbushido, 7 years ago

I guess it was planned to do #3610 before (The first step is to have a damage component: move some stuff of attack and from the damage helpers to that component). Feel free to come to the irc channel #0ad-dev to discuss and get feedback.

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

comment:15 by fatherbushido, 6 years ago

It seems that now you can rebase your patch as #3610 is done.

comment:16 by Mate-86, 6 years ago

Description: modified (diff)
  • I see 2 different approaches here. Which one do you prefer?

a) flaming projectile "ignites" the target which suffers damage for a while regardless of running away b) flaming projectile causes fire on the area of hit and units in this area are damaged during the fire

  • Is friendlyFire need to be considered? If yes then should friendlyFire be an attribute of the Continuous attack block or should it be inherited from the parent block (eg. Ranged attack block).

comment:17 by fatherbushido, 6 years ago

Description: modified (diff)

Hi Leander Hemelhof, Mate-86, any of you still interested by that?

comment:18 by Mate-86, 6 years ago

I'm interested once my questions are answered. :)

comment:19 by fatherbushido, 6 years ago

1) I guess for the moment we could go for a) b) is interesting too but then could come other question like should we enable point attack, etc... So keep it like that. 2) Uhm it depends of how you do it. You will set Continuous damage as an attribute of each kind of attack (melee and ranged)?

Well, we need to discuss it... What's your idea?

Btw, I wonder if in fact #1911 couldn't be merged in that one? (a prepare time and a repeat time in fact).

comment:20 by Mate-86, 5 years ago

Owner: set to Mate-86
Status: newassigned

comment:21 by elexis, 5 years ago

Keywords: Simple removed
Milestone: BacklogWork In Progress
Patch: Phab:D1252
Type: taskenhancement

comment:22 by Imarok, 4 years ago

Component: UI & SimulationSimulation

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

comment:23 by wraitii, 4 years ago

As said on Phabricator, I think this should be done through implementing a Status component that deals various effects.

The case (2) above of a burning projectile should be handled in the projectile class directly imo.

comment:24 by wraitii, 4 years ago

In 22304:

Allow entities to be affected by Status Effects from ranged attacks.

This implements a status effects receiver component (in a similar fashion to the damage receiver component). The plan is to further extend this component notably to handle graphical indication of status effects, and a variety of other effects.

Currently implemented: ranged attacks can inflict status effects that reduce HP over time.
This can be resisted by armour.

No units currently utilise this in-game but with proper graphics support that could be changed.

Patch By: Mate-86

Reviewed By: wraitii

References #1912

Differential Revision:

comment:25 by Mate-86, 3 years ago

Owner: Mate-86 removed
Status: assignednew

comment:26 by Silier, 2 years ago

Milestone: Work In ProgressBacklog
Note: See TracTickets for help on using tickets.