Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411485 Posts in 69371 Topics- by 58427 Members - Latest Member: shelton786

April 24, 2024, 04:19:44 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperDesignRPG combat math
Pages: [1]
Print
Author Topic: RPG combat math  (Read 3216 times)
Thorves
Level 0
*


View Profile
« on: December 14, 2014, 10:06:55 AM »

Hi,

I'm making a turn-based RPG that kinda plays like a roguelike (No battle screen, the entire game is just turn based: It halts until you do something, and then all nearby entities get a turn to do something and so on) and now is the time that I need to start thinking about how to actually do the combat mechanics.
I want to keep it very simple, so I don't want too many attributes/stats. However, I want a weapon to possibly have more than just a "damage" attribute, just because that would make the game way too linear since the weapon with the highest number is always the best.
So right now I'm trying to think of wich stats I want and how I implement them in the "combat math". (The calculation for how much damage you do.)
Does anyone have any ideas or know anything about the core mechanics most RPG's use for combat. Is there some kind of standard for that?

Right now the only thing I could come up with is damage = random(player.attack + weapon.attack) - random(enemy.defence + emeny.armour) but I think that would be kinda lame and maybe a bit too random.

Suggestions please?  Beg

Thanks in advance!
Logged
adrix89
Level 0
**



View Profile
« Reply #1 on: December 14, 2014, 10:57:36 AM »

A trick I have found for myself is to not think in numbers at all when you start out.

Instead think in relationships and in how things play out.

You can 'sample' the game at various progress of the game and imagine how things should change and play out.
For example lets say somewhere around the end of the game you find armor so good that it straight up ignores normal attack/damage, and both the player and enemies can have it, how would it play? how would it balance out? what options would be available to circumvent this obstacle?

Another trick is to not think in normal terms, instead of health, speed,attack think in sigma,alpha,deltas. Go with abstract words until you find all relations you want and then define it in words.

For example in my system I found out my attributes matched pretty well the four elementary forces Fire Water Wind Earth and they become Fire/Strength/Power, Wind/Agility/Speed, Water/Perception/Accuracy, Earth/Willpower/Defense all having complicated relationships between them and directly affecting the skills and attacks of their nature.
Also combination of attributes made other attributes for example Strength +Agility =Stamina; Strength + Will =Toughness

Another thing is to get inspired by interesting systems.
For example I love The Spirit Engine and how it handles damage. It has threshold of damage and percentage reduction as well as charge to overcome the threshold and three types of damage.
Another game has 3 types of attack/defense and every attack causes either double damage, a buff or debuff that wither halves damage or doubles it. So you get a complex web of relationships between the attacks and defense of each type.

Another great source of inspiration is the various table top RPG systems.

Another advice is to keep your stats meaningful and use sparingly.
Every point a player should yearn for and you should be generous when they have progressed.
For example instead of a skill with 100 points that gives 1% per point of effectiveness have a skill that has 5 tiers each giving a straight 20% effectiveness, maybe with the higher tier having additional functionality.

The actual specific of the formulas and equations should be done when you want to balance the relationships.

The worst you can do is copy a system without thinking about it.
Not that you can't start with something as a based, and sometimes you are limited by the framework liken in the case of RPG Maker games. It's the thinking about it that is important even with a limited framework you can make some interesting ideas.
« Last Edit: December 14, 2014, 11:31:23 AM by adrix89 » Logged
JWK5
Guest
« Reply #2 on: December 15, 2014, 07:42:26 AM »

It really depends on what kind of feel you are going for. Here's a few random thoughts:

Do you want longer combat or shorter combat?
This is can easily be paced by either having more/less average/max HP or dealing more/less average/max damage. You can also pace the combat through an intercepting value, like a defense score.

Do you want compounding damage or non-compounding damage?
Compounding damage means the damage increases the more the victim is already damaged, non-compounding damage is the generic static HP seen in most RPGs. Compounding damage could be achieved (for example) by:
Attacker.Damage + ((Defender.MaxHP - Defender.CurrentHP) / 4)
In this manner, hits get more lethal the weaker the victim gets. Stronger characters suffer less from the compounding effect, weaker characters suffer more.

Do you want static or dependent stat values?
Let's say you have couple core stats and one of them is a strength score (STR), in most RPGs the score is static and is only added to or taken from via status effects, items, or other manipulations. With dependent stat values the score would be dependent on, for example, HP. Let's say we calculate damage with strength-based weapons like this:
DAMAGE = Attacker.WeaponDamage + ((Attacker.STR + Attacker.CurrentHP) / 4)
In this instance, as we take damage and lose health we get weaker and deal less damage. Supposing my base weapon damage is 8, I have 12 strength, and my HP was 45 then I'd do 22 damage rounding down. Let's say I lose 26 HP (19 remaining), now I only deal 15 damage rounding down. Do this with each stat and losing HP is much more threatening. Alternately, if you have an MP (Magic Points) value then you could tie intelligence (INT) to it in this manner and have characters become progressively more mentally exhausted as they use magic.

Do you want static equipment values or degrading equipment values?
Suppose weapon damage was determined at a fourth of its durability value, WeaponDamage = (Durability / 4), and each time you use your weapon you lose one point of durability. So a 10 damage weapon will have 40 durability, and every 4 uses degrades 1 point of damage until repaired. The same could apply for armor defense values. This could set up for things like "break" or "rust" attacks that directly damage durability. You could reverse this idea and create gear that grows stronger with use or have it grow after each kill (soul stealing).
Logged
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #3 on: December 15, 2014, 09:53:47 AM »

MUST WATCH details all teh fundamental
http://twvideo01.ubm-us.net/o1/gdc_china/2011/slides/S-O-1113-3-EN-Sara%20Jensen%20Schubert-EnPPT.flv



also to read
http://en.wikipedia.org/wiki/Damage_per_second



BTW the strategy in rpg either come from:
- production strategy,
-"trick"
- puzzle encounter
- pattern matching

By production strategy I mean something like the following:
Let say you have a character that double her hits every time she connects with an enemy but have very low damage values. If the encounter is short it's a useless move because you never reach a point where you deal enough value to be worth it over a more linear but straight attack, however in long encounter like bosses, it will double until it deal massive damage.
Strategy is all about setting up production while disrupting the other's one.

By trick I mean anything that lock option and change the topology of the match, not necessarily deal damage:
Switching your health for the one of the enemy is a context sensitive move that can deal a blow to the enemy, having a time attribute on this exchange, denying a move to the opponent or locking him in an attack, converting momentarily an ally of the opponent, confusing him, all are trick that change the way things interact. Those are the most difficult to balance because they introduce chaos to the base damage production model.

Pattern matching, it is about the given weakness type of the target over the type of attack strength:
It's well known and generally implemented using elemental system, but weapon type or any other system works too, it can be implicit like having tank and glacier enemy to whom you would match production model (flat linear or exponential damages).

Puzzle encounter is just the fact you set up scenario encounter base on all of the above that force the player to play on some key aspects of the battle system:
For example let's say you have the hero start a field very powerful but without way to replenish health, the field is full of weak enemy but travel is long. At first the player will smash through the horde but as they progress and their resource are chipped away they need to switch their strategy to fleeing away to ration them, it turns out that teh seemingly useless trick the enemy was using prevent fleeing away, suddenly it turns the game in to strategy to flee away and complete the field as fast as possible.

(note I leave uncertainty management and luck factor out)

Why I'm talking strategy? well the stat is a tool to help you define the experience you want, the actual complexity is meaningless as long you hit the target experience and the point above don't need complex system to be implemented.
Logged

Jordgubben
Level 2
**



View Profile WWW
« Reply #4 on: December 22, 2014, 04:23:34 AM »

Right now the only thing I could come up with is damage = random(player.attack + weapon.attack) - random(enemy.defence + emeny.armour) but I think that would be kinda lame and maybe a bit too random.

Suggestions please?  Beg

I have not tested this yet, so it's just a theory, but I think you'll simplify balancing if you drop addition and sustraction in favour of multiplication and division.

In my current project I'm going to try something like this: damage = baseAttack * weapon.attack/enemy.armour

Assume a standard attack has an  baseAttack of 25, a hitRate of 80% and takes a full turn. Then we have an attack effectiveness over time  of 20 (25*80%/1). If we want to expand this with could add a weak and fast attack (20 = 12.5*80%/0.5), or a slow high damage attack with a low hit rate (20 = 100*40%/2). Since all the attacks have the same attack effectiveness over time, they would be balanced in the "normal" case. Armour will not effect their effectiveness relative to each other.

That said, using dividing armor practically means that an armor improvement of 10% is actually just an HP improvement of 10%, and you might not want this linear translation.

Having subtracting armour on the other makes this Math a lot harder for you as a designer. Let's assume an armour value 10 and see how that would effect the three attacks mentioned above:

Light attack: (12.5 - 10) * 80% / 0.5 = 4
Standard attack: (25 - 10) * 80% / 1 = 12
Heavy attack: (100 - 10) * 40% / 2 = 36

In this example the heavy attack will be 9 times more efficient over time than the light attack. This might be what you want, but you will have to make a lot of adjustments and tweaks to prevent slow heavy attacks from becoming the dominant strategy.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic