Battles like in FF games

Started by
3 comments, last by Vegadam 22 years, 2 months ago
Ok, I was wondering if someone could point me in the right direction here. Im not asking for code, just hints as to how they do it. All I need to know is how to the make it so that when you are walking around, you will get in fights ocasionaly. And the time between each fight differs. I cant figure out how to make it that random, and I could use some help please. Thanks in advance.
Advertisement
There are several ways I can think of doing it. One is time based and the other is movement based.

If I rememeber correctly, you wouldn''t enter a battle in the old FF games if you simply stood still. It seemed like the game would randomly assign a battle every couple of steps. Whenever the player moves, simply generate a random number between 1 and 100:

battle_chance = rand()%100;

If you want the player to enter a battle roughly every 3 steps, see if battle_chance is between 0 and 33. Vary the numbers for different battle frequencies.

Time based could be similar. Say you want the player to enter a battle within 4 to 10 seconds.

int battle_time = rand()%7 + 4;

Once the appropriate number of seconds have passed, enter battle.
Thanks you very much.

You might want to extend this to include a modifier based on the tile you are walking on to -- some areas are guaranteed to have NO battles while some are guaranteed to ALWAYS have battles.

Additionally, the modifier could be used to make it so some areas have HARDER monsters and some EASIER.
Thank you, but as of now. It is not going to be heavy in the Graphics, so tiles may not work. Thank you for your input though.

This topic is closed to new replies.

Advertisement