Opened 6 years ago

Last modified 6 days ago

#1912 new enhancement

Continuous damage after hit detection

Reported by: Pureon Owned by:
Priority: Nice to Have Milestone: Work In Progress
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 3 years ago.
Proof of concept of the continuous damage system.
ContinuousAttack.patch (9.4 KB) - added by Leander Hemelhof 3 years ago.
Patch for continuous damage, without edited templates

Download all attachments as: .zip

Change History (27)

comment:1 Changed 6 years ago by Josh

Owner: set to Josh
Status: newassigned

comment:2 Changed 6 years ago by Siddharth

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

comment:3 Changed 6 years ago by Josh

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 6 years ago by Josh (previous) (diff)

comment:4 Changed 5 years ago by Josh

Owner: Josh deleted
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 Changed 5 years ago by Ashish Madeti

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 Changed 5 years ago by Josh

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 Changed 5 years ago by Ashish Madeti

Owner: set to Ashish Madeti

comment:8 Changed 4 years ago by historic_bruno

Any updates?

comment:9 Changed 4 years ago by leper

Owner: Ashish Madeti deleted

comment:10 Changed 4 years ago by vikas MK

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 Changed 4 years ago by stanislas69

Hello,

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 Changed 4 years ago by wraitii

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 Changed 4 years ago by elexis

Milestone: Alpha 20Backlog

Backlogging due to lack of progress.

Changed 3 years ago by Leander Hemelhof

Attachment: ProofOfConcept.patch added

Proof of concept of the continuous damage system.

Changed 3 years ago by Leander Hemelhof

Attachment: ContinuousAttack.patch added

Patch for continuous damage, without edited templates

comment:14 Changed 3 years ago by fatherbushido

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 3 years ago by fatherbushido (previous) (diff)

comment:15 Changed 3 years ago by fatherbushido

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

comment:16 Changed 3 years ago by Mate-86

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 Changed 2 years ago by fatherbushido

Description: modified (diff)

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

comment:18 Changed 2 years ago by Mate-86

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

comment:19 Changed 2 years ago by fatherbushido

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 Changed 19 months ago by Mate-86

Owner: set to Mate-86
Status: newassigned

comment:21 Changed 19 months ago by elexis

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

comment:22 Changed 5 months ago by Imarok

Component: UI & SimulationSimulation

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

comment:23 Changed 3 months ago by wraitii

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

https://code.wildfiregames.com/D1252#77065

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

comment:24 Changed 3 months ago by wraitii

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: https://code.wildfiregames.com/D1252

comment:25 Changed 6 days ago by Mate-86

Owner: Mate-86 deleted
Status: assignednew
Note: See TracTickets for help on using tickets.