RPG Battle Algorithms

Please support our Game Development advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Dec 2004
Posts: 151
Reputation: Geek-Master is an unknown quantity at this point 
Solved Threads: 6
Geek-Master's Avatar
Geek-Master Geek-Master is offline Offline
Junior Poster

RPG Battle Algorithms

 
0
  #1
Jan 13th, 2008
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 in doubt, reach into the trash can and remove the user guide.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,858
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 755
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: RPG Battle Algorithms

 
0
  #2
Jan 14th, 2008
>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.
New members chased away this month: 5
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 151
Reputation: Geek-Master is an unknown quantity at this point 
Solved Threads: 6
Geek-Master's Avatar
Geek-Master Geek-Master is offline Offline
Junior Poster

Re: RPG Battle Algorithms

 
0
  #3
Jan 16th, 2008
That does make since for accuracy calculations to be executed first before damage is even considered.
If in doubt, reach into the trash can and remove the user guide.
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 55
Reputation: Suetan is an unknown quantity at this point 
Solved Threads: 4
Suetan Suetan is offline Offline
Junior Poster in Training

Re: RPG Battle Algorithms

 
0
  #4
Feb 2nd, 2008
Originally Posted by Geek-Master View Post
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.
Since you're working with on a veido game, I would put it something like this.

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
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 252
Reputation: technogeek_42 has a little shameless behaviour in the past 
Solved Threads: 3
technogeek_42's Avatar
technogeek_42 technogeek_42 is offline Offline
Posting Whiz in Training

Re: RPG Battle Algorithms

 
-1
  #5
Feb 4th, 2008
can i have some sample of that game when u finish to create that
╞═══════╣SPYnX███
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 55
Reputation: Suetan is an unknown quantity at this point 
Solved Threads: 4
Suetan Suetan is offline Offline
Junior Poster in Training

Re: RPG Battle Algorithms

 
0
  #6
Feb 4th, 2008
Originally Posted by technogeek_42 View Post
can i have some sample of that game when u finish to create that
I'm sorry man, but using other people's work in something that you're creating isn't cool. Granted, if you use something like phpBB in a CMS as a module, that's open source software and you can do that. I personally wouldn't use someone else's algorithms in something that I'm working on.

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 (^_^)
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 252
Reputation: technogeek_42 has a little shameless behaviour in the past 
Solved Threads: 3
technogeek_42's Avatar
technogeek_42 technogeek_42 is offline Offline
Posting Whiz in Training

Re: RPG Battle Algorithms

 
0
  #7
Feb 4th, 2008
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
╞═══════╣SPYnX███
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 55
Reputation: Suetan is an unknown quantity at this point 
Solved Threads: 4
Suetan Suetan is offline Offline
Junior Poster in Training

Re: RPG Battle Algorithms

 
0
  #8
Feb 4th, 2008
Originally Posted by technogeek_42 View Post
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'm a freelance web designer that's majoring in game and simulation programming at DeVry University. I'll be starting college on March 3rd.

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
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,858
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 755
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: RPG Battle Algorithms

 
0
  #9
Feb 4th, 2008
>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.
New members chased away this month: 5
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 55
Reputation: Suetan is an unknown quantity at this point 
Solved Threads: 4
Suetan Suetan is offline Offline
Junior Poster in Training

Re: RPG Battle Algorithms

 
0
  #10
Feb 4th, 2008
Originally Posted by Narue View Post
>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.
Everyone's entitled to their own opinion, I don't think that stealing code makes you a great programmer. Being great takes effort, and stealing code doesn't show effort. It shows that you're lazy.

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.

(^_^)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Game Development Forum


Views: 8044 | Replies: 21
Thread Tools Search this Thread



Tag cloud for Game Development
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC