Jump to content
TheoAllen

Theo - Insane Anti Lag (Version 1.1 added page check enhancer!)

Recommended Posts

Theo - Insane Anti Lag

For those who insane enough to put a lot of events on map

Version : 1.1

 

Introduction :
As most of you already know, lag is common problem in RPG Maker games. You may think it was because you have many events on map. And so, to avoid lag, you split your map into part and limiting the event as well. 
 
It's not entirely wrong because when you have a lot of events, program need to checks all events. However, it wasn't done efficienly. This script increase the efficiency on how default script works and prevent unecessary update when it's not needed to gain speed.

However, I can not guarantee that it will have high compatibility since I overwrite most of stuff. I will likely to make compatibility with my own scripts. But I'm not sure about someone's script.
 
Screenshot :
 
antilag03.jpg 

Features :

  • Optimize Event XY. Registered all events into table for faster collision detection using default 32 x 32 grid movement
  • Optimize Event Start. Registered any event that started to prevent check all event and see which is starting
  • Optimize Sprite. Prevent update character sprites located on far away
  • Insane - Table search. When you have insane number of events. It checked map table instead of iterating through all event. So, if you have 10.000 events you will have no worry about performance.
  • Insane - Sprite dispose. When the sprite is off screen, it disposed immediately to prevent performance loss.
  • Insane - Enhance page checking to prevent mini freeze when checking all event pages (*NEW)

Testing :
Tested using Core i3 @ 2.40 GHZ, 4GB of RAM, Windows 7 64-bit with no additional scripts, I got following results :

  • 150 x 150 map with 250 events. I got 60 FPS while no antilag I got 49 FPS at the minimum
  • 17 x 13 Full load of events. All events are on high frequency. I got 30 FPS while no antlag I got 10 FPS
  • 150 x 150 map with 10.000 events, all events are off screen. I got perfect 60 FPS while no antilag I got 1 FPS
  • 150 x 150 map with 10.000 events, and have around 190 events on screen, I got 55 FPS at the minimum. While no antilag, I got 0 FPS.

Limitation :

  • So far this will only works with default grid based movement, not intended to be used together with any pixel movement.
  • Using insane mode antilag will only works if events on screen is around 250 despite of the total events on map.
  • Using larger screen resolution may affect the performance as well

Download :

Click here

 

Final Note :
After all, these are just my attempt to speed up the game. Performance are still under influence by many factors. These include but may not limited to

  • Your CPU speed
  • Your laptop / PC temperature
  • How much power do you give for your CPU
  • Multi tasking
  • Someone's scripts

I once used RM in old computer. When I switched to more advanced laptop, I saw that 60 FPS is really smooth.

If your CPU seems overheat, turn off your laptop / PC for a while for cooling. My laptop was once overheat due to broken fan. When I played my own game I got 10 FPS. I made my own antilag and no one of them worked until I realized my laptop was overheat.

Power saver mode in laptop may affect performance. Try to go high performance instead and let see if the lag gone. Once my friend played my game using power saver mode, and he got 15 FPS.

If you have many programs running at same time, it may cause a little lag in RPG Maker games. Something like the screen won't be updated for a while.

Some scripts can affect performance if it's not done right. This antilag script is tested using default script without additional scripts which directly affect something on map.

 

For scripter, feel free to modify my script to be better and better. You can edit and repost in your own version as long as you credit me, as TheoAllen or Theolized RGSS3.
 
Special Thanks :

  • Tsukihime for performance analisyst
  • KilloZapit who helped me to brainstorm this concept
  • Galv

Share this post


Link to post
Share on other sites

If I am right, this can be used as antilag for heavy light effect too, right? since those are sprites...

Not sure, but if you're refering to my simple light effect, I realized when working on this script, it's badly designed. Really. But I dunno for another light effect

 

 

xD You told me to wait for this script. :3 now I don't need to wait!

Enjoyy... :3

Share this post


Link to post
Share on other sites

Theo, oh my gosh, you are always working to make more awesome things, aren't you?

 

Is this in direct response to the script someone is trying to sell for 20 dollars a pop?

Share this post


Link to post
Share on other sites

Theo, oh my gosh, you are always working to make more awesome things, aren't you?

 

Is this in direct response to the script someone is trying to sell for 20 dollars a pop?

No, not really true since most of my script are messing up with default script.

 

Lol, you can consider it.

However, please keep in mind that this open source script. Any scripter is free to modify. I'm not really happy with this work anyway. It means that I can't really provide full support regarding compatibility issues and such. But I will do some bugfix perhaps.

 

If you want to go full support, I'm afraid if you still need to use your 20 dollars.

Share this post


Link to post
Share on other sites

Hi there, lovely job, but here's coming a bug with using falcao' abs. Any tools' sprites are frozen in place on map. Nothing was modified in your script, only switching available "true/falses".

Share this post


Link to post
Share on other sites

Hi there, lovely job, but here's coming a bug with using falcao' abs. Any tools' sprites are frozen in place on map. Nothing was modified in your script, only switching available "true/falses".

 

I have my own alternative version you could try that may be more compatible, but it doesn't support maps with large amounts of events (200+) as well because I don't use Theo's "insane" optimization. It's probably better off for ABS and pixel movement scripts though, because it will optimize sprites with the events_xy optimization off and overwrites much less.

Edited by KilloZapit

Share this post


Link to post
Share on other sites

I'm getting this error as soon as i get past the title screen.

 

 

 

Any thoughts?

 

Awesome script BTW

 

-T

The very early version of RMVXAce didn't have move_animation in its Sprite_Character. It had been updated since the English version released in 2012

So, I guess, you have an old copy of RMVXAce. If you bough RMVXAce, I'm sure the official site allow you to redownload the latest version of RMVXAce

 

as for Falcao ABS, I will try that later if I have enough time.

Share this post


Link to post
Share on other sites

Someday, somehow, you must include pixel movement in this o;

Bitchin' looking script though~

Different script(er), different implementation.

I will not going to patch ALL avalaible pixel movement scripts. UNLESS default script itself has pixel movement.

Share this post


Link to post
Share on other sites

My alternate version should work better with pixel movement scripts (at least the sprites will be optimized better).

 

To be honest, there is just no way at all to make pixel movement fully compatible with Theo's anti-lag. True pixel movement totally rewrites how events work, and every pixel movement script does it differently. I think Theo's script could do with a bit of compatibility work (it still overwrites a lot of stuff even if optimizations are disabled) but I think it's unlikely to support pixel movement any time soon. The only reason my alternative version can better is I focus on optimizing sprites and don't optimize event updates so it's much slower over all but more compatible and may be faster when there are less then 200 events.

Share this post


Link to post
Share on other sites

quick question: If my computer's performance is causing lag, that would apply to all my games right? Or would it just be the ones with massive amounts of events? I am using the script and I still dip down to about 30 FPS, seen it go as high as 42 when I was in the ocean. I think I have more than 200, but less than 250 events on a map.

 

Or maybe it is the GIANT parallel process that is basically my game that is causing the lag, since comp has to check every single conditional branch?

Share this post


Link to post
Share on other sites

quick question: If my computer's performance is causing lag, that would apply to all my games right? Or would it just be the ones with massive amounts of events? I am using the script and I still dip down to about 30 FPS, seen it go as high as 42 when I was in the ocean. I think I have more than 200, but less than 250 events on a map.

 

Or maybe it is the GIANT parallel process that is basically my game that is causing the lag, since comp has to check every single conditional branch?

If it's your CPU performance yes, it would apply to all of your games.

 

A lot of parallel process may affect the performance as well. The main reason is because if you change switches / variables on the fly, it will check ALL events just to make sure each event has the proper page. Checking conditional branch is not the problem. I ever tried to run a game which as parallel process on 120 FPS and it worked well.

 

Most of lag problem caused by either the total of events or someone's script that done badly.

Share this post


Link to post
Share on other sites

Ahhhh I see, I didn't know how ingrained pixel movement is, yes that would be a rather lofty task, in that case o.o;

And thanks for the full explanation Killo ^_^ I gave your Alternative Anti-Lag a shot, with optimize_events_xy both on and off, but unfortunately I got errors. Probably just compatibility issues.
Reading further, I see I might just have to rework some things to get rid of the lag, if it isn't just my computer. I'm getting lag on a 27x31 map with only 8 events, and that just seems silly x_x

Share this post


Link to post
Share on other sites

Ahhhh I see, I didn't know how ingrained pixel movement is, yes that would be a rather lofty task, in that case o.o;

 

And thanks for the full explanation Killo ^_^ I gave your Alternative Anti-Lag a shot, with optimize_events_xy both on and off, but unfortunately I got errors. Probably just compatibility issues.

Reading further, I see I might just have to rework some things to get rid of the lag, if it isn't just my computer. I'm getting lag on a 27x31 map with only 8 events, and that just seems silly x_x

 

What kind of errors? You should try turning off the OPTIMIZE_STARTING_EVENTS as well. Also try moving it before and after the pixel movement script... that can effect compatibility too!

Edited by KilloZapit

Share this post


Link to post
Share on other sites

Little update. 

Just to avoid unexpected error 'undefined method spriteset for scene'

what about fix for pearl abs? Your antilag is only one's working  :(

Share this post


Link to post
Share on other sites

ivuAe9M.png

Update the script to version 1.0c

  • Compatibility with Shaz's Mouse Script. def events_xy now should always return array.
  • Avoid error 'undefined method delete_sprite for nilClass'

 

Little update. 

Just to avoid unexpected error 'undefined method spriteset for scene'

what about fix for pearl abs? Your antilag is only one's working  :(

 

I dont have enough will to see someone's script especially for the complex one.

So, I'm sorry.

Share this post


Link to post
Share on other sites

Just put this in a project and it solves some serious lag on spawning events using Eshra's script in conjunction with Yanfly's (which doesn't seem to work, even with a vanilla project, but has a nice grab tile from region function).

 

However for compatibility with who knows what it has to go last in the scripts. This seems to work for it and all other scripts with no breakage. Anyone having trouble might give it a try.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted