Jump to content
Harpoon Hanna

Enemy damage vs Player armor. Can it be scaleable?

Recommended Posts

In an attempt to streamline game making, I was working on auto-scaling fights. The first screenshot is what i have so far. The damage of the best weapon the player has, times 4 = enemy hit points. Each fight takes 4 swings, no matter what weapon you are using  or what enemy you are fighting (sort of.... not taking variable enemy resistance to physical damage into account. Also, this is based on your minimum weapon damage and min/max damage spread varies by weapon.) But, basically, it works. Obviously, you can vary that 4 round fight idea, like 3 to 5 rounds, etc. Four round fights are best when fighting multiple enemies, I think. So now, you get that, no matter the weapon or enemy. That's the first screenshot.

The second screenshot is my problem. It doesn't work. I want enemy damage to scale according to the armor the player is wearing. Total all the resistances of your armor, adjust the enemy damage so that it kills you in four rounds, no matter what armor, no  matter what enemy. I see that the "Resistance" tile is obsolete? Hmm. Any thoughts on this? Making games is tedious, I just want to take some of the effort out of it because the balancing of weapon + armor =enemy is the hardest part to get right and requires endless tinkering. An easy "slider" to adjust fight difficulty is what I'm chasing.

 

20230430075128_1.jpg

20230430075643_1.jpg

Edited by Harpoon Hanna

Share this post


Link to post
Share on other sites

That obsolete on Get Resistance is troubling for sure.  I can't find that documented in the tile wiki or the scripting typedocs.

What values is it returning, anything or nothing?

If it's still returning correct values, then the obsolete might be a caution the script will need updating after a future release.  I can run some tests in several hours after work, to see if I can't get a four hit kill on player from any attach regardless of player's armor and to look for an alternative to Get Resistance (I haven't found one in any of the docs so far).

Share this post


Link to post
Share on other sites

Okay I have an update regarding this...

First, you can use "Pure" damage type to bypass the resistance calculations.  I highly recommend this, so you can just take the exact HP you want from a player.

Second, you need some extra damage thrown in there.  If the player lands around zero, they won't die.  I add 0.5 to each hit so it should end up -2 below after four landed attacks.

Third, the "On Do Damage" event occurs after default damage has been dealt.  That Amount variable in the event gives you that value, but if it's not Pure damage, then you'll need to adjust to get the true value and include in your calculations of additional damage.  On Attack event would be better, but this triggers prior to landing the damage.  I suspect it would not be useful as it probably ignores blocking/dodging.

Fourth, I'm not really sure what the calculations for dealing with player resistance is vs damage taken.  @handofthesly would know.

From my testing it looked to be:

Pure/Actual Damage = Incoming Damage * (100 - resistance*1.5)   <--- I'm super unsure about this, but I tested with LEGIONNAIRE ARMOR and it worked.

Fifth, Get Resistance looks like it's working.  You can use the equipment enum to loop through and get your total resist. Here's what I came up with:

2023-05-02.thumb.png.57f18fd3467866878772e770706397f3.png

 

Best of luck, you'll probably need to adjust the resistance calculations since I didn't do a thorough test to discover it.
Keep in mind you want to apply the calculation to Amount to get the real amount, and you'll have to reverse the calculation for handling additional damage (since it will be applied after you call Cause Damage - essentially you want to cancel out the equation - again this is why using "Pure" damage type when calling Cause Damage is recommended by me).

Edited by BinarySemaphore
Fixed typos
  • Thanks 1

Share this post


Link to post
Share on other sites

Thanks!  I did not know what pure damage was, it make sense. I appreciate your help, I think can make it work now.

Share this post


Link to post
Share on other sites
8 hours ago, BinarySemaphore said:

Fourth, I'm not really sure what the calculations for dealing with player resistance is vs damage taken.  @handofthesly would know.

The formula I was given by Chocho is as follows:
ROUNDUP((Damage Incoming) * ((100-(Armor Resistance Percentage))/100)) = (Damage Dealt)

And to work out the Armor Resistance Percentage the formula is:
3x*(100/(100+3x)) where x is the resistance number for that particular damage.

For example, Player uses Iron Sword with 17 Physical Melee damage and attacks Bigfoot which has 18 Melee resist:
(3*18)*(100/(100+(3*18))) = 35% Armor Resistance % for the Bigfoot
((17)*((100-35)/100)) = 12 DMG dealt to the Bigfoot out of the original potential 17

  • Thanks 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×