Lag

Indsh

Veteran
Veteran
Joined
Oct 11, 2015
Messages
225
Reaction score
65
First Language
English
Primarily Uses
N/A
Coming towards the completion of my game and I have a very interactive environment.


Any lag improvements people have will be much help, I can play the same area over (what I think is) identically and sometimes it lags sometimes it doesn't so a thread with any findings I think would be useful.
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
Well we can't really help you because we have no idea what could possibly be lagging in your game. Because you never said anything about what you have in your game. How can we help you ifspe you don't help yourself?
 
Last edited by a moderator:

GrandmaDeb

Modern Exteriors Posted!
Veteran
Joined
Apr 25, 2012
Messages
4,467
Reaction score
2,942
Primarily Uses
Well, @Zalerinian, I hope there are general advice type things which can be said. I want to begin a new game, and I'd like to be aware of lag issues from the start, eh?
 

Indsh

Veteran
Veteran
Joined
Oct 11, 2015
Messages
225
Reaction score
65
First Language
English
Primarily Uses
N/A
@GrandmaDeb That's exactly what I'm going for, I'm not claiming to have lagging "issues" as such, but even AAA games do not come out perfect so if there is ANYTHING someone has done in RMMV that helped in any way I think that would be helpful.


@Zalerinian have you have solved a lagging issue or improved performance within Rpg Maker MV in any way?
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,696
Reaction score
935
First Language
English
Primarily Uses
N/A
@Indsh you stated in your original post that some areas of your game seem to lag sometimes, but not others, which is a claim to have potential lagging issues.


And general improvements will depend on your plugins, anyway. Many games make use of a lot of Yanfly plugins. Make sure everything is up to date so that any previous issues would be ideally resolved.


Reduce the number of parallel process events as much as you can, as these can reduce the performance of the rest of the game since they, too, will need to be run with everything else. This includes parallel common events, which may be running across multiple maps.


Similarly, make sure parallel common events aren't running when they need not be, because otherwise you'd be wasting time when you need not be.


Are your maps large? This can cause performance issues on low end machines because the map needs to be redrawn every frame to account for animated autotiles.


When testing, is your game running in Canvas mode or WebGL mode? You can find out by bringing us the FPS meter (F2), which will display what mode you're using. WebGL mode is supported on most modern computers and browsers, but older machines may not be compatible, and will be running in Canvas mode, which is generally slower.


Do your events use loops often? Ensure that they only run as many times as needed, or else you may encounter issues there.


For that matter, how many events are on each map? Even if an even is listed as parallel or autorun, only one thing can be processed at a time. If your event is simply used to put a picture on the map, it is still checked to see if it has any event commands. Consider if you really need a lot of events that are just pictures.


The biggest place where performance can really be changed is by your plugins. How many are you using? Do you really need all of them for your game to still function the same way? Most people won't really know is a plugin is well designed, as it does involved understanding how a plugin works and many people who used the RPG Maker line of products are those who prefer the use of the event editor, either for its simplicity or because programming isn't their forte. As a result, being able to tell if your plugins are properly optimized, especially when using a large number of scripts that rely on each other the way Yanfly designs his, becomes difficult. 
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
Please follow the link "bughunting" in my signature and read the background info about the game loop and why parallel processes should be avoided.


The problem you've missed is that lag is always caused by mistakes you made when developing your game, and to solve the lag you need to find out where you made those mistakes.


If the lag would be there every time, it might have been something like having too many events in that map.


Since the lag is only there part of the time, it can be almost guaranteed that it is caused either by bad logic in parallel prcesses or by plugin problems - both of which can't be solved without info on your plugins and on the parallel processes you use in the game.
 

Indsh

Veteran
Veteran
Joined
Oct 11, 2015
Messages
225
Reaction score
65
First Language
English
Primarily Uses
N/A
@Zalerinian  @Andar I have made my own ABS with multiple melee and projectile moves that can merge to form extra moves, items with their own action features, enemies that react to each attack uniquely, interactive environments and AI intelligent team mates. Out of 30+ maps a couple have a bit of lag, this is not what RMMV was made for hence why I do not consider it an issue, and I could just get rid of certain features in those areas hence why I do not see them as mistakes...but that doesn't mean I can't learn hence the post.


Both of your post were helpful and have given me a few avenues of thought on what RMMV considers efficient and I have seen some improvement.


Only thing I have to add to the conversation practically is that it seems a repeated move route can sometimes have the same impact as a parallel process.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
that depends on the move route - the move route was created as an alternative to a full parallel process and the commands inside a move route have been limited for maximum efficiency. So it is better than using the same commands within parallel processes - but as I explained in the bughunting, any part of the game loop can lag the game if it is causing too much processing.


the key to removing lag is the wait command - but only if used correctly - too much waits will slow the game down because it is waiting, too few waits will slow the game down because it has too much to work each frame.
 

Indsh

Veteran
Veteran
Joined
Oct 11, 2015
Messages
225
Reaction score
65
First Language
English
Primarily Uses
N/A
@Andar Another interesting point, what is your go to wait amount. I usually go for 3 frames but do you think 1 is optimum?
 
Last edited by a moderator:

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,268
Reaction score
1,423
First Language
English
Primarily Uses
RMXP
@Andar Another interesting point, what is your go to wait amount. I usually go for 3 frames but do you think 1 is optimum?
Depends on the purpose of the parallel process. Some can have longer waits than other without being noticeable.
 

Indsh

Veteran
Veteran
Joined
Oct 11, 2015
Messages
225
Reaction score
65
First Language
English
Primarily Uses
N/A
@Zeriab but would you ever use 1 frame, I'm interested in the lowest that people use and still see an efficiency effect.
 

Zeriab

Huggins!
Veteran
Joined
Mar 20, 2012
Messages
1,268
Reaction score
1,423
First Language
English
Primarily Uses
RMXP
I would test it out. I did use 1 frame waits in RMXP for a parallel process handling input.


Try having a number of parallel events simply adding 1 to a variable. Test with different amount of waits.


Use that to get a better feeling for the actual effects of the wait.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,370
Reaction score
7,678
First Language
German
Primarily Uses
RMMV
There is no "perfect" wait, that was the point of my post. It depends on the specific reason for the parallel process - some PPs need less wait than others while other event need more waits


Each parallel process needs the wait number that is the maximum not detectable by the player.


That is because the lag of parallel processes is additive if they run at the same time.


I'll give you two different examples:


1) a line of death region IDs


You'll need a parallel process checking if the player stands on a certain line of tiles (defined by region ID or whatever) because the actor should die if that happens.


In such cases you'll need to set the number of wait frames low because a too high wait has the risk of the player running through it during the wait (which disables the check)


a wait(2) or wait(3) would be correct here, depending on the speed settings of that map


2) a door should open if the player comes near it


In such a case it doesn't matter if there is a slight delay before the door event changes pages, so the wait for that parallel process can easily be 30 frames (which is half a second)


Simply because it doesn't matter if the change of the event is delayed by a maximum of half a second depending on which frame the player enters the area.


Thos are primitive examples - the more complex an event is, the more critical are experiments to find the best compromise for that specific event.
 

Indsh

Veteran
Veteran
Joined
Oct 11, 2015
Messages
225
Reaction score
65
First Language
English
Primarily Uses
N/A
@Zeriab I haven't done that since RM2K where I seem to find no advantage under 3 frames, it's probably worth some experimenting time on MV.


Things are coming along leep's and bounds on my project, hopefully some other people can get some use from this thread.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,231
Members
137,607
Latest member
Maddo
Top