RPG Battle Algorithms

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

Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: RPG Battle Algorithms

 
0
  #11
Feb 5th, 2008
@ Suetan: it really depends what you call 'stealing', there are some great algorithms out there that exist in or out of code, implementing a given algorithm isn't 'stealing' it, unless it's patented, or otherwise legally restricted; linking against a library of 'great algorithms' is something that many programmers do once or twice an hour. Everytime you use multiplication, you're kinda 'stealing' the algorithm for fast floating-point multiplication in binary.. unless, you do infact rewrite that yourself... that's a silly example, of course, and I guess, it depends on the complexity of what you're doing - but personally, I'll happily at the very least study prior work before jumping in with the long guns.. Everyone ( and thus every programmer ) has their own strong area(s), and you can certainly get more work done if you allow other people to help you in those weaker areas, via algorithms and code examples.

With regard to actually copy-pasting the ( e.g. C++ ) code for a given algorithm.. hey, it certainly takes 'effort' and knowledge to integrate that with an existing codebase, sometimes more effort and knowledge than reading a non-code formal description of the same algorithm and implementing it from scratch. IMHO, you can't make a good ( non-trivial ) program by 'glueing' bits of other people's unrelated programs together, unless you really know what you're doing in the first place.
Plato forgot the nullahedron..
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
  #12
Feb 5th, 2008
You bring up a good point. People do use code that's already written to learn. I can understand that fully.

It's like me using phpBB to learn how to do PHP scripting. I'm not saying that it's bad to go and use code to learn. However; if you already know the language, have experience working with it, and you still take code from others and implement it into your code, that part is still not your creation.

You can use it as an example and base your work off of it, but don't go and take what someone else did and put it in your work and take the credit.

That's all I'm saying. It's morals, pure and simple.

Perhaps the word "stealing" shouldn't be used so loosely.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,846
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: 752
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: RPG Battle Algorithms

 
0
  #13
Feb 5th, 2008
>Perhaps the word "stealing" shouldn't be used so loosely.
Perhaps you should chill out a bit. That tongue-in-cheek quote hardly means what you seem to have gotten out of it.
New members chased away this month: 4
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: RPG Battle Algorithms

 
0
  #14
Feb 5th, 2008
PHP itself is a classic example - everytime you write a PHP 'program', you're relying on many developers prior effort to create that big, unsightly ( but admitadly useful ) bag-of-functions that is PHP. Way off topic for the games forum anyway.

Nearly every commercial game these days uses a mega library / engine for all but the highest level areas of code.. As a more appropriate e.g.: very few people try to pass off the OpenGL library as their own work ( except the developers of a given implementation of OpenGL ), but that doesn't mean you can't write a program that uses OpenGL and call that program 'your own', and using OpenGL doesn't make a program, or a programmer less 'good'. At least I hope it doesn't, because personally, I'm glad that I don't have to write a renderer everytime I need to do some 3D work.

Still.. I guess it's subjective.. but in this case, I don't even get the impression that technogeek_42 wants to rip off anyone's code as his/her own. If people are willing to offer technogeek_42 some libraries and/or code, that's their prerogative, if technogeek_42 then goes off and makes 'the best game ever' with what he/she is given - good for him/her.
Plato forgot the nullahedron..
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
  #15
Feb 6th, 2008
Originally Posted by MattEvans
Still.. I guess it's subjective.. but in this case, I don't even get the impression that technogeek_42 wants to rip off anyone's code as his/her own. If people are willing to offer technogeek_42 some libraries and/or code, that's their prerogative, if technogeek_42 then goes off and makes 'the best game ever' with what he/she is given - good for him/her.
Agreed. Now let's get back on topic. I'm not going to follow up on the stealing code thing any more. If it helps you out, it helps you out.
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
  #16
Feb 6th, 2008
ATTACK_POWER - DEFENSE = DAMAGE;
(^_^)
i think ur wrong here i have isuggestiong why don't diz attack power will be magic power coz man is for woman and dog is for dog and magic attack is for magic defense
╞═══════╣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
  #17
Feb 6th, 2008
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();
     }
}

If you look at the code example, the part that you quoted is for a standard attack.

If then Else statements help for determining what type of attack you're doing. A more notable method might be to do a switch statement. I just came up with something quick and simple.
Last edited by Suetan; Feb 6th, 2008 at 10:28 pm. Reason: corrected grammer
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
  #18
Feb 10th, 2008
ur wrong my suggestion is ryt
╞═══════╣SPYnX███
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,846
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: 752
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Senior Bitch

Re: RPG Battle Algorithms

 
0
  #19
Feb 10th, 2008
>ur wrong my suggestion is ryt
That's nice. Prove it.
New members chased away this month: 4
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
  #20
Feb 11th, 2008
hehehe just kidding
f (ATTACK_TYPE != ATTACK)
{
if (ATTACK_TYPE == MAGIC)
{
M + SBP = ATTACK_POWER;
magic_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();
}
}
╞═══════╣SPYnX███
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
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