Author Topic: [XP] Anti Event Lag Script - Revised  (Read 6757 times)

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 727
  • LV: 29
    • View Profile
[XP] Anti Event Lag Script - Revised
« on: August 21, 2012, 02:44:00 PM »
Anti Event Lag
Authors: Heretic, Near Fantastica
Version: 4
Type: Game Utility
Key Term: Game Utility

Introduction

Original Version was by Near Fantastica, but it had some truly fatal problems that prevented this script from living up to its full potential.  This is a Revision of their script to take care of those issues.

Features

  • Gives your game a higher framerate in the Game Map
  • Simple to use
  • Very useful if you are like me and use Events for Tileset Graphics to add an additional Layer
  • Does not require SDK or other extravagant techniques to get working, like Zeriabs.

Screenshots

How do you take a Screenshot of Lag?

Demo

http://www.775.net/~heretic/downloads/rmxp/AntiLag.exe

Press the F2 key on your Keyboard while Windowed (not fullscreen) to see your Framerate.  40FPS is Optimal.

Script

Put between Scene_Debug and Main.

(click to show/hide)


Compatibility

This Section is VERY Important!

This script OVERWRITES UPDATE for the Game_Map and Spriteset_Map classes.  It will NOT be compatible with ANY script that also completely OVERWRITES those classes.  It may be possible to easily merge this script with the other script as there is only one section of code that would need to be grabbed.

If you have a script that ALIASES the UPDATE method for either Game_Map or Spriteset_Map, place those scripts BELOW this one.

Credits and Thanks

  • Near Fantastica - Original Author

Author's Notes

Near Fantasticas original version of this script had some terribly fatal problems, which have been fixed.  Good idea, but poor execution.

The way this script works is that if an event is off screen and too far away from the Player, it stops moving around, or "updated".  That is ultimately what causes you to have Lag when you have lots and lots of Events.

#1  Events with Multiple Event Pages were not updated correctly due to excluded code.  When Game Switches are changed, those events will now change correctly.

#2  Events that moved Off Screen (during Cutscenes) would not update.  I've taken care of this so if you use Set Move Route, those Events will run correctly.

#3  Events with Autonomous Movement can also be set to always move around correctly with a Naming Parameter.  Simply add "\al_update" to the Events name and it will move around regardless if the Event is too far away from the player.  This is useful for NPC's or Wildlife, things that a Player would expect to move.

#4  Events with VERY Large Sprites were not working correctly.  The Graphic "188-Wagon01" is so large that when the Event is off screen, part of the Sprite would actually get stuck on screen.  I tweaked the calculations so that Very Large Sprites wont stick around any more.

There isn't actually a whole heck of a lot of code in the UPDATE methods.  If you run into another script that this one causes conflicts with, the small sections of code should actually be moderately easy to merge this script with other scripts, of course, depending on the complexity of the other scripts.

If you are new to scripting, I'd suggest taking a quick look at the original UPDATE methods in Game_Map and Spriteset_Map, and see what parts of the UPDATE method was changed in both classes.  If you see that same spot of code from the Default Scripts in the other script you are trying to merge with, you might be able to just overwrite that small section.  It does help you to become a better scripter, and should also help you to increase the compatability of this script with other scripts.  I'll try to lend a hand if you need it.  Of course, this is really only if you do run into a Script Incompatability.

Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19906
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Anti Event Lag Script - Revised
« Reply #1 on: August 21, 2012, 05:54:42 PM »
I remember this old script. Blizz-ABSEAL 3 still beats it though. xD *moves into database*
« Last Edit: August 21, 2012, 05:56:01 PM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 727
  • LV: 29
    • View Profile
Re: [XP] Anti Event Lag Script - Revised
« Reply #2 on: August 21, 2012, 09:53:13 PM »
I never even looked at that because I think the name didnt imply that it was Anti Lag...
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19906
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Anti Event Lag Script - Revised
« Reply #3 on: August 21, 2012, 10:01:47 PM »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Heretic86

  • Astral Trancist
  • *****
  • Posts: 727
  • LV: 29
    • View Profile
Re: [XP] Anti Event Lag Script - Revised
« Reply #4 on: August 22, 2012, 12:33:50 AM »
So thats what it stands for?  I never would have figured it out.  Your script is probably more kick ass than this one, but the name is what I never caught.  Maybe change the title to just say "(Anti Lag)" just for a tad of clarification.  I always read it as "abSEAL" like it was "sealing" something...
« Last Edit: August 22, 2012, 05:54:40 AM by Heretic86 »
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19906
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Anti Event Lag Script - Revised
« Reply #5 on: August 22, 2012, 03:42:56 PM »
Good thinking. *fixes*
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.