Need help with Increasing Encounter Rate

Black Pagan

Veteran
Veteran
Joined
Feb 21, 2017
Messages
297
Reaction score
222
First Language
English
Primarily Uses
RMMV
I have been working on a Mini Dungeon Crawler, Basically made of 23 x 13 Maps. So as you can imagine, Battles can't simply be random step encounters in a small map, It will lead to Player quickly leveling up and ruins the fun. I didn't like the idea of "Pre-defined" number of Battle encounters either, So i figured out a way to make it more interesting.

So, This is what I came up with :

The Default Encounter rate is set to 60. Player has his first 3 Encounters. After this however, the Encounter Rate doubles to 120. So now the Player has very less encounters. Soon after 3 Encounters at 120, The Rate now doubles to 240... And So on.

Basically, It will require increasing the Encounter Rate by "x" after "n" Encounters. Does anyone have any Idea on how I make this happen ?
 

Wavelength

Edge of Eternity
Global Mod
Joined
Jul 22, 2014
Messages
5,404
Reaction score
4,801
First Language
English
Primarily Uses
RMVXA

I've moved this thread to RPG Maker MV Support. Please be sure to post your threads in the correct forum next time. Thank you.

Never use the Maker General section for How-To questions... and this is exactly why. The way that you handle this will be different in every RPG Maker because it is either going to require plugins/scripts or a change to your code. (Alternatively, in MV there are roundabout ways to do it with eventing alone, but it would take a long time.) Since you primarily use MV, I'm assuming that's what you're asking about.

In MV, there is a function in the rpg_objects.js that reads:
Code:
Game_Player.prototype.makeEncounterCount = function() {
    var n = $gameMap.encounterStep();
    this._encounterCount = Math.randomInt(n) + Math.randomInt(n) + 1;
};
This controls how many steps must be taken before the player hits an encounter on this map, and it will be your starting point for modifying how many steps will be taken, on average, before running into another encounter.

For example, you could track how many encounters have been fought on a given map by storing it in a variable whose index is equal to (for instance) 100 + the Map's ID. So Map 1's total encounters fought would be stored in Variable 101, and Map 28's total encounters fought would be stored in Variable 128.
  • You would need some way to actually increment these variables - if each troop is confined to a single map, you could increment the appropriate variable in a Troop Event. If some troops appear on multiple maps, you'd need a script line that reads what map the player is currently on (or you could find the Start Encounter method in the core library and use that to increment the appropriate variable).
Then, you would need to use that variable appropriately to change the base encounter rate, which is represented in the "var n" line in the code above. Since we want the average number of steps to double after every 3 battles fought, we would need to find how many 'sets of 3' have been fought on this map, and apply it as an exponent to the base Encounter Steps for the map.

So here's a rewrite of the method that I think would get the job done (I can't test right now):
Code:
Game_Player.prototype.makeEncounterCount = function() {
    var threes = Math.floor($gameVariables.value(100 + $gameMap._mapId) / 3);
    var n = $gameMap.encounterStep() * Math.pow(2, threes);
    this._encounterCount = Math.randomInt(n) + Math.randomInt(n) + 1;
};
 

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

Latest Threads

Latest Profile Posts

Just a heads-up that Slip into Ruby and Jump into Javascript might be a bit slow for now while I'm on the team porting the YEP plugins to VisuStella's MZ suite.
So I managed to build a teleport skill. You can see the progression in the development topic
https://forums.rpgmakerweb.com/index.php?threads/in-dev-multi-hit-target-selection.125049/

Here's how it looks:


But the real question is, can I pull off FF8?

I love these little slime battlers. Really wish I could find more animated ones :'(
The curse of retail: you get ideas, you want to make something with those ideas, but because you're always at friggin' work you can't actually do anything with them.
Quexp wrote on lumimae's profile.
Welcome! :)

Forum statistics

Threads
100,630
Messages
977,962
Members
132,248
Latest member
Dealdeg
Top