x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

how to use defense atribute

how do i make armor increase defense and decrease damage taken when attacked in blueprints

Product Version: UE 4.15
Tags:
more ▼

asked Jun 08 '17 at 06:45 AM in Blueprint Scripting

avatar image

Lvadman
1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

There is no fixed way to do that. There is no function to call or node to use. It comes down to how you define the damage formula.

A very easy example is: DamageTaken = clamp(Damage - Armor, 0, 9999999999) Only damage that exceeds your Armor value will be taken in this case. You can also modify it to be only a partial reduction in damage by doing something like: DamageTaken = Damage * (1-Armor/MaxArmor) In this example the damage taken is reduced based on the % of your MaxArmor value you have.

You design how damage is taken and you have to incorporate the Armor variable in that calculation somehow.

HTH

more ▼

answered Jun 08 '17 at 07:01 AM

avatar image

NoobsDeSroobs
2.7k 107 35 180

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

It depends on many factors like the range of damage and armor in your game, your game genre, different types of damages (like spells, melee,...) and your defending system in total (your game logic). I suggest the following function. It's an acceptable function for a mid range game which doesn't need to have a complex defending system.

ReceivedDamage = (1 - Armor/(C + Armor))*Damage. Where C is a constant.

Received Damage = (1 - Armor*W/(C+Armor*W))*Damage. Where C and W are constants. (Advanced)

If I remember correctly, the second formula is the one which is used in Warcraft. Note that the constants are in fact functions of the damage type. For instance a 100 spell damage is not supposed to deal the same damage to a pawn as a 100 piercing damage does. As I said it's a mid range game formula. If you have more complex battle system, then you might need to have several formulas for different circumstances.

Regards.

more ▼

answered Jun 08 '17 at 08:50 PM

avatar image

navid100
1k 29 14 46

avatar image Lvadman Jun 11 '17 at 10:41 AM

thanks that was a big help

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question