forums

TNT Basic Forums > Beyond Basic
Speed and running in RPGs
< Last Thread     Next Thread >
Author
Thread        Post A Reply

10-04-2003 05:23

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

How would I decide the odds of the player getting away in a battle based on the difference between the player's speed and the enemy's?

10-04-2003 15:40

Posted by:
eekaydee

Location:
CA, USA

Click Here to Email eekaydee   Find more posts by eekaydee

Ok, I think I found a good way: pick a random integer between -1*enemySpeed and playerSpeed. If it turns out positive, you get away, but if it is negative or 0, the enemy catches up to you.

10-04-2003 16:33

Posted by:
matteo

Location:
Venice, ITALY!

Click Here to Email matteo   Find more posts by matteo

Neat.

10-20-2003 12:37

Posted by:
mark_667

Location:
England

Click Here to Email mark_667   Find more posts by mark_667

This method can only give boolean responses, for a more advanced system you could always use a larger integer range, say between 0 and 100 and decide which range it falls between to give you different odds.
E.g.
Initial range=0-100

if random number is between 0-25=No chance
if random number is between 25-50=Reasonable
if random number is between 50-75=Good
if random number is between 75-100=Certain

Of course you can use any number of these with as many variations as you want to suit your game, although you will need a short and fairly simple if statement to deal with them.

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.