PDA

View Full Version : Battle system


Illusion
September 24th, 2005, 01:22 PM
This is my first tutorial... :D hope that you'll like it. ;)
I find that some of the games that do have cbs do not calculate damage or experience like in the real Pokemon games. This tutorial will help you all understand how to make a Battle system looking nearly like a real one.

1. DAMAGE CALCULATION
Pokemon damage calculation is not like most of the common rpg's, its not ATK+ATK DAMAGE-ENNEMY DEFENSE.
It's this:
Damage = ((((2 *Attacker Level / 5 + 2) * AttackStat * AttackPower / EnnemyDefenseStat) / 50) + 2) * Attack bonus * Weakness/Resistance * RandomNumber / 100 :\
What does all that mean???
Ok, Attack stat depends on the type of the attack:
For Attack:

Normal
Fighting
Bug
Rock
Ground
Flying
Steel
Poison
Ghost

For Special Attack:

Psychic
Fire
Electric
Water
Ice
Dark
Dragon
Grass

So AttackStat is your attack Power.
Attack Power is the first number you see when selecting an attack, for example tackle is: (35)
35 Charges the foe with a full- body tackle.
95
Ennemy defense stat is the ennemy's defense/ special defense depending on the attack. ATTACK>>DEFENSE SPE.ATTACK>>SPE.DEFENSE
Attack bonus is equal to 1 if you AREN'T of the same type as the attack and 1.5 if you ARE of the same type of the attack you're using.
Then you have a random number that is between 85 and 100.

2.EV's

Some of you will be wondering what is EV's? :confused: Well it means effort value and each time your Pokemon beats a Pokemon it gains effort value.A Pokemon's max effort value is 255. So if you want to calculate is here is how I do it:
((Hp EV/2.5)*100/Pokemon level)+ Pokemon level Hp
So if you're making a battle system that's one way to do it. Protein, carbon and all these vitamins add 10 to the Pokemon stat in their description. A pokemon can't "eat" more than 10 of each vitamin.
More information on which Pokemon give you how many EV points here (http://www.serebii.net/pokedex-rs/hp.shtml)

3.IV's

IV's is a bit the same idea as EV's but it doesn't change. When you receive a new Pokemon a random number is chosen.(If I made a battle system, I'd make a random one between 0 and 70.)Wild Pokemon IV's are lower than the other Pokemon ones, to get a high IV, you have to get a hatched Pokemon/Legendary or your first one.To use it in the batttle do this:
((Hp IV/2)*100/Pokemon level)+ Pokemon level Hp

Note
So to calculate a Pokemon stat:
(((Hp EV/2.5)*100/Pokemon level)+(HP IV/2)*100/Pokemon level)+ (Pokemon level*100/Pokemon max hp stat Hindering Nature)
Here's an example:
Bulbazaur (http://www.serebii.net/pokedex-rs/001.shtml)
Hp max stat Hindering Nature: 294
HP IV = 37
HP EV = 20
(((20/2.5)*100/34)+(37/2)*100/34)+ (34*100/294) =~88
Thats quite high :D , but we gave the Pokemon an IV of 37 and an EV of 20.

4.Experience

All of you know what experience is so here's how to calculate it:
((Ennemy Base Experience *Enemy Level) * Trainer * Wild) / 7
Trainer checks if the Pokemon trainer ID matches yours if it does trainer =1 otherwise, it ='s 1.5 and for wild it means it ='s 1 if it's a wild Pokemon and 1.5 if you're against a trainer.

So let's say that my starter Squirtle had just defeated my rival's Bulbasaur in Fire Red. The Base Experience for Bulbasaur, mentioned before, is 64. The Level is 5 since it's the first battle you do with your rival. You are the original trainer, so Trainer is equal to 1. It isn't Wild, so Wild = 1.5. Now the only thing left to do is to do the math.

Exp = ((64 * 5) * 1 * 1.5) / 7
Exp = ((320) * 1 * 1.5) / 7
Exp = (480) / 7
Exp = ~68

5.Pokerus

??? :confused: What is Pokerus, well if you have a Pokemon that's got it(you're reaaalllllyyyy lucky :D ) it just means that the Pokemon that has it gets double EV experience :D.
http://www.serebii.net/games/pokerus.png

Well I think that I've finished but I'm sure that some things are wrong or I've forgot something....
Please give me advice and other helpful things.
;)
EDIT: I forgot to give credit:here (http://www.serebii.net/games/ivs.shtml)
http://img140.imageshack.us/img140/708/image19rf.png

Webmaster Tyler
September 24th, 2005, 01:52 PM
Its hard to get.
I dont understand it

QFred
September 24th, 2005, 03:55 PM
I think that too!

Also, I don't really know how to make the game calculate, how do I put calcules?

BleachXP.com
September 24th, 2005, 08:58 PM
your methods sound confusing the first time u read it. but if u write it out it all makes sense. i am gonna have to use this! GOod job!

Berserk
September 25th, 2005, 03:02 AM
You've posted some very useful info. Great work.

Illusion
September 25th, 2005, 09:04 AM
I think that too!

Also, I don't really know how to make the game calculate, how do I put calcules?
It's true it may be difficult to understand at first, but read it a few times an you'll understand.
To make the game calculate, use variables.Variables are numbers that are stored in memory.
Illusion

Cursed
September 30th, 2005, 08:26 PM
Could you post a simpleton version that shows the actual code? And is this for rm2k3 or what?

another_yagami
October 9th, 2005, 12:55 AM
its a very usefull tutorial! i already use it in my cbs...
i have found it in serebii.net
but you can make it more easy... some peoples have an dificult do understand it...

See ya!
Another_yagami

random person 95
October 22nd, 2005, 04:38 AM
i didn't get anything tht was said there....

oh well, i'll probably get it some time or other

Shiny_link
October 25th, 2005, 03:41 PM
good work, very useful (just have to do everything that it says without understanding it) also you misspelt "ennemy" --> Enemy.
Anyways good work

Illusion
November 10th, 2005, 11:29 AM
good work, very useful (just have to do everything that it says without understanding it) also you misspelt "ennemy" --> Enemy.
Anyways good work
Thanks! I just edited it! ;)

Datriot
November 10th, 2005, 12:25 PM
Yeah, it's battle algorithins (I can never spell that right.....) for Pokémon battle systems in RGSS.
Good stuff, although I've already made the battle damage equations for my game! :P

wala
January 19th, 2006, 01:40 AM
Good stuff.
If looking for more game mechanics stuff you guys should check out the bulbapedia section for game mechanics. Would post a link, but need more posts to post links lols.