Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 RPG game : battle formulas
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
rownale




PostPosted: Thu May 11, 2006 4:37 pm   Post subject: RPG game : battle formulas

hey im trying to make a battle formula for my rpg game but it isnt very good

damage := Rand.Int (strength, strength + extradamage)

strength is strength
extradamage is default 2 upgrades with every weapon upgrade

i know its bad
my ranged one is even worse though lol

throw := Rand.Int (1, 100)
if ranged (which is 15 default) > throw then
put "You hit the enemy for",rockdamage (which is 1 default)
elsif...
put "you miss"

so yeah my battle formulas suck
Sponsor
Sponsor
Sponsor
sponsor
Clayton




PostPosted: Thu May 11, 2006 4:41 pm   Post subject: (No subject)

so what exactly is it that you are trying to get help on? contrary to popular belief we are not psychic here, plz provide a detailed description of your problem, thnx Very Happy
rownale




PostPosted: Thu May 11, 2006 4:44 pm   Post subject: (No subject)

I also would like to make weapon variables saved in txt instead of using tons of if commands but i dont know how to do that stuff either
rownale




PostPosted: Thu May 11, 2006 4:45 pm   Post subject: (No subject)

my problem is that the battle formula is awful
and so if anyone has made an rpg and is willing to post their formulas for calculating max and min damage plz help
Clayton




PostPosted: Thu May 11, 2006 4:50 pm   Post subject: (No subject)

if you want to check into i/o to file check the Turing Walkthrough, there you will find anything you need on I/O to file, as for battle formulae, it would be better to know what you are trying to make so we can better help you Very Happy
Cervantes




PostPosted: Thu May 11, 2006 5:08 pm   Post subject: (No subject)

I'd recommend using D&D (Dungeons and Dragons) type battle systems.

You'll need to learn to use higher level data structures. Types get you part of the way there, but really the best way to do this is with Object Oriented Programming.

Check out the Turing Walkthrough and work your way up to those concepts. You've probably got a long way to go before you can make an RPG. A lot of people have wanted to make RPG's but failed when they got part way in because they did not have sufficient knowledge of aggregate data structures.
do_pete




PostPosted: Thu May 11, 2006 5:20 pm   Post subject: (No subject)

Also check out the RPG Guide.
rownale




PostPosted: Thu May 11, 2006 5:36 pm   Post subject: (No subject)

k thanks
Sponsor
Sponsor
Sponsor
sponsor
MysticVegeta




PostPosted: Thu May 11, 2006 5:47 pm   Post subject: (No subject)

Some random formulae I could come up with are:

TuringPseudo:

damage := Rand.Int (0 , x - defenseStrength) + Rand.Int (1, level) * c


x and c are constants.
As you can see, as the defenseStrength increses the domain for the Rand.Int decreases which means less damage as defense grows. the second part states that the more level it is, the greater the domain for the Rand.Int, which means the greater the chances to get more damage. You could be more creative and make x and c be variables depending on something else, for eg the level... this is a very basic formula, I am sure there are LOTS of other formulae for more accuracy...

For hitting the enemy... it could be:

TuringPseudo:
hitChances := Rand.Int (0, x - enemyLevel) + Rand.Int (0, playerLevel) + Rand.Int (0, playerWeaponLevel)

if hitChances > c then
   put "YOU HIT HIM"
else
   put "YOU MISS"
end if


Well this one is pretty easy to figure out... The more the enemyLevel, the lesser the domain for Rand.Int, the less chances for him to get hit + The more the player level, the more the domain for that Rand.Int, the more chances for him to get hit + The more the playerWeaponLevel, the more the domain of Rand.Int, the more chances to get hit...

The idea is the same.. again, this is very basic, people here come up with 1000X more complicated formulae but this is good to begin with Smile Come on IRC to get more better ones from Cervantes, zylum, gandalf, martin, etc.
Darkmantis




PostPosted: Thu May 11, 2006 5:52 pm   Post subject: (No subject)

I think it looks more professional to put the amount of damage done to the enemy instead of "you hit"
MysticVegeta




PostPosted: Thu May 11, 2006 6:01 pm   Post subject: (No subject)

well yes ofcourse, if you read the syntax-heading, it says "Pseudocode", also the point of the post is to tell about formulae not about how appealing it looks to the player, not saying you are wrong or anything.
monkeynamedsteve




PostPosted: Thu May 11, 2006 6:06 pm   Post subject: (No subject)

Hey, this game sounds interesting. Could you post a copy of the code please? Maybe you have and I'm just stupid. If so, sorry to waste your time.
rownale




PostPosted: Thu May 11, 2006 6:09 pm   Post subject: (No subject)

k thanks for the formula mystic i might try that

and monkeynamedsteve i never actually said anything about the actual game other than the battle formula...
monkeynamedsteve




PostPosted: Thu May 11, 2006 6:10 pm   Post subject: (No subject)

Okies, then I'm jsut stupid.
Sorry bout that.
do_pete




PostPosted: Thu May 11, 2006 6:16 pm   Post subject: (No subject)

If you really want the code for an RPG just go to [Turing Source Code], there are plenty there.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 16 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: