Need help with Increasing Encounter Rate

Black Pagan

Veteran
Veteran
Joined
Feb 21, 2017
Messages
350
Reaction score
271
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

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
5,624
Reaction score
5,104
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

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,990
Members
137,562
Latest member
tamedeathman
Top