Lag reduction script

[Open Assets] Lag reduction script 3a

This content may be freely modified and/or maintained by anyone.

pastel

‫‬‭‮‪‫‬‭‮
Katmint submitted a new resource:

Lag reduction script for maps - will not reduce lag from character mods

This lua script reduces lag from maps significantly by deactivating all objects on spawn and only activating them while they're within a certain radius of any player. Objects activated by proximity will deactive a few seconds after the player leaves the radius.

Use the perfstats 2 and ps_samplesize 175 console commands to compare map performance.

Technically works in multiplayer but will have diminishing returns based on player count. Will probably actually...

Read more about this resource...
 
I'm sure this'll change upon changing the distance value in the script but I've apparently stumbled upon the fact that Fang just doesn't leave at the default distance value. My guy just goes down and stays down and ACZ3 can't progress. Which kinda feels weird since I could have sworn I've beat Fang with this script before today, but I made sure I singled in on it when testing which addons caused that and it's definitely this one.
 
I'm sure this'll change upon changing the distance value in the script but I've apparently stumbled upon the fact that Fang just doesn't leave at the default distance value. My guy just goes down and stays down and ACZ3 can't progress. Which kinda feels weird since I could have sworn I've beat Fang with this script before today, but I made sure I singled in on it when testing which addons caused that and it's definitely this one.
I'll probably just exempt bosses from the script entirely when I update it. It's not like they're a problem outside of "I put 500 eggmobiles in this room :twisted:" in which case frame drops were likely part of the intended experience anyways.
 
I'll probably just exempt bosses from the script entirely when I update it. It's not like they're a problem outside of "I put 500 eggmobiles in this room :twisted:" in which case frame drops were likely part of the intended experience anyways.
Fair enough! Especially since another boss is affected in the form of Egg Colosseum, although the pinch phase actually forcing you to run around to go catch Eggman since he stops moving if he actually gets to the other side away from you and starts stalling you out is actually genuinely hilarious, it's probably unintentional behavior as well.
 
I ask that you add this lag reduction script to your addon, to reduce lag by even more; this is from my fully re-usable level pack:
please also add this SOC to your mod, in .lua form:
Code:
State S_PUMA_START1
Var2 = 0

State S_PUMA_UP1
Var2 = 0

State S_PUMA_UP2
Var2 = 0

State S_PUMA_UP3
Var2 = 0

State S_PUMA_DOWN1
Var2 = 0

State S_PUMA_DOWN2
Var2 = 0

State S_PUMA_DOWN3
Var2 = 0
this'll prevent the game from spawning many scenery objects, which'll prevent a bit of lag in some levels(or alotta lag in my lvl pack)
you may opt to not modify S_LAVAFALL_TELL, which'll cause lavafalls to still spawn scenery rocks before they spawn lava
 

Attachments

  • cutcorners.lua
    3.6 KB · Views: 244
I forgot about this mod! Having lag reduced like this is such a godsend!
I actually downloaded the first version and found a bug, but forgot to report it out of nowhere. Now that it was updated, I booted up the game to see if it was a freak accident or not, but turns out it's not.
In Castle Eggman Zone Act 2, everything is as normal except for... Some spike balls on chains, or the end-level chains you're supposed to take to finish the level.
Every other ball chain or grabbable chain works as intended however, so I can't help but wonder why these specifically are borked? Maybe the game treats them as different objects?
srb20013.gif

srb20014.gif
 
Like the above, I've noticed some oddities in CEZ 1 and 2...mostly just the pop up spikes, never pop up (or down) staying in their default state (The bridge at the end of Act one also has this issue, but i forgot to make a gif)

srb20082.gif
 
So I just tried using this script and didn't notice a difference. It should be noted that I was trying it on Speed Highway (a map I've always had insane difficulty with regarding lag). Am I supposed to activate it like an ordinary add-ons, or is it meant to be inserted in map luas, or what? I suppose the problem might be that my laptop is too crummy for the script to have much effect, but I thought I'd ask
 
So I just tried using this script and didn't notice a difference. It should be noted that I was trying it on Speed Highway (a map I've always had insane difficulty with regarding lag). Am I supposed to activate it like an ordinary add-ons, or is it meant to be inserted in map luas, or what? I suppose the problem might be that my laptop is too crummy for the script to have much effect, but I thought I'd ask
i was having this issue too but try switching to software rendering it helped me
also i would like to thank this mod thanks to it im actually getting around 45 - 30 fps now
without this mod im usally around 20 - 30 fps
 
pastel updated Lag reduction script for maps with a new update entry:

this got featured so i guess i should actually maintain it

  • fixed CEZ chain rollercoaster
  • fixed retractable spikes
  • even better script optimisation than before
  • fixed lua warning in 2.2.14
note: there are now two versions! lagkiller v3 has an increased radius that mobjs are allowed to move, and also features working retractable spikes

on the other hand lagkiller v3 STRICT uses the same radius as before, and keeps retractable spikes frozen because they still can still cause a significant performance impact in maps like CEZ2...

Read the rest of this update entry...
 
Nice work and fix on the new lag script! Glad to see you gave this little guy some love ive been watching this for awhile and forced me to tinker with it to not load on certain maps due to its issues...*cough* ECZ2 and some other maps but I still have some issues....

First..... the obvious, ALMOST everything has been fixed from the previous v2 lag script, I use this for every map pack I like which it works almost flawlessly except for a couple of things which I don't think is map pack exclusive and more the object itself. NOTE- the same object


So the retractable spikes found in a couple stages not just ECZ1, ECZ2 but ACZ1 and ACZ2 as well. The issue is still there ;-;

there are some other honorable mentions to the list. Just wanted to be sure that when I wrote the review I listed everything. which surprisingly isn't much. Obviously not all mods will be compatible with certain things but they're very small things that is used frequently in the base game and mods so probably easy to fix on your end.


everything listed below happens in mods and base game. I will attach GIFs as well. I played the base game with no addons loaded

So when the TNT barrels exploded in v2 it was a fireworks show of broken graphics. it has been improved so much with v3 but still shows up here and there.


The gargoyle statues that are push-able used to always teleport after pushing them a little bit in v2 with the off chance of it instant transmissioning above your head and killing you. Now with new and improved v3 it only happnes RARELY which it happened to me maybe twice without recording and I cant get it to show anymore but I would look into it. what I think it is isnt the gargoyle im pretty sure its the MF_PUSHABLE flag because this happens with anything that youre able to move


The fire that shoots out the ground in sonic 06 (all levels with it) they shoot diagonally (didnt look into the issue I just looked cooler dodging them...lol) but this happens with any level that utilizes that object which is seen quite a bit not just sonic 06.

Enemy pop in, im assuming this cant be fixed but ill list it just because :P the enemies sometimes don't spawn in time and they end up popping in on you or falling from the heavens, doesnt happen all the time at every stage but if you're moving fast enough it does happen once in awhile. it can be overlooked but thought id just mention it.

Overall the update you gave is soo much better and works really well only issue I still have is the retractable spikes working then honestly I can overlook the rest that I mentioned, if thats fixed this should be for anyone by default using mods as most mods add some kind of lag. Love it and I always use this, thanks for this life saver!
 

Attachments

  • srb20000.gif
    4.2 MB · Views: 160
  • srb20002.gif
    2.2 MB · Views: 145
  • srb20003.gif
    3.9 MB · Views: 122
  • srb20006.gif
    2.3 MB · Views: 131
  • srb20007.gif
    11.8 MB · Views: 113

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top