Lag in RMVXAce - how to deal

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
Hello,

  So i am investing some time in my project that uses 640x480 res, HF graphics and a lot of scripts (90+) working without any bugs.

  I am also using an anti lag script, but even with this i am noticing some lag while the character walks even in medium sized maps, and without any fog or weather effect. This may be due to my computer getting old (it's not  a real bad config for RMVX Ace, as it has 6GB ram, quad core and a Geforce GT230M), but also because RMVX Ace doesn't handle a lot of scripts very well?

  I know the best way to test this is by giving my project to some friends, so they can test it in a variety of different computer specs. But in this thread i want to know if any of you already had problems with lag in RMVX ace, and how did you deal with it? I am continuing with my project and i will release a solid and long demo (~02 gameplay hours) of it for some of my friends in maybe 02 months to test it out, but i am beggining to get a bit worried with the current lag i am getting while playtesting.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
it depends on the scripts... if the scripts only run during a certain time like on menus and such, there should not be a lag effect when ur walking...

lag normally comes from so many events/scripts running on the map... getting somebody else to test the map and see if it lags on them is a nice idea...
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
It is more likely that you have parallel process events that are always running (either map events or common events) and don't have a Wait command to come up for air between iterations. The number of events you have on a map can be a factor. Setting events to parallel process just for animation purposes or adding move routes just for animation, when simply checking the Stepping Anim box would do the trick, also contributes to lag. The number of scripts shouldn't be an issue - WHAT the scripts are, how often they're running, and how well they work together are more important considerations.


In other words, chances are it's just as likely the way you've created your game, as it is your computer or the scripts you use. In fact, it's probably MORE likely to be the way you've done things (just based on the common mistakes people make when they have lag issues).


You mustn't have searched before you asked, because there are a number of threads already discussing common causes of lag in Ace games, along with suggestions to avoid it.
 
Last edited by a moderator:

Espon

Lazy Creator
Veteran
Joined
Mar 20, 2012
Messages
1,810
Reaction score
192
First Language
Gibberish
Primarily Uses
RMMV
If you're using too many scripts there can be slowdown, especially if they're incompatible with each other.  You should see what scripts you actually need and what you don't.  You might not see any bugs but there could be things going on internally that's causing lag.

A lot of lag comes from how you design your maps.  If the map is too big you would probably start to notice a bit of a drop.  It's better to split it up into smaller regions.  I try not to go over 150x150.  Another big one is having too many events.  Even if an event does nothing, it will still cause lag.
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
Thanks for the answer so far guys. Actually i did search for topics about lags, but it was a few weeks ago (rsrsrs) and just today my concern raised more  B) .

I am avoiding too many events in my maps, and also parallel or common events (i only have 02 commom events running into parallel process, but i will try to add a small wait at the end of them). I am pretty sure based on your answers and my experience from watching the lag grows, that the 02 best hypotheses in my case are:

1) lag from scripts or internal interferences between them: in this case i will try to get rid of some scripts before i finish my demo, and see if if i get any results.

2) My own computer: it's an old laptop after all (06 years oh my  :o ), and i am noticing that apart from it's configuration to play RMVXace, it's having some intermitent issues and slowdowns.

  PS: Here's a small sample of a battle in my current project, but a lot of changes are happening, so i will not announce it yet in the project development forum. In this case some lag happened because of the video recorder, as the battles are running at 60 fps during my playtests.

  http://www.youtube.com/watch?v=APdGscsEcFk
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Here are some things to consider ...


DOES lag ever happen during battles?


Is it only on one map, several maps, or all maps?


Does it ALWAYS lag on the same map(s), or does it start off okay and then start to lag after you reach a certain point in the game?


What's in your events that are set to parallel process (even those that have no event commands)? Are they trying to do a whole LOT of stuff each time, or are they really short ones?
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
Here are some things to consider ...

DOES lag ever happen during battles?

Is it only on one map, several maps, or all maps?

Does it ALWAYS lag on the same map(s), or does it start off okay and then start to lag after you reach a certain point in the game?

What's in your events that are set to parallel process (even those that have no event commands)? Are they trying to do a whole LOT of stuff each time, or are they really short ones?
  I am renewing some graphics with 08 frames and running poses, and also eventing busts in my project right now (it's somewhat unplayable until i finish it, at least to do some complete checks), but those are really good questions that i already noted and will carefully test as soon as i finish these tasks  :) .

  The only questions i can 100% assure right now are:

3) The lag doesn't increase during gameplay time. I know there are some scripts specific for this kind of issue, but hopefully this is not my case.

4) My commom parallel events are really short ones, mostly to check key presses, but they had no wait command at the end of them.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
If they have loops, you also need a wait command within the loop, otherwise it may never GET to the wait at the end.
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
Good tip hehe, i just wish i could test all your questions now.

PS: here's the link to my sample, i forgot to add it before:  http://www.youtube.com/watch?v=APdGscsEcFk

       Thanks a lot, i am really happy with all the advices.
 
Last edited by a moderator:

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
31,355
Reaction score
7,669
First Language
German
Primarily Uses
RMMV
4) My commom parallel events are really short ones, mostly to check key presses, but they had no wait command at the end of them.
For lag, it doesn't matter how long the events are, it depends on how they're written and what they do.
Once (several month ago) I wrote an event to test a function, and that single 3-command-event alone made the test project (single sample map, 1 script only, one event added only) unplayable.


OK, I expected that (I was testing for lag) - but that should show you that you can't make general arguments where the lag comes from.


Instead of a general lag due to a mass of events (which would need several hundred events on the map in most cases) it's more often a single poorly written looping event that causes the lag.


And the shortest events might create the biggest lag - it all depends on what they do and how they do it. Especially if you have looping events checking for key pressed...
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
yeah... but better put waits there... I did that same error last day, I had a button checker with no waits, and it actually stopped my game from running... 

so far I tried up to a 6 frame wait and it still captures the keypresses correctly... :)
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
yeah... but better put waits there... I did that same error last day, I had a button checker with no waits, and it actually stopped my game from running... 

so far I tried up to a 6 frame wait and it still captures the keypresses correctly... :)
That was going to be my last question, the number of frames that better suits an event of this type. Nice to know that 0,1s is more than enough to capture key presses.

TOmorow at night i will be at home, after some days at work outside my city. I am realy anxious to test all the tips i learned here.
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
  Sry for the delay in my reply, i thought this topic was closed for whatever reason.

  I followed all the tips here, and even in maps with few events and no parallel process, the lag continues. And i did notice a very weird behaviour that i didn't see a topic about: intermitent lags in the map scene.

  When i am testing my games (In window or fullscreen), my fps stays between 40-55 for 05-10 seconds...then it drops to 10-25 fps for 05-10 seconds...and it keeps cycling. It happens on all my maps, and the effect of lag drop is increased when i run around the maps. It didn't happen in my first days of project when i had no scripts.

  As i use a lot of scripts, i made a copy of my project and i begun to delete one by one. I found that by retrieving KMS cursor animation the overall fps increase a bit, but the spikes of lag continues and i am starting to run out of options . I also use 640x480 by using the command Graphics.resize_screen(640 , 480) at main.

 My question is if someone already saw this weird behaviour of FPS coming back and forth, and if the cause was truly related to scripts (individually or conflicting with another one).

  Thanks again in advance.

Edit: If someone experienced with ruby is interested, i can pass my Scripts.rvdata2 file through PM.
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
If you find that removing one of your scripts only improves the FPS a little bit, then keep removing things until the FPS is truly fine.

Sometimes too many scripts affecting the same Scene can cause FPS lag, but most of the time one script causes all of the lag. In your case it's the first. If any other script is causing lag too, so you remove it, and allows the previously removed one to stay implemented perfectly, then it's the latter.

One hint is looking for scripts that update things every frame(s).  Too much can easily cause lag.

Like for example, I once had two scripts referring to HP bars in battle. Removing #1 only slightly increased my FPS, but removing #2 while keeping #1 fully fixed my FPS (and allowed me to keep script #1)
 
Last edited by a moderator:

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
Yeah, it's really a matter of trial and error, although i am focusing on scripts that updates the map scene, ad it's the only lagging scene.

In your example, the lag only occurred in battle right, as both scripts were modifying only the battle scene?
 
Last edited by a moderator:

kerbonklin

Hiatus King
Veteran
Joined
Jan 6, 2013
Messages
1,726
Reaction score
275
First Language
English
Primarily Uses
RMMV
Yep it was a scene_battle issue in my example, or I think it was just a window related to the scene.

Use the power of Shift+Ctrl+F to find your answer. (probably looking for "update" or "refresh")
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Are you SURE the scripts are at fault? What common events do you have that are set to parallel process? If the lag happens on ALL maps, that is the first place I'd be looking.
 

Nosleinad

Storyteller
Veteran
Joined
Dec 12, 2012
Messages
351
Reaction score
29
First Language
Portuguese
Primarily Uses
Unfortunatelly i am sure. I use only 02 commom events set to parallel process, and both have a wait of 06 frames at their end and just check one key press OR a switch change. I deleted them and tested, and it didnt change a thing.

I also use 640x480 res, 08 frames walking, diagonal and running spritesheets. I deleted some scripts that helped alleviate the problem, but i still got those weird pikes. I am about to delete all the scripts but the multi frames and character control (running) and play it, and i will edit this message with the results.

Edit: I removed almost every script i had in a copy of my project. I just left the proximity (Vlue) and chase (Victor) ones, and also the ones from victor that allows for multiframe, running and diagonal sprite movement.

        With my previous mog hunter anti-lag, i got a solid 45-50 fps, and without it 30-45 fps.

        I never thought scripts could lag so bad or even generate lag spikes that cycles from time to time. Now i think the best strategy for me is to keep finishing my demo and make a small and reserved test group FOR NOW, as my laptop is a bit old. If things still go bad, i will make the opposite...i will add scripts one by one in this copy of my project and see what i can achieve.
 
Last edited by a moderator:

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,853
Messages
1,016,986
Members
137,561
Latest member
visploo100
Top