Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Found this plugin while looking for a solution to the performance issues of the YanFly EventSpawner.


With this plugin, my game has been spawning / destroying events for a minute before performance started to go down. I don't know if I'm doing something wrong, I'm just using spawnEvent ( no saving ) and unspawnEvent when the event hits a certain region. There are at best 40 events moving on the map simultaneously, rest are unspawned. I don't see why performance would degrade over time.

Also, this plugin is not compatible with RPG Maker MV < 1.6 ( has to do with node js version ).

(4 edits)

Worked on it a bit more. To give a bit more context : I have a mountain, from which boulders go down. There are a few spawners at different places which are parallel events. The boulders themselves are parallel events with movement routes.

1/ I encountered the same weird problem with YEP_EventSpawner : when I let the game run for a bit and my FPS is heavily impacted, if i just open a ShowText command, the game is back up to 120 FPS. The moment i close it though, I'm back to 1 FPS.

2/ Used the profiler inside the console. I saw that a ton of performance was used on processMoveCommand, which might mean that the movement was continued to be processed, even in unspawned events .

By adding the line "this._index = this._list.length;", i completely removed this problem and gained a TON of FPS. Still, letting the game run the FPS are still going down.

3/ Did a simple check on $gameMap._events and it's kinda obvious. The _events array is getting bigger and bigger as game goes on. I see a ton of events flagged "erased=true" though. I get it's the engine way to "remove" events. But it also means you can't get away with not pooling events...

Hello and thank you for purchasing this plugin! I'm sorry to see you're having problems with it.  If you're seeing the event array grow larger that would mean events are not being recycled which is leading to the fps drop. I would need more information on the process you're using to spawn and unspawn the events to understand why this is happening. It could be a number of things causing this to occur, the only way this spawner will create a new event on the map is if there are no unspawned events to transform, so something is causing the spawner to miss some/all of the unspawned events, or events are not being unspawned properly. 

I'd need more information on the boulder events and the event(s)/common event(s) you're using to spawn/unspawn them to get a clear view of what's happening.

Hey notRitter,

Thank you for the reply ! My setup is quite simple :

I have a parallel event to spawn boulders, with 2 commands :
- Script : Ritter.spawnEvent(13, 1, 11, 87, false)
- Wait(60)

The event spawned, my boulder, is on a separate template map. This event is also a parallel event with the following commands :
- Script : <custom plugin checking region tile of the boulder for ajusting speed / unspawning event >
- SetMoveRoute >This Event > Move Down ( repeat/skip/wait unchecked )

The script checking the region tile also handles the removal of the event if the boulder is on a specific tile :
> this._index = this._list.length;
> Ritter.unspawnEvent(this.eventId(), true);

(8 edits)

Quick update, I kinda hate myself because I left the YEP_EventSpawner plugin in the project and that was the cause of all the non-recycling weirdness... fml. So performances are great now !

That being said, I still have a problem with the plugin. I created a test project with only your plugin and absolutely nothing else. I have a parallel event with only 1 command : SetMoveRoute > This Event > Down with repeat/wait/skip unchecked ( it's the Boulder ).

I have two test map :
- First map, the Boulder is placed on the map.
- Second map, the Boulder is spawned using Ritter.spawnEvent.

I also have on both map an Event (Action Trigger), that does a simple TransferPlayer command on the current map.

When this last event is interacted with :
- First map, no problem.
- Second map ( spawned event ), callstack :



I can send you the test project if you'd like.

EDIT 1 : If I TransferPlayer from the Map 2 to another map, it works, even if the new map also has Ritter.spawnEvent. So the only problem is if I transfer from a map using Ritter.spawnEvent to the exact same map. Which is a bummer for respawning in my case.

EDIT 2 : As a workaround I transfer the player in a temporary map, and then back to the original map. Not as clean as I wish but it works and from a user perspective there's no difference.

Interesting, I'll have to take a look into this issue you encountered to see if I can replicate it and patch it, seems like something worth fixing. Glad to see you have figured out a way to get things working. Thank you for reporting this! I'll put out a devlog for this plugin once this is patched.