How is Damage Coded?

User avatar
Odee
Posts: 565
Joined: Fri Sep 21, 2018 1:15 pm
Location: Fredericksburg, Virginia

How is Damage Coded?

Postby Odee » Sun Jan 20, 2019 9:48 pm

See Edit below Been wondering about this for a while now. Is damage coded like; If Criteria X = Yes Then Apply effect Z + Powerset effect theme?

Edit Okay. Are there ROOT powers for different Classes, that behave the same, regardless of Class?

If so, then is this ROOT a single call-up code regardless of Class, or is it Specifically coded to each class, on a case-by-case basis?

Same question for other Similar Behaving powers.
Last edited by Odee on Mon Jan 21, 2019 8:00 pm, edited 1 time in total.
Image
Rah-rah Ree! Kick 'em in the Knee!
Rah-rah Rose! Punch 'em in the Nose!
Rah-rah Ralls! Kick 'em in the other Knee!

Consultant
Posts: 1790
Joined: Thu Dec 22, 2016 7:48 pm

Re: How is Damage Coded?

Postby Consultant » Mon Jan 21, 2019 7:56 am

Odee, let's break this down a little to make it easier to answer.

1. Are you asking how the FX will interact when two powers hit a target simulataneously? Or in a sequence, such as 0.5 seconds apart?

2. Are you asking how the hitpoint stats of the target are affected by being hit with two attacks either simulataneously or very close together in time?

3. Are you asking about other stats such as regen or mobility, and whether they stack?


It kind of sounds like you're asking if the FX from two fire attacks (as an example) will be additive in some way, or if one replaces the other, or if they play at the same time...is that the core of the question?

User avatar
Odee
Posts: 565
Joined: Fri Sep 21, 2018 1:15 pm
Location: Fredericksburg, Virginia

Re: How is Damage Coded?

Postby Odee » Mon Jan 21, 2019 9:22 am

Odee, let's break this down a little to make it easier to answer.

1. Are you asking how the FX will interact when two powers hit a target simulataneously? Or in a sequence, such as 0.5 seconds apart?

2. Are you asking how the hitpoint stats of the target are affected by being hit with two attacks either simulataneously or very close together in time?

3. Are you asking about other stats such as regen or mobility, and whether they stack?

It kind of sounds like you're asking if the FX from two fire attacks (as an example) will be additive in some way, or if one replaces the other, or if they play at the same time...is that the core of the question?
1. No sir. If two different powersets, have a root, do each of those use the same code for how results are applied .
  • Tank uses power Stomp Instep that roots target for a 3 seconds.
    Elsewhere on the map...
  • Brawler uses power Pin that roots target for 3 seconds.
Two different Root attacks.

2. No sir.
3. No sir, but the stacking does intrigue me, now you brought it up.

On Discord, LittleMissNutmeg explained it better: "If I were to guess, power effects would likely call functions that handle the effect as opposed to writing each power with it's own affects, because that means doubling work."

Does any of that help clarify my question? (feels so inadequate using text. Old school brain v New school ...stuff?)
Image
Rah-rah Ree! Kick 'em in the Knee!
Rah-rah Rose! Punch 'em in the Nose!
Rah-rah Ralls! Kick 'em in the other Knee!

Consultant
Posts: 1790
Joined: Thu Dec 22, 2016 7:48 pm

Re: How is Damage Coded?

Postby Consultant » Mon Jan 21, 2019 3:05 pm

OK, can you re-state the quesiton? What are you asking?

I'm kind of getting the idea that you want to know how the two similar FX, like two holds or two immobilizes, interact on a single target.

User avatar
Actjcksn
Posts: 115
Joined: Wed Dec 13, 2017 7:42 pm
Location: Kansas City, MO

Re: How is Damage Coded?

Postby Actjcksn » Mon Jan 21, 2019 5:33 pm

Consultant, I believe Odee is asking about how the actual code is executed.

For example:
Suppose a character executes Flame Blast and a different character executes Zap, both are Range attacks with Single Target Damage.
1) Are two functions called, one which executes Flame Blast with all it's animations, FX and damage, and another which executes Zap with all it's animations, FX and damage?
2) Or, is one function called with variables sent to it which tells the function what animation, FX and damage to use?
3) Is one way more efficient than another?

Expanding on that, if one function is called, is there only one function for all attacks or are there different functions for different types of attacks?

I realize it's probably much more complicated than this, but inquiring minds are curious.
__________________________________________________
There are 4 rules you need to remember:
1) Make the Plan
2) Execute the Plan
3) Expect the Plan to go off the rails...
4) ...Throw away the Plan

User avatar
Coyote
Posts: 84
Joined: Tue Apr 04, 2017 4:06 pm
Location: Long Island, NY

Re: How is Damage Coded?

Postby Coyote » Mon Jan 21, 2019 6:21 pm

As someone who did some of this coding for UO shards, I can tell you that regardless of how the effect is called, you are going to have underlying functions that will get called, and how they interact is really the interesting thing.

Power A causes a 1 second upward flinch on the target, as if they got hit by an uppercut.
Power B causes a drop of the head on the target, as if they got hit by an overhead smash.
Both of the flinch/drop animations take 1 second to show.

What happens if Power A hits the target, and 0.5 seconds later, Power B hits it? Regardless of whether they use the same function or different functions, does the later animation override the former? Does the currently-active animation have invulnerability to being interrupted, so that it always continues? Do we have a priority value where one of the animations has a higher priority so that it will interrupt animations of a lower value, but wont' be interrupted? For example, being knocked up in teh air should have a higher priority than mere head flinches.

What about death? Do you still flinch from an attack if it just killed you, or do you swap to the "falling down dead" animation?

HOW you start the animation for powers is what Odee asked, but really the start of the effects is a lot less interesting (and a lot less complicated) than what happens once effects start colliding.

User avatar
Odee
Posts: 565
Joined: Fri Sep 21, 2018 1:15 pm
Location: Fredericksburg, Virginia

Re: How is Damage Coded?

Postby Odee » Mon Jan 21, 2019 8:01 pm

I am an epic fail :oops:
Image
Rah-rah Ree! Kick 'em in the Knee!
Rah-rah Rose! Punch 'em in the Nose!
Rah-rah Ralls! Kick 'em in the other Knee!

User avatar
Coyote
Posts: 84
Joined: Tue Apr 04, 2017 4:06 pm
Location: Long Island, NY

Re: How is Damage Coded?

Postby Coyote » Mon Jan 21, 2019 9:00 pm

I am an epic fail :oops:
Epic failure is the best kind of failure. Normal failure happens everyday, while epic failure is very rare and impressive, and takes a special kind of person. So, this just means that you are very special, Odee. :P

:D :lol: :lol:

Consultant
Posts: 1790
Joined: Thu Dec 22, 2016 7:48 pm

Re: How is Damage Coded?

Postby Consultant » Tue Jan 22, 2019 7:33 am

Odee, you are not the one who failed -- I'm afraid that's on me for not understanding the question. Let take another crack at it. Using the clarification from Actjcksn:
Suppose a character executes Flame Blast and a different character executes Zap, both are Range attacks with Single Target Damage.
1) Are two functions called, one which executes Flame Blast with all it's animations, FX and damage, and another which executes Zap with all it's animations, FX and damage?
2) Or, is one function called with variables sent to it which tells the function what animation, FX and damage to use?
3) Is one way more efficient than another?
Powers work using a unified system comprised of over 30 different classes. This would be closest to #2 though the effects themselves are compartmentalized and extensible.

#1 works fine for games with a smaller amount of data. #2 though is a bit easier to work with from a data standpoint. Everything is uniform. We do allow each power to also specify an optional (seldom used) PowerExtension which includes hooks to override all the common sections of the power system to provide custom handling if need be. That is used for things like Flight, Resurrection, Torches, and other things which require special case handling that is too specialized to need implementing into the main system. The base system covers most of the types of powers that you have grown accustomed to in an MMORPG without the need of special case handling though.

Does that address it?

And now I'm curious -- why would you want to know?

User avatar
Odee
Posts: 565
Joined: Fri Sep 21, 2018 1:15 pm
Location: Fredericksburg, Virginia

Re: How is Damage Coded?

Postby Odee » Tue Jan 22, 2019 8:46 am

Odee, you are not the one who failed -- I'm afraid that's on me for not understanding the question. Let take another crack at it. Using the clarification from Actjcksn:
Suppose a character executes Flame Blast and a different character executes Zap, both are Range attacks with Single Target Damage.
1) Are two functions called, one which executes Flame Blast with all it's animations, FX and damage, and another which executes Zap with all it's animations, FX and damage?
2) Or, is one function called with variables sent to it which tells the function what animation, FX and damage to use?
3) Is one way more efficient than another?
Powers work using a unified system comprised of over 30 different classes. This would be closest to #2 though the effects themselves are compartmentalized and extensible.

#1 works fine for games with a smaller amount of data. #2 though is a bit easier to work with from a data standpoint. Everything is uniform. We do allow each power to also specify an optional (seldom used) PowerExtension which includes hooks to override all the common sections of the power system to provide custom handling if need be. That is used for things like Flight, Resurrection, Torches, and other things which require special case handling that is too specialized to need implementing into the main system. The base system covers most of the types of powers that you have grown accustomed to in an MMORPG without the need of special case handling though.

Does that address it?

And now I'm curious -- why would you want to know?
BING to the underlined above. Yes, Yes Yes Unified/SingleSource FTW I need to work on my communication skills more. Was a time I could put thoughts on papyrus that were understandable by all. 💯👍

oh, today is also #BlameGoldenAce day. :shock: :lol:
Image
Rah-rah Ree! Kick 'em in the Knee!
Rah-rah Rose! Punch 'em in the Nose!
Rah-rah Ralls! Kick 'em in the other Knee!

User avatar
Golden Ace
Posts: 2568
Joined: Wed Dec 27, 2017 7:21 pm
Location: Woodbridge Virginia

Re: How is Damage Coded?

Postby Golden Ace » Tue Jan 22, 2019 1:03 pm

No, I beg to differ with consultant, it is Odee’s fault.
♪ Sometimes you feel like a Tank, Sometimes you don't! ♫

User avatar
Odee
Posts: 565
Joined: Fri Sep 21, 2018 1:15 pm
Location: Fredericksburg, Virginia

Re: How is Damage Coded?

Postby Odee » Tue Jan 22, 2019 4:28 pm

No, I beg to differ with consultant, it is Odee’s fault.
Nods in abject fail mode once more. :oops: ;)
Image
Rah-rah Ree! Kick 'em in the Knee!
Rah-rah Rose! Punch 'em in the Nose!
Rah-rah Ralls! Kick 'em in the other Knee!


Return to “Ask the Devs”

Who is online

Users browsing this forum: No registered users and 12 guests