Roguedeus

It's never too late to procrastinate...
Veteran
Joined
Mar 19, 2013
Messages
546
Reaction score
113
First Language
English
Primarily Uses
N/A
I just wanted to mention that lately I tried replacing this plugin (including the Event Clone Plugin) with my own 'simple' even copy plugin, and in doing so noticed a MAJOR performance issue that this plugin seems to help reduce substantially. Especially in maps with over 400 events.
(I have a stress test with 800 Events)


Put simply. If you plan on stuffing your maps with events, you should really consider this plugin to reduce overhead.


For those interested, here is a simple proximity check I make that allows me to keep even my 800 Event stress test playable. (58~60 FPS) Though the actual impact depends on what each event is doing and how often its done as well as the distance used.


Also keep in mind that this will not effect Auto or Parallel page events. This will not help with any performance impact caused by their over use.


(Make sure this is above any other plugins. Feel free to use it however you like. No need to credit me, though it would be appreciated.)
 

Code:
//RD_EventUpdate.js
//16_0304
//v1.0
//Last: 

var RD = RD || {};
RD.EventUpdate = RD.EventUpdate || {};
var Imported = Imported || {};
Imported.RD_EventUpdate = true;

/*
Credits: 
  Estriole - Clone_Transform_Delete_Events

  Note: Change the dist < 16 check on line 28 to whatever you need to make
  sure that events update outside your current screen size. The value is
  the number of squares away from the players current position on map.

*/

(function($) {

  //Replaces events() function in a the below functions...
  Game_Map.prototype.proxEvents = function() {
      return this._events.filter(function(event) {
        var player = $gamePlayer;
        var dist = $gameMap.distance(event.x, event.y, player.x, player.y);
        if(dist < 16 || event._trigger > 2) {
          return !!event;
        }else{
          return false;
        }
      });
  };


  //Overwrite
  Game_Map.prototype.refresh = function() {
      this.proxEvents().forEach(function(event) {
          event.refresh();
      });
      this._commonEvents.forEach(function(event) {
          event.refresh();
      });
      this.refreshTileEvents();
      this._needsRefresh = false;
  };



  //Overwrite
  Game_Map.prototype.updateEvents = function() {
      this.proxEvents().forEach(function(event) {
          event.update();
      });
      this._commonEvents.forEach(function(event) {
          event.update();
      });
  };

//==============================================================================
})(RD.EventUpdate);
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,749
Reaction score
15,314
First Language
English
Primarily Uses
RMMV
@Roguedeus, when you say "replace" this plugin, are you saying the script you have provided can be used instead of the EST script, or that it can be used in conjunction with it, to help improve performance?
 

Roguedeus

It's never too late to procrastinate...
Veteran
Joined
Mar 19, 2013
Messages
546
Reaction score
113
First Language
English
Primarily Uses
N/A
@Roguedeus, when you say "replace" this plugin, are you saying the script you have provided can be used instead of the EST script, or that it can be used in conjunction with it, to help improve performance?



Sorry for the confusion. What I meant to say is that this plugin, is helping with performance, not hurting. The plugin I started writing, to replace this plugin (thinking that this plugin was causing an issue with performance) actually revealed that without this plugin performance became unplayable with upwards of 400+ events. :)


I am also using Estriole's event clone plugin as well.


Estriole is caching map data in such a way that maps with many hundreds of events, even maps approaching the event limit of 999, remain playable. But the proximity check I posted, used together with this plugin, allows me to have an 800 event test map, run at nearly 60 fps. Including the use of Lyson proximity sensors plugin and Hime's Page Conditions. Which add more than the standard event update overhead.
 

Martin

Veteran
Veteran
Joined
Apr 8, 2015
Messages
192
Reaction score
47
First Language
swe
Primarily Uses
RMMV
The link has expired, anyone still have a copy of this? please paste here <3
 

Latest Threads

Latest Posts

Latest Profile Posts

Redesigning characters after such a long time feels great. Makes me excited to work on an old game again.
Phone menu to replace main menu WIP:
It's been that long since I wrote a plugin, it took me 4 attempts to realize it's != rather than #. In a 40-line plugin, 20 of those lines being documentation!
Disk Check Plugin - Running on Linux:
RMMV-Game-Mint.png
workin on some graphics for my game. was originally planning on doing a cartoony style for the town but I might stick with this instead

Forum statistics

Threads
116,085
Messages
1,095,620
Members
151,460
Latest member
gerebert
Top