1. ## MUD Programming: Combat

Okay, I'm making a MUD right now and trying to implement a new combat system. My MUD is based on each player having different energy levels (Ranging from 1 into the billions) and I need some kind of equation that will determine the damage for two people battling.

Example:

PlayerA has a level of 406
PlayerB has a level of 719

Now, if PlayerA hits PlayerB, it should do slightly less damage than if PlayerB hits PlayerA, since they're pretty close in power. I've been trying to come up with a way to do this, so that it's one equal equation and I didn't have to do an IF statement and give the underdog an upper hand.

Any help will be much appreciated. Thanks.

2. ## forest

You'd probably have better luck with this thread in the games section, but...

My 2 cents: if energy level can go into the billions, then the difference between 406 and 719 is really trivial... hardly a noticable difference in the scale of things. It's like saying, 'players A and B are both 25 years old, but A must be stronger and faster than B, because A was born 2 seconds before B'.

That said, perhaps you'd have better luck with some sort of percentage thing. Your formula would look at the difference between the two players, represent the difference as a percentage, and then use that percentage to determine what the modifier is.