Jump to content
  • Advertisement
Sign in to follow this  
btech

Simulating a fight

This topic is 3710 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

So I've been tossing around some ideas on how to simulate a fight between two combantants. The players don't have direct control over the fighters, but just a pre-fight selection of a "gameplan". I've decided on a bunch of factors (fighter stats/ratings) that I wanted to be taken into consideration, but I'm not totally set on a great way to actually make the fight happen - taking all these stats into consideration. Each fighter is made up on about 20 stats/ratings (currently). Some are skill levels that can be learned, while others are more of personal makeup -- like how well the fighter takes a punch/kick to the head, or how well he defends a submission attempt (think MMA)..... I've had a few different ideas of how to make the fight actually occur. (1) being to take the difference between their stats: Fighter 1 rates a 75 in grappling Fighter 2 rates a 65 in grappling -- Therefore, Fighter 1 has a 10% advantage in grappling. So he has a 55% chance to win a random roll that would deal with a grapple. Whole fight pans out via a series of event rolls based on the gameplans of the fighters. Sooo, what I'm curious about is how basic RPG fights are usually calculated. I'm not sure if I'm looking down the right path or what. I'm really just interested in gathering some other ideas if anyone could share their thoughts. Thanks

Share this post


Link to post
Share on other sites
Advertisement
This is an idea that has long appealed to me (See the first thread I started here), and I hope you enjoy more success in your project than any of my (purely theoretical) experiments. The obstacle I always ran into is determinism. Once you push the "go" button, the game may as well skip the animations and give you the outcome. The system you propose just expands that coin-toss into a thousand tiny dice rolls, and one of three things will happen:

1: You'll balance it imperfectly, and there will be a "win all" setup that some guy will discover, and then he'll sleepwalk through the game, falcon-punching every adversary with the same spamtacular combo.

2: It'll be deep and sophisticated, but opaque, so you'll have to do each fight a hundred times to learn the opponent's stats and trial-and-error your gameplan to trump him.

3: It'll be deep and sophisticated and transparent, and you'll spend twenty minutes prior to each fight studying the stats of your enemy and deducing the winning strategy. Then your game is just a fancy skin applied to math homework.

There are two ways to escape this doom, in my opinion.

One is to introduce a little chaos (roll to resist Heath Ledger impersonation: success!) into the system. Have critical hits and critical failures on some moves, status ailments, environmental concerns, and maybe--if you're up for it--larger fights than 1v1. Having a "jump back" maneuver turn into a "trip on slippery banana peel and fall on your ass" maneuver one out of 20 times, or having a punch in the back of the head put a debuff on your guy for three action cycles, or having a partner that may or may not be there to tackle the guy can lead to multiple outcomes for the same setup, which then compells you to plan to win most fights, while making it less possible to be prepared for all eventualities.

The other option is to allow on-the-fly coaching of your dude. A stack of buffs to throw at him, boosting his reaction time, his strength, or whatever during the fight, combined with the ability to say, "Turtle up and let him wear himself out!" when it's appropriate will make the whole thing more interactive without turning it into a direct-control action game.

Both "solutions" have problems of their own, and I've never come up with a design that really satisfied me. Good luck.

Share this post


Link to post
Share on other sites
Quote:
Original post by Iron Chef Carnage

The other option is to allow on-the-fly coaching of your dude. A stack of buffs to throw at him, boosting his reaction time, his strength, or whatever during the fight, combined with the ability to say, "Turtle up and let him wear himself out!" when it's appropriate will make the whole thing more interactive without turning it into a direct-control action game.


I really like this idea.

Share this post


Link to post
Share on other sites
Appreciate the response.

The idea is that it would be a single action (accept the fight) kind of deal. With all other selections being made before the fight itself. Although, I have given the thought to between-round coaching. Where the player could choose 1/2 of many tactics to have his fighter do and look out for. Fighter intelligence would determine how well those "on-the-fly" changes help him.

If you're a fan of MMA and understand how much can happen - you can see it becomes quite a challenge to program for, taking all things into account.

But I guess the real question for me is if my idea of using random rolls for each action is how other RPG fights take place. I didn't want to start getting myself into something that most would find completely impractical.

Share this post


Link to post
Share on other sites
Basic RPG fights?

if (YourAttackSkill - OpponentDefenseSkill + RandomNumber - MaybeRandomNumberForDefenseNotNecessarilly) > CertainNumber,SayZero

then

DoDamage (RandomNumberBetweenWeaponMinDamagaAndWeaponMaxDamage - EnemyArmorRating)

I think you can't get simpler.

Share this post


Link to post
Share on other sites
Quote:
Original post by ManTis
Basic RPG fights?

if (YourAttackSkill - OpponentDefenseSkill + RandomNumber - MaybeRandomNumberForDefenseNotNecessarilly) > CertainNumber,SayZero

then

DoDamage (RandomNumberBetweenWeaponMinDamagaAndWeaponMaxDamage - EnemyArmorRating)

I think you can't get simpler.


And wrapped around the whole thing: Repeat Until Someone'sHitPoints <= 0

Share this post


Link to post
Share on other sites
Quote:
Original post by ManTis
Basic RPG fights?

if (YourAttackSkill - OpponentDefenseSkill + RandomNumber - MaybeRandomNumberForDefenseNotNecessarilly) > CertainNumber,SayZero

then

DoDamage (RandomNumberBetweenWeaponMinDamagaAndWeaponMaxDamage - EnemyArmorRating)

I think you can't get simpler.


That might be the way it works in most games, but I don't think many people find that fun. D&D has even gone away from that model. In that situation the only real choice you offer is to fight or run away.

Share this post


Link to post
Share on other sites
Quote:
Original post by btech
Sooo, what I'm curious about is how basic RPG fights are usually calculated.

Unfortunately, 95% of RPG combat systems are much simpler than what you're describing, so you're probably out of luck if you were hoping to find something interesting there. Obviously they provide extra interest in allowing you to react during the fight and explicitly choose different tactics. But yes, typically any single attack is resolved by one simple dice roll which is modified by stats on each side; no big deal.

Quote:
I've decided on a bunch of factors (fighter stats/ratings) that I wanted to be taken into consideration, but I'm not totally set on a great way to actually make the fight happen - taking all these stats into consideration.

You need more than just a bunch of stats. You need to think about how they relate to each other, both at any given time, and as time goes on. Otherwise, all you have are a load of number pairs across 2 people, and whether you have 1 pair or 100 pairs becomes irrelevant. If you just allow people to pick which pair they'll match up, they'll just opt for the stats where their advantage is biggest, which isn't interesting. A gameplan becomes fairly arbitrary.

Think about how combinations of stats can be interesting, or how people can potentially opt to forfeit attacks for defenses, or how they could choose an adaptable but weak move over a risky but powerful one.

Share this post


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

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!