Making random encounters better

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
535
First Language
English
Primarily Uses
N/A
for those of us who either don't have the time to program semi-random encounters (think "earthbound") or do non-random encounters like "aether chronical's: key to heaven" i'm attempting to come up with ways to make random encounters more bearable in game. here's what iv'e come up with so far

1) set # of steps to 40 on average and increase EXP and gold output by 1/3

this will give you less random encounters, yetyou'll get the same EXP and gold output for that area as if it had been 30 avarege

2) make a simple script that you can set a variable for each area were your garunteed X steps before the game starts calculating for random encounters

afterthought: don't mix 1 and 2, else you'll need to make your maps really big

anyone else have any ideas?
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
I think it varies some by map. For example, I have a huge tower in my game, and to keep the fights from being too much a bear I put the steps at 40 instead of 30. However, I also have a crowded bandit camp that the players can visit at some point in the game, and 30 steps (average) would let you cross the camp without being challenged by a bandit! In that case, 10 or 15 might be better.
 

Chaos Avian

Abyssal Wing
Restaff
Joined
Jul 16, 2012
Messages
3,230
Reaction score
785
First Language
English
Primarily Uses
Correct me if I'm wrong, but doesn't the random encounter step work by every step between the number you specify (30 by default) and 1? So encounters maybe nice and chill for one person but for someone else in the same game the RNG could be slapping them in the face every 10 or so steps. But if you're saying you can control it via variables then awesome. I think an indicator might help as well especially if you're thinking of giving players some control over encounters (like Repel from Pokemon).
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
535
First Language
English
Primarily Uses
N/A
what about a engine that starts the random encounter % at 1, the next step is 2%, the next is 4% the next is 7%, the next is 11%, the next is 16%, and so on and so forth?

it could be higher or lower depending on the situation needed. you would just have to increase the amount it increases by or something. i don't know

....21%, 28%, 36%, 45%, 55%, 66%, 78%, 93%

ok, that increases too fast, but you get the idea
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,367
Reaction score
7,676
First Language
German
Primarily Uses
RMMV
Correct me if I'm wrong, but doesn't the random encounter step work by every step between the number you specify (30 by default) and 1?
No, it works in a different way (which is why the number is called "avarage step", not "maximum step").
After an encounter, the game makes a [random(average step) + random(average step) + 1], which means it gets a number between 1 and two times the average step number, and then counts that many steps until the next battle processing.


Which means that if you use the default of 30, the difference between one battle and the next can be anything between 1 step or 60 steps, most of the cases around 30 steps and very rarely low or high numbers.
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
I'd change the encounter step generator from:

random(average step) + random(average step) + 1

to something like this:

average step - x + random(x * 2 + 1)

This makes the resulting encounter step significantly less random as now its won't differ from the average for more than x steps(of course the average and x has to be big and small enough respectively in order to make it less random).

Even though it's still somehow random, at least it'll be almost always really close to the average, so now encounter steps should be much more manageable for both developers and players, thus probably making random encounters better.

To change the encounter step generator, you can use custom scripts of the below snippet:

Code:
module Encounter_Step_Variance  Variance = v  Variance_Variable_ID = id # Setting id as 0 disables the use of game variable with id idendclass Game_Player < Game_Character  def make_encounter_count    id = Encounter_Step_Variance::Variance_Variable_ID    v = id > 0 ? $game_variables[id] : Encounter_Step_Variance::Variance    @encounter_count = $game_map.encounter_step - v + rand(v * 2 + 1)  endend
 
Last edited by a moderator:

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
Here's how I do it to solve the "3 steps and you have a battle" problem.  This ensures that it is much closer to what you set.

class Game_Player < Game_Character #-------------------------------------------------------------------------- # * Create Encounter Count #-------------------------------------------------------------------------- def make_encounter_count n = $game_map.encounter_step @encounter_count = rand(n) + rand(n) + 1 endend

[SIZE=10.5pt]There are a couple of ways you could change it depending on exactly what you want.[/SIZE]

@encounter_count = rand(n) + rand(n) + 1 + $game_variables[5]

[SIZE=10.5pt]This would simply add the amount in variable 5 to the encounter count. This would increase the average by that amount and ensure that many steps have been taken before a battle.[/SIZE]

EDIT

That snippet was supplied by Yato.
 
Last edited by a moderator:

Matseb2611

Innovate, don't emulate
Veteran
Joined
Oct 15, 2012
Messages
4,568
Reaction score
6,389
First Language
English
Primarily Uses
RMMV
I almost never have random encounter average step count below 35. Most times 40 works quite well. For smaller maps 35-40 is nice. For larger maps ~45 is good. It also depends on the nature of your map. Is it a linear map or is it an intersection between several different areas requiring the player to move back and forth between them? Because if the latter is the case, you have to take that into account too and not set the encounter rate to be too frequent.

Generally what I like to do to keep dungeon crawling fresh is to mix it up a bit. If all the player does is get into random encounters from start of the dungeon till the boss, they'll get bored pretty fast. This is where puzzles and story cutscenes come in. Use these as breaks to give the player a bit more breathing room and to chill out from fighting.

Some more methods that can work:

- Set enemy Agi to be much lower than player team's. That way players can escape the battles if they don't feel like fighting. Particularly I like to do this in the early stages of the game where you don't want to frustrate the player too much and let them escape if they really wish to and adjust to the game at their own pace.

- In late stages of the game provide items, skills, or equipment that halve or nullify the encounters. Supplying these to the player can cause problems of course, especially if you give these to them too early. Some players WILL wear/use them all the time and can end up being underlevelled later on, but giving it in late stages is not so risky and will help the players to reduce the repetition of random encounters a bit.
 

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
535
First Language
English
Primarily Uses
N/A
I almost never have random encounter average step count below 35. Most times 40 works quite well. For smaller maps 35-40 is nice. For larger maps ~45 is good. It also depends on the nature of your map. Is it a linear map or is it an intersection between several different areas requiring the player to move back and forth between them? Because if the latter is the case, you have to take that into account too and not set the encounter rate to be too frequent.

Generally what I like to do to keep dungeon crawling fresh is to mix it up a bit. If all the player does is get into random encounters from start of the dungeon till the boss, they'll get bored pretty fast. This is where puzzles and story cutscenes come in. Use these as breaks to give the player a bit more breathing room and to chill out from fighting.

Some more methods that can work:

- Set enemy Agi to be much lower than player team's. That way players can escape the battles if they don't feel like fighting. Particularly I like to do this in the early stages of the game where you don't want to frustrate the player too much and let them escape if they really wish to and adjust to the game at their own pace.

- In late stages of the game provide items, skills, or equipment that halve or nullify the encounters. Supplying these to the player can cause problems of course, especially if you give these to them too early. Some players WILL wear/use them all the time and can end up being underlevelled later on, but giving it in late stages is not so risky and will help the players to reduce the repetition of random encounters a bit.
I'm actually using story cutscenes and puzzles... although I can only do basic puzzles at the moment. like, the chest puzzle in super mario 64... I figured that one out in like 5 miunets. I am working on more complicated ones, but I'm going to try to discover them myself before i ask for help

and actually, I'm using 40 step average in my game, but I increased the gold and EXP output by 1/3 so you get the samme amount of gold and EXP for less. Also, I can't lower the enemy AGI, I can't explain why untill i get a demo ready though.

however, I'm thinking about putting in an item that either A: allows the player to escape more easily or B: lowers the number of random encounters the player encounters or both
 
Last edited by a moderator:

whitesphere

Veteran
Veteran
Joined
Mar 14, 2014
Messages
1,688
Reaction score
784
First Language
English
I like the idea of Dragon Quest's "Repel" which would keep away lower level monsters but not the higher level ones.  So you won't have nearly as many suicidal Slimes who wander into your level 50 death squad, wasting time and granting a whole 5 XP for the encounter.

Now that Dragon over there might still try to take a bite out of the party, but this means you'll have fewer tedious, annoying battles.

Of course, to make that work, you need some estimated level for each troop and a bit of scripting to modify the encounter logic to handle this, but it's probably not too difficult.

In Dragon Quest IX, there's no need for an explicit Repel.  Enemies automatically tend to shy away (or run away from) parties that are much more powerful than they are.
 
Last edited by a moderator:

Oddball

Veteran
Veteran
Joined
Sep 4, 2014
Messages
1,923
Reaction score
535
First Language
English
Primarily Uses
N/A
I like the idea of Dragon Quest's "Repel" which would keep away lower level monsters but not the higher level ones.  So you won't have nearly as many suicidal Slimes who wander into your level 50 death squad, wasting time and granting a whole 5 XP for the encounter.

Now that Dragon over there might still try to take a bite out of the party, but this means you'll have fewer tedious, annoying battles.

Of course, to make that work, you need some estimated level for each troop and a bit of scripting to modify the encounter logic to handle this, but it's probably not too difficult.

In Dragon Quest IX, there's no need for an explicit Repel.  Enemies automatically tend to shy away (or run away from) parties that are much more powerful than they are.
Hey, is there a way to make the monsters you see depend on the level of your party? like, if the avarege level of your party is 5 you'll see monsters who if they had a level would be somewhere between level 2 and level 8. where in the same area, if your level 32, you'll see monsters whoes level would be around 27 to 37
 

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
13,522
Reaction score
14,255
First Language
English
Primarily Uses
RMVXA
Hey, is there a way to make the monsters you see depend on the level of your party? like, if the avarege level of your party is 5 you'll see monsters who if they had a level would be somewhere between level 2 and level 8. where in the same area, if your level 32, you'll see monsters whoes level would be around 27 to 37
As far as I know, no, not without a script that levels up the enemies with you, which Yanfly made (and maybe others). But, it will be the same enemy, but at different levels.
 
Last edited by a moderator:

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,787
Reaction score
939
First Language
Chinese
Primarily Uses
N/A
As far as I know, no, not without a script that levels up the enemies with you, which Yanfly made (and maybe others). But, it will be the same enemy, but at different levels.
Or you make all those troops have event commands Enemy Appear: [1. Enemy X] for each enemy. Then use the event command Enemy Transform: [1. Enemy X], [Enemy Y].

What Enemy Y is is controlled by conditional branches which uses variables storing actors' levels.

No custom scripts or even script evaluation code is needed but it'd be probably tedious like hell of course, especially if you've lots of enemies and troops.
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

People3_5 and People3_8 added!

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.

Forum statistics

Threads
105,868
Messages
1,017,085
Members
137,583
Latest member
write2dgray
Top