Very new to RPG Maker MV, but before I commit myself would really like to learn what kind of things are likely to make a game lag/slowdown.
I've read today that parallax mapping can cause lag if too big: how big exactly? What's the most you can get away with?
In general, what are the main things that can really lag the engine?
Many thanks.
Hello, welcome to the forums, and to RPG Maker! 👋
Probably the biggest cause of lag would be haphazard usage of Parallel Processes. Parallel Processes will attempt to run their event at every possible frame, which depending on what that event is set to do (and especially if you have several of these going off at once), this can quickly cause some lag.
The other common cause of lag tends to be having too many events on one map. What the event is doing matters a lot more than how many there are, but if you're trying to have hundreds of events on one map, you might run into some slowdown. There are anti-lag plugins available that can help with this, though.
For paralax mapping, I've heard that the magic number is somewhere between 40x40 and 50x50 before you start getting lag, but I admitably don't have much experience with paralax mapping, so take that with a grain of salt.
Feel free to ask any questions you come across, there's plenty of friendly people around that are happy to help you out.
There are many potential causes of lag.
A single parallel process with just a couple of lines can cause lag. Two parallel processes running at the same time can cause lag. It depends what's in them.
Processing-intensive plugins can cause lag, such as lighting plugins. They may work fine for someone who has a high-spec machine, but cause someone else's low-end machine to ground to a halt.
Large maps, lots of events, large parallaxes.
A lot of them can be avoided with good design, but not all.
loading stuff from disk if a lot of other stuff is going on (can be handled by preloading)
As far as parallax mapping goes, I was recommended to not be lazy and use multiple small assets and take the time to position each one correctly, instead of using large visual assets that cover the entire screen.
Having fewer Events running at once on the screen will also help reduce lag, from my experience.
One of the projects I worked on would run perfectly on some of my computers, and not at all on some older models, so the amount of lag could be dependant on your hardware and the game's optimization. It's probably preferable to make sure your game can run on a toaster.
As said above there are a lot of different causes for lag, and they are all additive. Every computer has a limited capacity before that lag becomes detectable, and you'll only know the last part that added to the lag because the previous parts that added to lag were still within the limits of the computer (even if they are often causing more lag than that last part you added before lag became too much).
That is why you will only get vague statements without specifics on what causes how much lag.
As for parallax maps - the problem is that a parallax picture needs to be uncompressed in RAM for it to be used in a map, and that takes several thousand times the RAM as would be needed for a tile-based map.
A lot of people confuse the compressed filesizes of a stored picture with the uncompressed RAM requirement. If you want to know how much RAM a picture needs to be used as a parallax map, please store it as BMP on your harddrive. That is the RAM-size, because BMP has no compression.
(it's a lot more than the picture needs stored as PNG)
RPGM mv has very poor performance overall especially when you start adding plugins.
Maybe it has something to do with the programming language and how inefficiently it handles the data. In the same manner why browsers are so demanding nowadays.
TDDP bind pictures to map kills performance and has memory leaks. I see a lot of people using that plugin, but I would advise against it.
So far galv parallax map plugin worked best for me. Maybe yep_doodads is worth a try for adding sprites. But I think you'll need "jitter fix" plugin to fix some graphical bugs.
There are several plugins which reduce performance a lot, just be careful. For example, mog animated enemy busts during battle result in 22fps instead of 38fps just by adding a "breath" effects them.
Avoid making big maps. 40x40 or 50x50 shouldn't cause issues. Bigger than that, plus parallax plugins will kill performance. Too bad, but rpgm mv can handle only pocket-size maps. That's why I dropped the idea of making actual rpg style game, it just wasn't good enough especially when sprites and tiles were 2x of regular size. Game on lower end machines would lag and maps were too small for my liking. Unless your game is basic as it gets, forget the idea of making 100x100+ town full of npc etc.
Resolution can be a problem. That's something I still need to test, but just using 720p instead of 1080p can have a massive difference. Not 100% sure about that though.
Using bigger than 4000x4000 pictures will fail to load them on some machines. It's the limit set by hardware to avoid long loading times. It's noticible on phones especially.
Lightning plugins are pretty demanding. Loading multiple pictures at once will stutter pc. For some reason rpgm has a hard time loading pictures. Problem for lower end pc and mobiles.
And yes, parallel events/common events are demanding. Maybe adding 1-3wait command if it's some kind of stat checking event is a good idea.
What I'm saying RPGM is the pretty nice little engine, just don't overdo what's beyond the engine.
There are hundreds of plugins available, you can stack them all together expecting to make this huuuge rpg world full of wonder and mystery, but the game itself will probably end up as an unplayable mess with crashes and poor performance. Test a lot and have realistic expectations. Start small and use plugins you actually need.
There's some seriously useful information being posted here, really giving me a better focus - many thanks.
Will a lot of lag be reduced depending on the filesize of your png's overall? Would a 8-bit png run faster than a 24-bit png, for example?
What caused lag for me before was having many monsters with various hues changed from engine in battle, having too many animations from parallel events running and such.
But I believe it's what your hardware can handle that mainly affects this.
With my new laptop I have none of this previous issues I mentioned.
Because people already gave an overview of why RPG Maker itself may cause some unstable frame rates, I want to talk a little more down the rabbit hole.
Itt goes way beyond on what RPG Maker does, the unstable frame rate is because at some point the hardware is being bottlenecked (The code also sets some limits for some things, like cacheing) . So you need to think about mainly 3 things:
RAM (Memory)
Graphics (Renderizing)
Instructions (Processor)
If your game bottlenecks at one of these points, you get the frame rate to fall, Now each thing is its own universe. The more instructions you pass like variable operations (indirectly also, like walking on the map, calculations, and other stuff), it will require the processor. Things you put in Cache, like images, variables, events will be loaded on the RAM. Image processing and visual things will require the to be renderized, and that asks from the graphic card. Some hardware can cross-help the other, but that wouldn't be the point of the question now.
Knowing those, you can evaluate a little bettler some plugins also, what it is forcing from the hardware to do, and where it might be lending heavier on.
So what happens if a huge parallax image is loaded at once, it will ask for both Graphics, because it is actually showing the image even if its not on the screen, and from the RAM, because it needs to Cache it, also the processor because it does pass into a lot of instructions to renderize it also.
Its not exactly the engine, its what it is doing at the moment, Sadly or Happily for some, RPG Maker comes with a LOT of default coding, and some are executed even if you are not using like vehicles/states, those do help for RPG Maker games to not be performatic, but usually your design on the game will be the best way to avoid lags and freezes.