I need help making a damage equation for my RPG

Started by
18 comments, last by LLGames 21 years, 9 months ago
Sorry,

"I consider MOST of the RPG rulesets out there to be crap"

should have read:

I consider MOST of the computer RPG rulesets out there to be crap"

I tried to compare computer stuff with "traditional" sets which is where I got my first contacts with.

Regards

Thomas
RegardsThomas TomiczekTHONA Consulting Ltd.(Microsoft MVP C#/.NET)
Advertisement
Without a whole load of details on your system Ill refrain from making much in the way of suggestions but a few things to remember are:

1. You should never always be able to hit and hurt something. This will haunt you if you allow it and then introduce magic or a focus period for higher hit rates/damage.

2. Your system should be simple. There is no reason for complex damage calculations.

3. It should help build your game, not control how people fight. In other words characters should be able to develop styles and skills that allow them to fight and not have to use tricks such as, if you are always hit dont bother with dodging buy the best armour you can!

Im happy to talk about some of the options you have if you want to IM me, but I need more info and a forums not the place for it

Good luck.


BaelWrath

If it is not nailed down it's mine,
and if I can prise it loose,
it's not nailed down!

[edited by - baelwrath on July 1, 2002 8:35:10 AM]
BaelWrathIf it is not nailed down it's mine and if I can prise it loose,it's not nailed down!
While it may complicate the system, something I would recommend including as well are modifiers based on what the target is doing. Like, if it''s a mage preparing a spell, make damage 3/2 of what it would normally be since they''re too busy with their spell to defend. Or if it''s a counterattack, change the damage or success rate based on the speed of the counter-attacker (like, if they''re slow, the target will have more time to return to a defensive stance and hence take less damage or dodge better).

I also recommend having damage formulae rely on other stats than just physical strength. For example, if you''re using a gun or a bow to attack, it''s pretty silly to say that if you''re stronger, then you should do more damage (unless of course you''re pistol-whipping the enemy ). Maybe use speed to determine how many times you can fire in one attack and base the damage of the attack on the power of the weapon times how many shots you get in.

I''m getting some of my ideas on Final Fantasy Tactics here, just so you know. The thing I''m not sure I like about that game is the use of speed in calculations of attacks with knives, etc. It seems arbitrary to say that if you''re faster then you''ll hit harder with a knife.

It''ll take some creativity to come up with some good equations that will use other stats in a justifiable way.

What I really dislike though is equations based largely on random numbers. Beyond what Inmate2993 suggested, where damage only varies by about 5%, it''s just annoying. While I don''t like to try to calculate exactly how much damage I''ll do, it''s good to have at least a reliable expectation of damage done and not to be surprised when my attack does 10 damage when attacking an enemy and 250 the next time I attack the same enemy.

-Auron
heres a pretty simple system with:
Attack, Defense,
Weapon-Types, Armor-Types,
Damage, Armor
ChanceToEvade, ChanceToCriticalHit,
Magical Bonuses

(i just wrote this off the top of my head, so some stuff may be off)

some of these calculations cound be precalculated.

//(p1 attacks p2)//
AtkBonusA = p1.attack / ( p2.defense + 1) + p1.MagicAtkBonus;
ChanceToHit = (( 100 * AtkBonusA) - ( p2.ChanceToEvade() )) * rand() + 15;

if( ChanceToHit > 50 )
{//struck
DmgRange = (p1.MaxDmg - p1.MinDmg) * p1.MagicDmgBonus;
if( 100*rnd < p1.ChanceToCrit) DmgRange*= p1.CritMod;

DmgBonusA = p1.attack / (p2.defense * 2 * p1.weaponModVsArmor( p2) + 1);
Dmg = 1 + (DmgRange * DmgBonusA - p2.armor * p1.weaponModVsArmor(p2)) * rand() + p1.MinDmg * p1.MagicAtkBonus;
if( Dmg < 0) Dmg = 0;

p2.takeDmg( Dmg);
}
To begin with, I have seen some useful stuff here. Some of you though are thinking of stuff outside the rules. I''m trying to think of something simple. The only reason I only need attack and defense in the equation is because every attack is assigned an element, for this purpose "physical" is an element. Also the attack and defense are already the player''s naked stats with the weapons and armor added in. Skill is the critical hit factor. So all I need is something simple. I origionally used:

Damage = (((Attack * 2) - Defense)/2) * (5 + int(rnd * 3))
If int(rnd * 100) <= Skill then Damage = Damage * 2

Where Attack and Skill were the attacker''s attack and skill in that element and Defense was the defender''s defense in that element. I thought it was pretty good but occassionally my friends said that they got odd numbers so I came here looking for ideas. Please remember that this is Visual Basic code. I am learning C but I find it difficult and am only marginally good at translation.
Find some code to replace the rnd element and I think it will be more stable. The rand can be from 0 to 8 which means your damage can be zero to 8 times the stats calculation.

Maybe move the random numbers into the basic equation.

Oh, and you never really learn C++ just get to a point you can pretend well until they add more to it! (MC++, C# etc)

Have fun.

Regards

BaelWrath

If it is not nailed down it''s mine,
and if I can prise it loose,
it''s not nailed down!
BaelWrathIf it is not nailed down it's mine and if I can prise it loose,it's not nailed down!
it all depends on what scale and gameplay you have. if you are making a fps or diablo, it might be good to have random ranges, but if your making a rts, then ranges wont be noticed, and you can stick with hard values.
why not run some tests on these equations you are working on?
create a "test form", with some buttons and textboxen where you can enter the stats of two characters, and click a button that simulates them beating the crap out of each other. have it do this a thousand times and spit out some statistics for you. use these statistics to decide if it is balanced or if you need to tweak something.
if you find that something is way off wack, you can just change your code a bit and hit F5 to run it again.
stop doing this when you are satisfied with the balance.

--- krez (krezisback@aol.com)
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
LLGames:

If you really don''t like rule sets that are similar to Dungeons and Dragons, I reccommend you take a look at Warhammer 40.000 rules by Games Workshop. They have a totally different approach to stats and combat resolution. The 3rd edition rules are pretty good. IMHO the 2nd edition hand-to-hand combat were a little bit better. I''ll explain em here to you since they cannot be found easily any more:

Models stats:
M Move
WS Weapon Skill
BS Ballistic skill
S Strenght
T Toughness
I Initiative (reaction speed)
A Attacks
W Wounds
L Leadership (morale)

All stats are on a scale of 1 to 10, but for true RPG you might want to raise the W a lot since combat is real deadly! Anyway, The combat system:

Each player rolls as many dice as the A stat,
Pick the highest dice,
Add +1 for every 6 rolled after the first one,
substract -1 for every 1 rolled after the first one,
Add WS to it,
Add +1 for if 2 weapons are wielded,
Add special weapon and special ability bonuses (usually between 0-2).
This is the combat score.

Say Player has a combat score of 11 and Enemy a combat score of 15. 15-11=4 so enemy hits Player 4 times. If the combat scores are equal, Player with higher I stat scores 1 hit. If even I is equal, combat is stand-off. After this, work out the 4 hits scored by enemy (still the same in 3rd edition so you can look it up).

This is a VERY powerfull system. It makes combat extremely deadly (as it should be IMHO). One advantage: No need to calculate a damage equation every time the player presses attack. This system will resolve the entire combat for you. In this example player makes 11 swings at enemy. enemy takes 15 swings at player. So you get 11 of those nice "cling Clang" sword hits and then 4 direct swings at player.


Sander Maréchal
[Lone Wolves Production][Articles][E-mail]

<hr />
Sander Marechal<small>[Lone Wolves][Hearts for GNOME][E-mail][Forum FAQ]</small>


POffense // Offense Skill, including all modifiers
PPower // Weapon Power, "
TDefense // Target Defense, "
TArmor // Target Armor, "

POffense + rand > TDefense = target is hit
PPower + rand > TArmor = target is damaged

This topic is closed to new replies.

Advertisement