Simple-Moderate math question

I am not great at complex math formulas, so I need your help.

I am making a combat game. When player attacks, attack animation plays at a certain speed, based on player’s skill.

I want it, so that 100% skill means 30% better action. For example if base damage is 100, with 100% power skill, players will be dealing 130 (30% better) damage.

now I want it, so that if player’s skill is 100% (fully upgraded), animation speed is 1. But I can’t figure out what the speed then should be if player skill is 1%.

Basically here’s the formula I need solved.
x+y=1
y= (x/100)*30 (y is 30% of x)

P.S. If you could also explain how the above formula is solved, or at least write the process in steps, it would be even better.

1 Like

I think you’re making this problem wayy too complicated. It is pretty simple

local power_skill = 100
local bonus_damage = 0.3 * power_skill -- 1% power skill is %0.3, %100 power skill is 30% boost

local animation_speed = 100/power_skill -- perhaps? this means 100% skill is 1 animation speed, and 1% skill is 0.01? but this might be too slow, so you might need to look for a better solution
1 Like

Forgot to include

local base_damage = 100
local final_damage = base_damage * ((100 + bonus_damage) / 100)

no I want the speed exactly like the power example. In your example 100% speed will mean 100% faster animation. I want 30% faster animation

For example:
If 1% speed skill means 100 speed, 100% speed skill should be 130 speed.

But the problem is I want 100% speed skill to be 1 speed, so I can’t calculate it with that.

Dunno why you needed the solution to the maths thing in it, but I did it anyway
image
Just used simulataneous equations, and got:
x=10/13 (0.769230769)
y=3/13 (0.230769231)

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.