[XP] Blizz-ABS Event Anti-Lag

Started by Blizzard, January 09, 2008, 08:30:06 am

Previous topic - Next topic

Blizzard

January 09, 2008, 08:30:06 am Last Edit: October 07, 2021, 10:36:55 am by Blizzard
Blizz-ABS Event Anti-Lag
Authors: Blizzard
Version: 3.3
Type: Performance Improving System
Key Term: Game Utility

Introduction

This script will decrease the lag caused by events on the map by disabling the update of events beyond the visible screen when their sprite is not visible on the screen anymore. All graphical sprites for events are substituted with a controller that handles those sprites. If an event's update is disabled, the event's sprite will be disposed and completely removed from the memory. "Auto-Start" and "Parallel Process" events are NOT affected by this script. If a character is moving outside of the screen, he will be updated as event, but not as sprite.

This work is licensed under BSD License 2.0:
QuoteCopyright (c) Boris "Blizzard" Mikić
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1.  Redistributions of source code must retain the above copyright notice,
    this list of conditions and the following disclaimer.

2.  Redistributions in binary form must reproduce the above copyright notice,
    this list of conditions and the following disclaimer in the documentation
    and/or other materials provided with the distribution.

3.  Neither the name of the copyright holder nor the names of its contributors
    may be used to endorse or promote products derived from this software
    without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

You may use this script for both non-commercial and commercial products without limitations as long as you fulfill the conditions presented by the above license. The "complete" way to give credit is to include the license somewhere in your product (e.g. in the credits screen), but a "simple" way is also acceptable. The "simple" way to give credit is as follows:
QuoteBlizz-ABS Event Anti-Lag (ABSEAL) licensed under BSD License 2.0, Copyright (c) Boris "Blizzard" Mikić

Alternatively, if your font doesn't support diacritic characters, you may use this variant:
QuoteBlizz-ABS Event Anti-Lag (ABSEAL) licensed under BSD License 2.0, Copyright (c) Boris "Blizzard" Mikic

In general other similar variants are allowed as long as it is clear who the creator is (e.g. "ABSEAL created by Blizzard" is acceptable). But if possible, prefer to use one of the two variants listed above.

If you fail to give credit and/or claim that this work was created by you, this may result in legal action and/or payment of damages even though this work is free of charge to use normally.


Features

In comparison to other scripts:
  • much more compatible
  • faster and better processing
  • about 5 times less code
  • built-in option to disable in specific maps
  • maximum possible performance
v2.0
  • an incredible performance improvement was achieved through a new system
v3.0
  • increased performance improvement to the highest possible level
  • new smart system: no need to configure the strength anymore
v3.0b
  • disallows the usage of this script if Blizz-ABS is already installed
  • now beta
v3.1
  • added possibility to disable Blizz-ABSEAL on certain events
v3.2
  • added EXTEND_TILES option
v3.3
  • added new license
  • added usage and crediting instructions


Screenshots

N/A for this sort of script.

Demo

Blizz-ABSEAL Demo

Script

Just make a new script above main and paste this code into it.
Script Download

Instructions

Inside the script in the first comment.

Compatibility

99% compatible with SDK v1.x. 80% compatible with SDK v2.x. Can cause incompatibility issues with map graphic manipulating scripts. This script comes UNDER all scripts that manipulate the Sprite_Character class. Can cause problems with Scripts that manipulate instances of the Sprite_Character class from the "outside".

Credits and Thanks

  • Boris "Blizzard" Mikić
  • Special Thanks to Zeriab for making me post this before the release of Tons of Add-ons v5.x.

Author's Notes

This EAL is a simplified version of Blizz-ABS's original EAL. If you are using Blizz-ABS, please remove this script. Blizz-ABS has the full version of Blizz-ABSEAL built-in.

If you find any bugs, please report them here:
http://forum.chaos-project.com

That's it! N-Joy! =D
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

Blizzard

May 09, 2008, 12:26:23 pm #1 Last Edit: July 14, 2008, 09:46:29 am by Blizzard
Blizz-ABS 3.0 is up. :3

Blizz-ABSEAL 3.0b is up. >.<

MORE POWERFUL THAN EVER
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

Fantasist

I made a script to play animations over events on the map. It's not working with the sprite control of Blizz-ABSEAL. Sprite_Character#loop_animation isn't available b/c Sprite_Character is no longer an RPG::Sprite. If I comment the sprite control part in Blizz-ABSEAL, it works fine. I'm using version 3.0b. Any suggestions?

class Spriteset_Map
 
  def animate(id=0, anim_id=98)
    if id > 0
     @character_sprites.each {|sprite_character|
      if sprite_character.character.id == id
        sprite_character.loop_anim=anim_id
      end}
    else
      @character_sprites.each {|sprite_character|
      if sprite_character.character.is_a?(Game_Player)
        sprite_character.loop_anim=anim_id
      end}
    end
  end
 
end

class Sprite_Character
 
  def loop_anim=(id=nil)
    anim = id ? $data_animations[id] : nil
    loop_animation(anim)
  end
 
end

class Scene_Map
  attr_reader :spriteset
end



PS: First (non-author) post, yay ^_^'
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

You can put it in Control_Sprite_Character for Blizz-ABSEAL to work. Just check out the code of the script, it's not complicated.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

Fantasist

By 'it', you mean the code for loop_animation from RPG::Sprite? Or do you mean this:
def loop_anim=(id=nil)
    anim = id ? $data_animations[id] : nil
    loop_animation(anim)
  end


Or God forbid, do you mean Ulta XD
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

December 11, 2008, 07:09:53 am #5 Last Edit: December 11, 2008, 07:12:44 am by Blizzard
Add this additionally below Blizz-ABSEAL:

class Control_Sprite_Character
 
  def loop_anim=(id=nil)
    @sprite.loop_anim = id if @sprite != nil
  end
 
end


Your own code goes above Blizz-ABSEAL.

Also, instead of "if sprite_character.character.is_a?(Game_Player)" better use "if sprite_character.character == $game_player". This would make it better working with Blizz-ABS even though Blizz-ABS actually has loop animations implemented "character.loop_animation_id = ID". >.<
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

Fantasist

Thanks Bliz, that solved the problem :)

QuoteAlso, instead of "if sprite_character.character.is_a?(Game_Player)" better use "if sprite_character.character == $game_player". This would make it better working with Blizz-ABS even though Blizz-ABS actually has loop animations implemented "character.loop_animation_id = ID". >.<


I'll do that. I wanted to implement the "character.loop_animation_id" thing, but I figured it's not necessary. btw, it's not for the BABS game, it's for QC :P
Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Blizzard

It should, there is no reason that it doesn't.
It might not work properly with Mode 7, but it might work out if you change the the order of your scripts.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

Apidcloud

Gratz for the script lool xD
I really heard good comments about it already =)

Also, the demo that you posted works really well eheheh

Btw, once, a friend of mine said that if the event name was 'noupdate' it wouldn't be updated or something...Know anything about this?
Thanks and congratz once more =)
Instead of wanting to be somebody else, rather become somebody else



"I will treasure the knowledge like a squirrel treasures acorns."


Gibbo Glast 2D Engine - The sky is no longer a limit

Magus

Blizz abseal doesn't really work right for 2.8 O_O. I have to manually use script calls to disable and enable blizzabs ._. For maps and what not
LEVEL ME DOWN. THE ANTI-BLIZZ GROUP IS AMONG YOU... Do it for the chick below...She watches..<br />

Blizzard

You don't use this script if you are using Blizz-ABS.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

Apidcloud

Quote from: Blizzard on January 09, 2008, 08:30:06 am
This EAL is a simplified version of Blizz-ABS's original EAL. If you are using Blizz-ABS, please remove this script. Blizz-ABS has the full version of Blizz-ABSEAL built-in.

Quote from: Magus on August 22, 2011, 01:01:58 pm
Blizz abseal doesn't really work right for 2.8 O_O. I have to manually use script calls to disable and enable blizzabs ._. For maps and what not


*Points to epicness*

Instead of wanting to be somebody else, rather become somebody else



"I will treasure the knowledge like a squirrel treasures acorns."


Gibbo Glast 2D Engine - The sky is no longer a limit

Magus

No, I'm talking about the Blizz-abseal that's built into Blizz-abs.  It's not working right for some reason, but I've gotten used to disabling and enabling things manually.
LEVEL ME DOWN. THE ANTI-BLIZZ GROUP IS AMONG YOU... Do it for the chick below...She watches..<br />

Blizzard

IDK, you should post that in the Blizz-ABS thread then so winkio can take a look at it. This thread is for the separate Blizz-ABSEAL script, unrelated to Blizz-ABS.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

Magus

Ok.  I'll just copy and paste a few points from here.
LEVEL ME DOWN. THE ANTI-BLIZZ GROUP IS AMONG YOU... Do it for the chick below...She watches..<br />

Poe

maybe i'm doing something wrong here... i'm having some trouble understanding this bit:

QuoteIf a character is moving outside of the screen, he will be updated as event, but not as sprite.


so events outside of screen are supposed to still get their movement code updated? because i tried that and the event stays at the same location until i move into range (unless i set it to parallel process, but that kinda defies the point).

ForeverZer0

Do you have AUTO_KILL set to false?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Poe

i've tried both false and true, same behavior, the event only starts moving when the player moves into visual range.

i put it in a completely fresh project because i thought it might be caused by a pathfinding script but the same thing happens (or doesn't happen).

LiTTleDRAgo

December 06, 2011, 11:59:17 pm #18 Last Edit: December 07, 2011, 10:21:24 am by LiTTleDRAgo
try remove this part

Quote
  alias upd_player_abseal_later update
  def update
    upd_player_abseal_later if self.update? || self.moving?
  end



that part of code is too evil

ForeverZer0

Umm... I think deleting that part effectively makes the script do absolutely nothing. The whole point is to catch the update method, and stop it from working if its not needed. By removing that part, it will just behave normally, and the script becomes just a bunch of worthless text in the editor.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.