Jump to content
  • Advertisement
Sign in to follow this  
Siolis

Excel RPG Battle Math Issue

This topic is 4828 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I’m working in Excel and I’m trying to do battle processing math in the design doc stage. The trouble i'm having is that I’m trying to work out the percentage difference between two numbers so i know how much Attack power i need to remove from an attacking party. Long and short of it is that i having two numbers: X Agility Stat of A - Y Agility Stat of B And i want to know how much X is of Y in percent, i.e. if X was 100 and Y was 200 then Z would be 50%. What i've currently got is the following in two cells (Cell3 and Cell4) while Cell1 and Cell2 are X and Y: =IF(Cell1=Cell2, 50, IF(Cell1>Cell2, ((Cell2/Cell1)*100)/2, 100-Cell4)) =IF(Cell1=Cell2, 50, IF(Cell1<Cell2, ((Cell1/Cell2)*100)/2, 100-Cell3)) This should make it so that if Cell1 is grater than Cell2 that it gives me the percentage of Cell2 from Cell1, if Cell1 is less than Cell2 that it gives me the percentage of Cell1 from Cell2. The last part of the IF statements make it so that if Cell1 is not grater than Cell2 or vice verse respectively that it just makes the opposite percentage value in its respective cell. What this little set also dose is generate a limiter, i.e. if A is twice as high as B then the percent returned 100% in Cell3 and 0% in Cell4 and vice versa so someone who is twice as slow as their target cant hope to hit it and if they are twice as fast can rest assured that they will never miss. The problem I’m having is that although it returns the right answer if you are twice as fast as your target, when i make the target twice as fast as you, the dam equation comes back at me with a 75% chance of hitting it which is just wrong. Can anyone see something i can’t? Siolis

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!