Narch

Veteran
Veteran
Joined
Jan 13, 2017
Messages
66
Reaction score
9
First Language
French
Primarily Uses
Background:

I'm developing a game since a lot of months. I was previously using Galv Event Spawner when Yanfly did not have its own.
I encountered performances problems after hundred of spawns with the Galv plugin, slowing my developement last year. I switched to YEP Event Spawner when it got released, but with time I'm noticing it suffers the same kind of performances problems.
So far my game uses batches of 6 to 27 spawned events depending on the map, preserved or unpreserved.
I released a JAM game recently where I was first using Yanfly Spawned Events to spawn slots in a slot machine (9 slots). Here too, the game became rapidly unplayable until I ditched Spawned Events.


Detailed Problem:

Tested on MV 1.5.2 / MV 1.6.1

Using Yanfly Event Spawner, I spawn unpreserved events in a specific map.
There is technicaly only 1 reference event spawned. But the first page is a parallel self switch roll, that will put each spawned events on a different page (Page 2, or 3, or 4, etc...).
Once the map entered, you can interact with the events, or just leave. Everytime you leave the map, the events are naturaly despawned.
Re-entering this map spawns a different set of events each times.
If you do that for several minutes, the game starts to take longer to load the items, and once playing on the map, the performances become worse each times. In my main project, a set of 12 items spawned for 60 minutes create a loss of ~40FPS on the concerned map, and this again during normal gameplay, not only during generation.

Also please note that it appears the generated events never get their ID reseted. It starts from 1001 (plugin default), and only goes upward, even after being deleted. Depending on the rate of spawning, many events can also share the same ID.
Saving/Loading the game, or Closing the game, seems to give a bit more performances, but is too insignificant and truly works only 1 cycle of spawning.

Demo of the Problem (Click here to Download) :

In this Demo, I got up to date YEP Core, YEP Message Core (for debug purpose), and YEP Event Spawner
Talking to the NPC can create a parallel event that will do this loop:
  1. teleport the player on the Destination Map
  2. spawn batches of 100 unpreserved events on Destination Map
  3. wait some time to monitor FPS
  4. teleport the player on the Starting Map

Pressing PageUp repetitively will open the option to turn off this loop.
On my machine in editor, there's a loss of ~40FPS after ~40 batches of spawn, so 4000 event spawns. Requires about 80 batches in the game executable version.
This can sounds huge, but if the events are truly "unpreserved" this performance bug should not occur.
4000 spawns in the course of a full RPG should be little, be it for items, NPCs, or others.

May I note that spawning that much items at the same time is only for test purpose, but it would indicate that spawning low amount of items on the long run would have similar negative effects.

Important: it appears doing the demo process in Autorun instead of Parallel does not affect the FPS while the destination map is loaded.
The loading time for teleportation is still unaffected and gradualy longer in both Parallel/Autorun.


Used plugins can be found here:
YEP Core Engine: http://yanfly.moe/2015/10/09/yep-1-core-engine/
YEP Message Core: http://yanfly.moe/2015/10/10/yep-2-message-core/
YEP Event Spawner: http://yanfly.moe/2018/09/14/yep-170-event-spawner-rpg-maker-mv/


Conclusion:

I really hope someone can help to identify/fix this bug, Event Spawners are truly a game changer for RPG Maker, and my code knowledge is far too bad to work this for my main project.


My Machine:

Win 8.1
RPG MV 1.5.2
i5 4690K 3.5Ghz
GTX 970
16Go RAM
HDD 7200rpm
 
Last edited:

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,215
Reaction score
15,628
First Language
Filipino
Primarily Uses
RMMZ
I had to double take and make sure that you were real.
I wish more people report stuff like this. :kaoback:


But also...why do you need to spawn 4000 events?
You also might want to look into event morphers instead.
 

Narch

Veteran
Veteran
Joined
Jan 13, 2017
Messages
66
Reaction score
9
First Language
French
Primarily Uses
@Archeia It is something I might do yes, as a "workaround".
I been reworking my mechanics around bugs many times tho, hope I don't have to again, I thought I could rely on plugins carefree, that was my rookie mistake!

The 4000 during the course of a game happens quickly. In my specific case the player can open "chests" objects, in reccurent dungeons. My current dummy chest is 12 slots. It's only 333 chests total.

Anyways spawning events is so flexible and powerful it's hard to make without once you tried!
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,215
Reaction score
15,628
First Language
Filipino
Primarily Uses
RMMZ
@Narch Yes I use Spawn Events but I also use Copy Event and Morph Event. Instead of just spawning I can just change it into a new event type instead. Spawning new ones every time just feels like bad design to me.
 

Narch

Veteran
Veteran
Joined
Jan 13, 2017
Messages
66
Reaction score
9
First Language
French
Primarily Uses
@Archeia I'm not really trained with code and logic. I know the best way I found to generate my "chests" depending on the dungeon, is to have multiple arrays, and the spawning sequence picks into that array via a % modifier.

I'm sure I could achieve the same with copier and morpher. What I liked with the spawner is the ability to have all the code I need more or less in the same place, without relying on another layer of events. It's really really flexible in that manner.
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,215
Reaction score
15,628
First Language
Filipino
Primarily Uses
RMMZ
Spawner, Copier and Morpher are three components that work together. Just check Yanfly's videos.
 

Narch

Veteran
Veteran
Joined
Jan 13, 2017
Messages
66
Reaction score
9
First Language
French
Primarily Uses
Yes I understand that clearly, but in my case it's like having a hand with one broken finger. I already use Copier and Morpher for static doors for exemple, but with that bug I can't afford the promise of spawning dynamicaly those doors if I want to, because after 100 hours of gameplay the game will be unplayable.

If this bug is not only on my side, any game using it will encounter problems with performances, may it be dozen or hundred of hours.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,005
First Language
Tagalog
Primarily Uses
RMVXA
What does all your different chests do? If you made different chests to have different randomized drops, you could then just make "drop tables" and make your chest event randomize the drop table it will use.. This way you don't need to spawn new events for every chest.

Basically, instead of an array of chests that you will spawn when needed, make an array of the item drops instead..
 

Narch

Veteran
Veteran
Joined
Jan 13, 2017
Messages
66
Reaction score
9
First Language
French
Primarily Uses
There are indeed a lot of other design possible. But my primary concern is about this tool from a major creator, creating unforseen reactions that could only get discovered too late.
On a side note I also used this plugin in different methods like dynamic NPCs.

My 4000 items exemple happens through dozen of minutes, and opens the fact it could happen to fewer items through hundreds hours of gameplay, may it be my game or another one.

Thanks a lot for proposing design ideas, but my post is not about that part!
 

Narch

Veteran
Veteran
Joined
Jan 13, 2017
Messages
66
Reaction score
9
First Language
French
Primarily Uses
Edited my First post with new informations:

"It appears doing the demo process in Autorun instead of Parallel does not affect the FPS while the destination map is loaded.
The loading time for teleportation is still unaffected and gradualy longer in both Parallel/Autorun."
 

Latest Threads

Latest Posts

Latest Profile Posts

Studying more game mechanics and game design... If someone have some tips, I would be happy to read!
I finally caved and bought myself a Switch.
I'm having some trouble finding an established sub-genre to classify our current project. Effervesce Fallacy™ is loosely based on chaos theory . . . does anyone know what this sub-genre is called?
I figured I should start off with a game this (I think at least)would be easier to program. Demonstrating Card drawing for Black Jack

I'm playing Pokémon Yellow to celebrate National Pokémon Day. :smile: What Pokémon games is everyone else playing?

IMAGES/SCREENSHOTS

Forum statistics

Threads
108,900
Messages
1,040,420
Members
141,342
Latest member
Baan
Top