SO I JUST NOTICED SOMETHING INTERESTING ABOUT ENCOUNTER RATE IN VX ACE.

Posts

Pages: 1
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
This is probably already common knowledge, but I was stepping through the update code for the maps on VXA (because I neededed to know exactly how battles are triggered for something I'm working on) when I came across this:

#--------------------------------------------------------------------------
# * Update Encounter
#--------------------------------------------------------------------------
def update_encounter
return if $TEST && Input.press?(:CTRL)
return if $game_party.encounter_none?
return if in_airship?
return if @move_route_forcing
@encounter_count -= encounter_progress_value
end
#--------------------------------------------------------------------------
# * Get Encounter Progress Value
#--------------------------------------------------------------------------
def encounter_progress_value
value = $game_map.bush?(@x, @y) ? 2 : 1
value *= 0.5 if $game_party.encounter_half?
value *= 0.5 if in_ship?
value
end

This is interesting for two reasons I didn't realise until now. First is that the number of steps required for a battle is actually predetermined as soon as you've triggered the previous one; it isn't checked on a per-step basis like I thought. Second is that any tile you've set as a "bush" will actually trigger battles twice as fast as non-bushes, which I also didn't know.

Just in case it's any help or relevant to anyone, here's the way encounters work by default:

The initial value of the "encounter" variable is rand(steps) + rand(steps) + 1, where steps is the value set on the map. So if you have your map set for encounters every 30 steps on average, the actual value will be between 1 and 59.

For every step you take, the value will reduce by 2 if you're on a bush or 1 if you're not. If the encounter rate has been halved or you're on a ship, the reduction will be 1/0.5. If the encounter rate is halved AND you're on a ship, the reduction will be 0.5/0.25.

When the value is 0, a battle triggers and the encounter variable is reset.

Does anyone else find this interesting or am I just now discovering stuff that everyone already knew? :P

Edit: Just as a final note, the way encounter steps are calculated would actually make it ridiculously easy to make an encounter proximity display like in Etrian Odyssey.
Minus the added features of vehicles, half encounter rate, and the bush thing, it's pretty much the same way XP did it. I only know because I messed with it back then.
author=Trihan
Edit: Just as a final note, the way encounter steps are calculated would actually make it ridiculously easy to make an encounter proximity display like in Etrian Odyssey.


And now that I think about it, that's likely how Etrian Odyssey does it. Having gotten into the series not too long ago, I noticed how the display seems to be right on track every time, and the battle always starts when it is full red. I've seen games with similar displays that sometimes have encounters happen before it goes full red, as should happen with encounters being calculated randomly on a step by step basis. But not with Etrian Odyssey, it's always perfectly accurate.

And the cool thing is, from the player's perspective this is indistinguishable from a step by step calculation. With save states it'd be pretty easy to figure out what's going on, but the average player does not deal with those. And it actually makes it easier for the player to make adjustments to the encounter rate calculations. And I have to admit, the default formula is quite poor.
Determining the number of steps until the next encounter immediately after the last one is the way it's been done since small times. It's a shame that a lot of the other little time-saving things old games did to make "randomness" easy didn't also carry over -- I'd love to see someone break an RM game over their knee with RNG manipulation and those sorts of tricks. The way old games seeded their random values was pretty predictable, so you could do some interesting stuff if you were an insane TAS lunatic.
I try to tell people about this when they espouse the random encounter as fine. Since, oh, you're as likely to get two-step encounters as you are 50-step ones after each battle.

I guess one way to change it would be to mark normal ground tiles as bush ones, edit out the transparency line in the script dealing with the terrains and have at like that.

But thanks for putting this up. I shall henceforth send random encounter peeps to this topic when they argue that it's the best way to do battles (and by this I mean with nothing added to let you know how close you are to a battle - just default RE.)
It does seem pretty silly that the program won't let you assign a minimum by default, doesn't it? If you're going to impose random encounters on people, you should at least do that much.

(and then maybe throw the whole setup away and pick a better model)

((no seriously mother 3's system was fantastic you should all take notes))

Also, ugh, now I'm wishing that it was possible to break into rpg maker and change its seeding variables to something really obvious and easy to manipulate, just to fuck with whoever's playing it. Just, a game where exploiting the game is half the deal.
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
I think what I'm going to do is change the default formula so instead of a minimum of 1 it's a minimum of the actual number of steps you set on the map, but can be higher. Since I'm doing a battle system that will essentially make normal battles sort of like mini boss battles in their own right (until you're powerful enough to just kill things in a couple of hits) it'll probably be better to have fewer battles to worry about.
Giving battles that sort of weight sounds like an argument in favour of maybe not leaving it completely to random chance, if you ask me. Random encounters already make exploration enough of a chore when every one of them isn't its own miniboss. With stakes like that, make some strategy possible.
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
Well my plan is to have the encounter rate as a player option anyway, to the point where you can turn battles off if you'd rather not deal with them.
I prefer on-touch enemies usually, but I was thinking I'd use a 100% chance encounter region at certain strategic parts of a map. Or even do a step counter, which is dead easy in Ace. No longer should we be limited to just random or touch.

Hell you could even do battle fields where you clear them out and no more monsters spawn after a certain amount - limits the amount of grinding you can do but if your game runs on balance, why not?
halibabica
RMN's Official Reviewmonger
16873
Hmm...the +1 in the standard formula is meant to prevent zero values, right? If you changed that 1 to a 10, wouldn't that make 10 the minimum steps you could go before encountering something? Just a thought.

I never properly understood how the RM* determines when an encounter happens, so this was interesting to learn.
author=halibabica
Hmm...the +1 in the standard formula is meant to prevent zero values, right? If you changed that 1 to a 10, wouldn't that make 10 the minimum steps you could go before encountering something?


Sure does! In addition you can affect the distribution of encounter steps by changing the number of rand(steps) too. rand(steps*2) has the same potential numbers as rand(steps) + rand(steps) but with only one rand each value has an equal probability of appearing. Having two rands creates a bell curve where steps - 1 (rand is 0 to (x-1) ) is the most common number generated and the farther a possible result is from that number become less common. For example, with 30 steps, 29 is the most common number generated (29+0, 28+1, 27+2, 26+3, etc.) while 58 and 0 are the least common as only one RNG combination that lead to it (29+29 and 0+0 respectively).

Calculating the encounter steps before hand is also a really smart idea that despite knowing since EBZ (opening the menu to rest the next-encounter count, a god send in that game) I never thought of using myself. I really should, if even just for the additional potential control.
This is very interesting, thank you! Up until now, I've only modified/disabled the scripts, so I'd like to try Trihan's idea of an encounter proximity display as practice for future scripting.

Do you guys have any advice for a novice such as myself on how best to implement such an idea?
Trihan
"It's more like a big ball of wibbly wobbly...timey wimey...stuff."
3359
Well the number of steps required for the next battle is already a variable, so it wouldn't be hard at all. I would basically add a new method to Game_Map that checks the value of the "steps to next battle" variable and shows a picture depending on how close you are to a battle (you could even do it with just one image and tint it rather than having a separate image for each "step" of the display)
Alternatively if you don't want to deal with scripting you can replace all references of "@encounter_count" with $game_variables[variablenumberhere] so it just uses a normal variable you can access through event commands for convenience.



vvvv
Didn't know that, thanks Lockez!
LockeZ
I'd really like to get rid of LockeZ. His play style is way too unpredictable. He's always like this too. If he ran a country, he'd just kill and imprison people at random until crime stopped.
5958
fyi you can make square brackets appear without [code] tags by typing [[] for a left bracket (basically a left bracket inside brackets) and []] for a right bracket (basically a right bracket inside brackets)
Thanks guys! I'll give this a shot as my first original script project!
Pages: 1