| | |
RPG Battle Algorithms
![]() |
I would really like for this thread to discuss all aspects of "RPG math" i.e.(Attack, Magic, Defense, Magic Defense, Agility, etc...)
So lets start off with Attacking. I am going to dismiss what the targets defense stats are and just think about raw attack power. So what are the elements of an attack? The elements I can think of would be strength, weapon, accuracy and skill. I believe the better your skill is with a particular weapon the more accurate you can be. So that is where it gets tricky for me. I've been able to come up with this:
To shorten things
But when you throw in skill to the mix I can't figure out where to add it in the algorithm.
So lets start off with Attacking. I am going to dismiss what the targets defense stats are and just think about raw attack power. So what are the elements of an attack? The elements I can think of would be strength, weapon, accuracy and skill. I believe the better your skill is with a particular weapon the more accurate you can be. So that is where it gets tricky for me. I've been able to come up with this:
(STRENGTH + WEAPON) * ACCURACY = ATTACK_POWER
To shorten things
(s + w) * a = x
But when you throw in skill to the mix I can't figure out where to add it in the algorithm.
If in doubt, reach into the trash can and remove the user guide.
>The elements I can think of would be strength, weapon, accuracy and skill.
I would split those up. Instead of lumping accuracy and skill into an attack, accuracy and skill would apply to a chance-to-hit calculation that gives you a percentage. If your random roll falls within that percentage, then you can move on to damage calculations using strength and weapon. That results in less work on a miss or block, and also saves you from overcomplicated single formulas.
I would split those up. Instead of lumping accuracy and skill into an attack, accuracy and skill would apply to a chance-to-hit calculation that gives you a percentage. If your random roll falls within that percentage, then you can move on to damage calculations using strength and weapon. That results in less work on a miss or block, and also saves you from overcomplicated single formulas.
I'm here to prove you wrong.
•
•
Join Date: Feb 2008
Posts: 55
Reputation:
Solved Threads: 4
•
•
•
•
I would really like for this thread to discuss all aspects of "RPG math" i.e.(Attack, Magic, Defense, Magic Defense, Agility, etc...)
So lets start off with Attacking. I am going to dismiss what the targets defense stats are and just think about raw attack power. So what are the elements of an attack? The elements I can think of would be strength, weapon, accuracy and skill. I believe the better your skill is with a particular weapon the more accurate you can be. So that is where it gets tricky for me. I've been able to come up with this:
(STRENGTH + WEAPON) * ACCURACY = ATTACK_POWER
To shorten things
(s + w) * a = x
But when you throw in skill to the mix I can't figure out where to add it in the algorithm.
if (ATTACK_TYPE != ATTACK)
{
if (ATTACK_TYPE == MAGIC)
{
M + SBP = ATTACK_POWER;
ATTACK_POWER - MAGIC_DEFENSE = DAMAGE;
echo (DAMAGE);
return();
}
else if (ATTACK_TYPE == SKILL)
{
S + SKBP = ATTACK_POWER;
ATTACK_POWER - DEFENSE = DAMAGE;
echo(DAMAGE);
return();
}
else if (ATTACK_TYPE == ITEM)
{
IDMG - RESISTANCE = DAMAGE;
echo(DAMAGE);
return();
}
}
else
{
if (ACCURACY > TARGET_EVADE)
{
S + WBP = ATTACK_POWER;
ATTACK_POWER - DEFENSE = DAMAGE;
echo(DAMAGE);
return();
}
else
{
echo('Miss');
return();
}
}##NOTES##
M = Magic stat
SBP = Spell base power
S = Strength stat
SKBP = Skill base power
IDMG = Item damage
##END NOTES##
Of course, you'll have to figure out everything else out on your own. I was just hoping to help you get a basic idea.
Good luck, man (^_^)
Last edited by Suetan; Feb 2nd, 2008 at 2:56 am. Reason: added notes to have less confusion
•
•
Join Date: Feb 2008
Posts: 55
Reputation:
Solved Threads: 4
•
•
•
•
can i have some sample of that game when u finish to create that
I think that you can create something entirely original and have it be awesome in your own way. Remember that the game that you're creating is yours to do what you want with. That's why you should come up with it all on your own.
If you want any help with it, then that's fine. But I don't think that asking to use someone else's work is a very good decision.
That's just my opinion, but I think that every video game programmer has it in them to create everything on their own (even the graphics if you have that knowledge).
I hope for the best in what you're working on. If you need any help, just ask and I or any of the other members will do what we can to help you out.
Good luck on what you're making (^_^)
•
•
Join Date: Feb 2008
Posts: 55
Reputation:
Solved Threads: 4
•
•
•
•
ok ok ok but im a game fanatic and i don't have any
idea on making a game espcially rpg.. and can i ask what is your job???
anyone who what to give me a game just a simple so i will study that tnx
I had previously went to college at Utica School of Commerce (located in NY state) where I majored in computer programming and networking. I dropped out of USC because I was working at Turning Stone Casino & Resort as a cage cashier, seven days a week, up to 16 hours a day. I got injured at work, and while I was on worker's compensation, Turning Stone replaced me and is not willing to give me back my job. I didn't have the time to go to class... so I dropped out in my third semester.
Last edited by Suetan; Feb 4th, 2008 at 9:30 pm. Reason: added more background info
•
•
Join Date: Feb 2008
Posts: 55
Reputation:
Solved Threads: 4
•
•
•
•
>I'm sorry man, but using other people's work in something that you're creating isn't cool.
Good programmers write good code; great programmers steal great code.
That's my opinion, and just as you're entitled to yours, I'm entitled to mine. That is all that I have to say on that subject.
(^_^)
![]() |
Other Threads in the Game Development Forum
- Previous Thread: OpenGL - Transformation matrix
- Next Thread: What are the best programming language for Game Programming
| Thread Tools | Search this Thread |
3d advertising ai algorithm ban c++ cambridge camera censorship china competition console development engine fov fpx game gamer games gaming gauntanamo government idaho in-gameadvertisement intellectualproperty laracroft live manhunt math mathematics matrix mercenaries microsoft mmorpg modded msn naked news nintendo obama palin physics pirate playstation politics projection ps3 rpg search software sony stephenhawking stocks studio technology terrorism tombraider uk videogame web wii world-of-warcraft xbox xbox-live xbox360






