Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

The tragedy of tavernking

Tavernking

Don't believe his lies
Developer
Joined
Sep 1, 2017
Messages
1,218
Location
Australia
I never got to play Dungeons and Dragons growing up. Nobody introduced me to it, nobody's brother had played a few games. I became interested at around age 15 but had nobody to play with.
Now I am in my mid 20s and still have never played DND with anyone, although I found ToEE (the crpg) and KoTC somewhat interesting. I'm making an RPG game with turn-based combat and although tempted to start researching the OGL and learning the deeper mechanics of DND - I feel like a fraud, I feel it will take too long to appreciate them, and I feel that train has long passed by me.

So now my games are going to use a bastardisation of RPG rules - based on pure RNGesus. A knight with combat score 500 vs a goblin with combat score 10. The chance of the goblin killing the knight is (5 * 100 / 500) = 2%. I'm so sorry everyone.
 

Tavernking

Don't believe his lies
Developer
Joined
Sep 1, 2017
Messages
1,218
Location
Australia
Are you still interested in learning?

Maybe one day but I'm got a month off work in about two weeks - this is the time I'll use to build my RPG combat engine and I feel that's not enough time to learn the deeper intricacies of DND mechanics. Plus I'm morbidly interested in what kind of combat system I can come up with by myself.
 

Stormcrowfleet

Aeon & Star Interactive
Developer
Joined
Sep 23, 2009
Messages
1,028
You can clearly find a group somewhere to play. You cannot go on without playing D&D. It's my personal game design belief everyone that makes RPGs should play table RPG first (my second belief is that everyone in level design should play Quake and make Quake maps). If you want to play over the internet I can run a game for you.

Damn, I feel like I'm one of those girls that find a virgin and wants to help him out.
 

Nathaniel3W

Rockwell Studios
Patron
Developer
Joined
Feb 5, 2015
Messages
1,241
Location
Washington, DC
Strap Yourselves In Codex Year of the Donut Codex+ Now Streaming!
So now my games are going to use a bastardisation of RPG rules - based on pure RNGesus. A knight with combat score 500 vs a goblin with combat score 10. The chance of the goblin killing the knight is (5 * 100 / 500) = 2%. I'm so sorry everyone.
Don't make the odds linear. Make it a sigmoid function. That's an S-shaped curve that's close to 0 until you reach the middle, and then it quickly rises to 1.
 

Tavernking

Don't believe his lies
Developer
Joined
Sep 1, 2017
Messages
1,218
Location
Australia
So now my games are going to use a bastardisation of RPG rules - based on pure RNGesus. A knight with combat score 500 vs a goblin with combat score 10. The chance of the goblin killing the knight is (5 * 100 / 500) = 2%. I'm so sorry everyone.
Don't make the odds linear. Make it a sigmoid function. That's an S-shaped curve that's close to 0 until you reach the middle, and then it quickly rises to 1.

Will definitely look into this, thanks.
 

Nathaniel3W

Rockwell Studios
Patron
Developer
Joined
Feb 5, 2015
Messages
1,241
Location
Washington, DC
Strap Yourselves In Codex Year of the Donut Codex+ Now Streaming!
Do it like this.

If attacker and defender both have 0 combat score, decide how you want to handle that. Either you can't attack with 0 combat score, or you automatically lose with 0 combat score, or if it's 0 vs 0, then treat it like 1 vs 1. You might have to deal with this situation to avoid a divide by 0 error.

After checking for that...
Attacker's raw odds of victory = (Attacker's combat score) / (Attacker's combat score + Defender's combat score)
If raw odds are 0 or 1 (one or the other of them has 0 combat score), just use the raw odds.
Attacker's adjusted odds of victory = 1 / (1 + e^(Steepness * (raw odds - 0.5)) - 0.5))
Attacker's adjusted odds of victory = 1 / (1 + e^(Steepness * (raw odds - 0.55)) - 0.5)) [Edit: This makes it 50/50 with equal combat strength at steepness -10. You'll have to adjust this if you change the steepness.]
Steepness = -10

Or adjust steepness however you want. A bigger negative number makes the outcome more certain. A smaller negative number makes the outcome more random.

Sigmoid.jpg
 
Last edited:

Tavernking

Don't believe his lies
Developer
Joined
Sep 1, 2017
Messages
1,218
Location
Australia
Do it like this.

If attacker and defender both have 0 combat score, decide how you want to handle that. Either you can't attack with 0 combat score, or you automatically lose with 0 combat score, or if it's 0 vs 0, then treat it like 1 vs 1. You might have to deal with this situation to avoid a divide by 0 error.

After checking for that...
Attacker's raw odds of victory = (Attacker's combat score) / (Attacker's combat score + Defender's combat score)
If raw odds are 0 or 1 (one or the other of them has 0 combat score), just use the raw odds.
Attacker's adjusted odds of victory = 1 / (1 + e^(Steepness * (raw odds - 0.5)) - 0.5))
Attacker's adjusted odds of victory = 1 / (1 + e^(Steepness * (raw odds - 0.55)) - 0.5)) [Edit: This makes it 50/50 with equal combat strength at steepness -10. You'll have to adjust this if you change the steepness.]
Steepness = -10

Or adjust steepness however you want. A bigger negative number makes the outcome more certain. A smaller negative number makes the outcome more random.

According to those raw/adjusted tables, if a combatant previously had a 45% chance of winning the fight they now have a 50% chance of winning the fight?

Also my understanding is that this is to make lucky kills less likely yes? I sort of like the idea that a pathetic goblin archer can one-shot your well trained knight character.

Also, lets say the goblin has a combat score of 10 and the knight has a combat score of 500. Instead of using your method why not just increase the knight's combat score if I decide I want the knight to have a higher chance of winning fights?
 

Nathaniel3W

Rockwell Studios
Patron
Developer
Joined
Feb 5, 2015
Messages
1,241
Location
Washington, DC
Strap Yourselves In Codex Year of the Donut Codex+ Now Streaming!
The way I had it set up originally, yeah. Someone who started with a 45% chance would end up with a 50% chance. I noticed that and corrected my formula. I struck out the old one where there's a -0.5 and changed it to -0.55 With that change, someone with a 50% chance to start still has a 50% chance.

And yes, that makes lucky kills less likely. If you like the idea of lucky kills, then go ahead and keep the linear odds. Personally, I like how more recent Civilization games did this. More powerful units lose less hp when fighting less powerful units, to the point that a very powerful unit can one-shot a very weak unit while taking very little damage, but lots of weak units can still overwhelm a powerful unit. I think players would prefer that kind of more predictable outcome.

I wouldn't go down the route of increasing the knight's combat score because then it's easy to lose track of what those numbers mean. World of Warcraft for example gave its players higher and higher scores, and they do more and more damage, to enemies that have more and more hp, and you don't know anymore whether 100,000 damage is a lot. What does 100,000 damage mean? Is that a solid hit, or is that whittling off a tiny percent of the boss' health like doing 1 damage against a low-level boss? And several times, Blizzard had to implement a stat squish to bring the numbers back down to something the players could comprehend.

In my opinion, it's better to implement some kind of logarithmic comparison between stats than to implement exponential stat growth. If a peasant has 1 combat power, and a goblin has 2 combat power, and a knight has 10 combat power, and a dragon has 100 combat power, that's pretty easy for a human to understand. But then if you want to make combat outcomes less random, then you might have to give the knight 500 combat power, and the dragon 10,000 combat power, and the player will lose the ability to estimate what that combat power represents.
 
Last edited:

Tavernking

Don't believe his lies
Developer
Joined
Sep 1, 2017
Messages
1,218
Location
Australia
I wouldn't go down the route of increasing the knight's combat score because then it's easy to lose track of what those numbers mean. World of Warcraft for example gave its players higher and higher scores, and they do more and more damage, to enemies that have more and more hp, and you don't know anymore whether 100,000 damage is a lot. What does 100,000 damage mean? Is that a solid hit, or is that whittling off a tiny percent of the boss' health like doing 1 damage against a low-level boss? And several times, Blizzard had to implement a stat squish to bring the numbers back down to something the players could comprehend.

In my opinion, it's better to implement some kind of logarithmic comparison between stats than to implement exponential stat growth. If a peasant has 1 combat power, and a goblin has 2 combat power, and a knight has 10 combat power, and a dragon has 100 combat power, that's pretty easy for a human to understand. But then if you want to make combat outcomes less random, then you might have to give the knight 500 combat power, and the dragon 10,000 combat power, and the player will lose the ability to estimate what that combat power represents.

I definitely agree with this and thanks for writing it out. But at least in my game, this combat score would be hidden and be replaced by a % chance. If the chance is so small that it's less than 0.1% the game would display '<0.1%' and vice versa for very high chances. So I won't have to worry about the player trying to comprehend giant numbers.
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom