forums

TNT Basic Forums > Programming Q&A
How are RPG stats and battle systems all calculated?
< Last Thread     Next Thread >
Author
Thread        Post A Reply

11-19-2005 22:42

Posted by:
Jason Anderson

Location:
Doylestown, PA

Click Here to Email Jason Anderson   Find more posts by Jason Anderson

To the untrained player, RPG stats for people and battle systems seem so simple. But really if you look at it, it's a lot of calculating and math going into deciding just how much health to take when an enemy hits you! I mean it has to calculate your armor strength, the enemy's weapon strength, their speed and strength, your speed and strength, how much each piece of clothing protects you, et cetera. It's not so simple! I'd LOVE to know exactly how game makers like Square and Enix do their battle systems and calculating for protection and everything.

I mean, Dragon Warrior is my favorite RPG ever, it was also one of the very first if not the very first real RPG back in 1988. And even then it was very complex. And before it, you had text based battles. It's amazing. Who came up with this stuff and how exactly is it calculated?

11-19-2005 23:30

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

RPG Systems.

Great question, I love all this sort of thing. I grew up on 'paper based RPGs' in the 70's and 80's, and that's exactly where the dynamics come from. They are all, to some degree, derived from D&D or one of its clones. If you want to look into how these systems works then there are plenty of systems available for free download on the net.

When it comes to converting these 'paper system' to work on a Mac you're talking about things called 'look up tables'. The actual math involved is minimal, but the data that the battle system works on is huge! What is the effect of a sword, swung in a certain way, against chain mail / soft leather etc. These are all tables, and if you download one of these systems (try this link to get the latest version of the official D&D rules, they're Open Source sort of thing) you should have some idea of how this data links together. The link above should give you a good idea as to how RPGs in general work, but if you need more info then please either post here or mail me direct and I can point you in the right direction (I have been an RPG 'Referee' for over twenty years, for my sins!).

I hope this helps, check out the rest of the site above for more details and inspirations, and get back to me if you need anything else...

Happy surfing

Danny (nods)

11-20-2005 07:20

Posted by:
Jason Anderson

Location:
Doylestown, PA

Click Here to Email Jason Anderson   Find more posts by Jason Anderson

Wow. That's a lot of reading.

Let me finish the core of the game first before I go into battle systems.

I'll probably have to find someone to help me write it in the end. It would probably be easier to write a Zelda clone where all the fighting is done real-time. LOL

In fact, I'm still not sure which I want to make. I'm currently working on the map and object system. Doing tests with Hardware mode and sprite manipulation. It looks like the speed was increased dramatically. I wrote a program that creates thousands of sprites, places them randomly on the screen, rotates them all at once and then scales them all at once then lastly adjusts their transparency. It looks to be able to handle upwards of a thousand at once without problems on my Mac mini.

11-20-2005 18:23

Posted by:
Jae Rune

Location:
Cheyenne, WY

Find more posts by Jae Rune

Well to be honest, the RPG systems can range from terribly simple (FF6) to intensely complex (D&D 3.5). I've found that the best system is to take minimal stats and work it that way. If you want a simple RPG that focuses more on story and character development and less on "walk around, kill stuff, heal, repeat" then you might consider the following system:

Each character has six stats. These stats are, quite simply:

HP - Health Points
SP - Skill Points
DP - Dexterity Points
XP - Experience Points
AP - Armor Points
OP - Offensive Points

Health Points - The maximum amount of damage a character can take before fainting in battle.

Skill Points - The number of points per turn a character is granted to allow them to perform any one special move they may know, such as magic, melee attack, defensive movements, etc.

Dexterity Points - A percentage modifier that determines how much extra damage the attacking character will deal, or how much damage the defending character will deflect.

Experience Points - Awarded after each battle. It's up to you, really, how much each enemy is worth to the players, XP wise.

Armor Points - The total amount of damage either as a whole integer or as a percentage that the character naturally deflects as a result of wearing the armor.

Offensive Points - The total amount of damage either as a whole integer or as a percentage tha the character naturally deals as a result of wearing the weaponry.

Then each character would have the following slots:

Head, L Hand, R Hand, Chest, Feet, Accessory 1, Accessory 2.

These would allow the character to have items which modify the character's stats based upon the weapon which they have. As a general rule, to make it simple you want to only have Head, Chest and Feet modify their AP, while L Hand and R Hand only modify their OP. Accessories 1 and 2 can modify any of the above stats, as they'd be magical items.

So when you're setting up an item table, you'd want to create it thusly:

ID | Name | Modifier | Amount

So you'd wind up with something like:

256 | Crossbow | OP | 60
257 | White Potion | HP | 100

Etcetra. It's up to you, however, if the amount is percentage-based on whole integers. Frankly, that math for whole integers is far simpler, but far less accurate.

It's up to you if these stats are static, or if they're random to a percentage of likeliness. Honestly, the more "realistic" you want the battle, the more math you're going to have to do in total.



Or you could just do a 1-stat point system. This one is a little less complex, but allows for easier figuring for battles.

The stat would be:

LP - Life Points

Life Points covers the whole gamut. It is a round integer number that is compared to the LP of another character when doing battle. When the battle is over, more life points are awarded. To determine a battle's outcome, you have only to do the following:

if playerLP > monsterLP then
player wins
else
player loses
end

if player wins then
playerLP = playerLP + monsterLP
end

It's that simple. May not seem incredibly exciting, but it's a valid system. Of course, you could easily add modifiers to the whole thing and thus contrive the mathematics, but a single stat system is certainly the easiest way to go.

I hope I didn't confuse you!

11-20-2005 19:01

Posted by:
Jason Anderson

Location:
Doylestown, PA

Click Here to Email Jason Anderson   Find more posts by Jason Anderson

Hey! Thanks for all that info! I will find it very handy when the time comes.

11-21-2005 00:29

Posted by:
sabshire

Location:
nitro, wv

Find more posts by sabshire

square

I have a friend who worked on Final Fantasy X when he worked at SquareSoft... I'll have to ask him.

02-18-2006 03:23

Posted by:
Jason Anderson

Location:
Doylestown, PA

Click Here to Email Jason Anderson   Find more posts by Jason Anderson

I found an FAQ on GameFaq's for Super Mario RPG's battle system with tons of info. I'm working on a sample battle system right now. It's working pretty cool!

http://www.gamefaqs.com/console/snes/game/588739.html
It's called "Battle Mechanics Guide".

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.