943,879 Members | Top Members by Rank

Ad:
You are currently viewing page 1 of this multi-page discussion thread
Jan 13th, 2008
0

RPG Battle Algorithms

Expand 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.
Reputation Points: 12
Solved Threads: 6
Junior Poster
Geek-Master is offline Offline
156 posts
since Dec 2004
Jan 14th, 2008
0

Re: RPG Battle Algorithms

>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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Jan 16th, 2008
0

Re: RPG Battle Algorithms

That does make since for accuracy calculations to be executed first before damage is even considered.
Reputation Points: 12
Solved Threads: 6
Junior Poster
Geek-Master is offline Offline
156 posts
since Dec 2004
Feb 2nd, 2008
0

Re: 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:

(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
Reputation Points: 11
Solved Threads: 5
Junior Poster in Training
Suetan is offline Offline
75 posts
since Feb 2008
Feb 4th, 2008
-1

Re: RPG Battle Algorithms

can i have some sample of that game when u finish to create that
Reputation Points: -10
Solved Threads: 3
Posting Whiz in Training
technogeek_42 is offline Offline
254 posts
since Dec 2007
Feb 4th, 2008
0

Re: RPG Battle Algorithms

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 (^_^)
Reputation Points: 11
Solved Threads: 5
Junior Poster in Training
Suetan is offline Offline
75 posts
since Feb 2008
Feb 4th, 2008
0

Re: RPG Battle Algorithms

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
Reputation Points: -10
Solved Threads: 3
Posting Whiz in Training
technogeek_42 is offline Offline
254 posts
since Dec 2007
Feb 4th, 2008
0

Re: RPG Battle Algorithms

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
Reputation Points: 11
Solved Threads: 5
Junior Poster in Training
Suetan is offline Offline
75 posts
since Feb 2008
Feb 4th, 2008
0

Re: RPG Battle Algorithms

>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.
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Feb 4th, 2008
0

Re: RPG Battle Algorithms

Click to Expand / Collapse  Quote originally posted by Narue ...
>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.

(^_^)
Reputation Points: 11
Solved Threads: 5
Junior Poster in Training
Suetan is offline Offline
75 posts
since Feb 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Game Development Forum Timeline: OpenGL - Transformation matrix
Next Thread in Game Development Forum Timeline: OpenGL - Problems with zoom in/zoom out





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC