Lava Rising lag problems

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

MystF

Member
Mar 2, 2024
2
0
1
19
Server Features:

• Processor: Intel(R) Xeon(R) Platinum 8358P CPU @ 2.60GHz (2 processors)
• Memory: 12GB

Problem:
I have a server where lava is rising. Using a script, I fill a 120x120 square area with lava every 5 seconds. The flow of lava, burning fire, and interaction of lava with water are turned off for performance reasons. However, some lag and ping issues occur on the server when players engage in PvP or fly with an elytra during the lava rising. The script I'm using is as follows. According to some sources, it's a mistake to do this with a script, and they suggest using a plugin instead. Do you think that's the case? Almost my entire server operates with scripts, and these lags only occur during the lava rising. Can I solve my problem without using a plugin?

Some of the support I've received says, "One of the biggest mistakes you can make is setting up a script-based server." I don't believe in that.

I'm looking for suggestions on how to solve my problem for better performance.

The script code I use for lava:

Code:
if {y} is 320:
    set {game.state} to "5"
    stop
loop blocks within location({x}+60, {y}, {z}+60, world("world")) and location({x}-60, {y}, {z}-60, world("world")):
    loop-block is air or water
    set loop-block to lava               
add 1 to {y}
set {bossbar.time} to {Y}
stop


Timings report during lava rising:
 
Hello!

In my opinion, those people are correct. Often, skript-based servers--even quite powerful or popular ones--end up calling a lot of unnecessary events, being hard to optimize, overworking for a feature that can be added in about 4 clicks with a plugin, and having performance issues.

If you do want to fix your problem without installing a plugin, you can try:
  • Making the radius of the lava rise smaller
  • Instead of looping the blocks and then setting them (which, afaik, will just cause more lag), store the locations in local variables and use "set blocks within"
  • Making it slower, which should give your server some time to recover before you call the lava rise again.
  • Splitting the lava region up into quadrants and only setting one at a time
If you truly are committed to creating and maintaining a skript-based server, I recommend you look into upgrading your server's specs, however, I still suggest you use plugins for something like this. While too many plugins can be bad for your server, yes, the same thing applies to too few plugins, or too many skripts.
 
Last edited:
Hello!

In my opinion, those people are correct. Often, skript-based servers--even quite powerful or popular ones--end up calling a lot of unnecessary events, being hard to optimize, overworking for a feature that can be added in about 4 clicks with a plugin, and having performance issues.

If you do want to fix your problem without installing a plugin, you can try:
  • Making the radius of the lava rise smaller
  • Instead of looping the blocks and then setting them (which, afaik, will just cause more lag), store the locations in local variables and use "set blocks within"
  • Making it slower, which should give your server some time to recover before you call the lava rise again.
  • Splitting the lava region up into quadrants and only setting one at a time
If you truly are committed to creating and maintaining a skript-based server, I recommend you look into upgrading your server's specs, however, I still suggest you use plugins for something like this. While too many plugins can be bad for your server, yes, the same thing applies to too few plugins, or too many skripts.
I will strengthen the system and try again. How can I make this command only turn the air into lava?

"set blocks within"
 
I will strengthen the system and try again. How can I make this command only turn the air into lava?

"set blocks within"
i think you can do something like
Code:
blocks within {_localvab1} and {_localvab2} = air:
    set blocks within {_localvab1} and {_localvab2} to lava
but don't quote me on that