Opened 11 years ago
Last modified 3 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 )
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)
Change History (28)
comment:1 by , 11 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:2 by , 11 years ago
comment:3 by , 11 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.
comment:4 by , 10 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
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 , 10 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 , 10 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 , 10 years ago
Owner: | set to |
---|
comment:9 by , 9 years ago
Owner: | removed |
---|
comment:10 by , 8 years ago
Cc: | 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 , 8 years ago
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 by , 8 years ago
Milestone: | Backlog → Alpha 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 :)
by , 8 years ago
Attachment: | ProofOfConcept.patch added |
---|
Proof of concept of the continuous damage system.
by , 8 years ago
Attachment: | ContinuousAttack.patch added |
---|
Patch for continuous damage, without edited templates
comment:14 by , 8 years ago
comment:16 by , 7 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 , 7 years ago
Description: | modified (diff) |
---|
Hi Leander Hemelhof, Mate-86, any of you still interested by that?
comment:19 by , 7 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 , 6 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:21 by , 6 years ago
Keywords: | Simple removed |
---|---|
Milestone: | Backlog → Work In Progress |
Patch: | → Phab:D1252 |
Type: | task → enhancement |
comment:22 by , 5 years ago
Component: | UI & Simulation → Simulation |
---|
Move tickets to Simulation
as UI & Simulation
got some sub components.
comment:23 by , 5 years ago
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:25 by , 5 years ago
Owner: | removed |
---|---|
Status: | assigned → new |
comment:26 by , 3 years ago
Milestone: | Work In Progress → Backlog |
---|
Where would I look in the code to find a similar example ? I am interested in implementing this feature.