ID:159723
 
What is the best way to compress the world procs, like:
world
New()
..()
spawn(1)
REPOP()
World_Reboot()
proc
REPOP()
world.Repop()
World_Reboot()
world.Reboot()


What I'm trying to say here is how do I make it so it takes up less CPU usage or whatever it makes less lag if you have a lot of world proc, how would I compress them?

PS: I use a lot of world proc.
Gizhy wrote:
What is the best way to compress the world procs, like:
> world
> New()
> ..()
> spawn(1)
> REPOP()
> World_Reboot()
> proc
> REPOP()
> world.Repop()
> World_Reboot()
> world.Reboot()
>


lol you reboot the world in world/New()? And simply having the procs shouldn't cause any CPU usage at all. Running them, constantly, is what would use up CPU.
In response to Falacy
That was just an example. This is what my coding looks like.

world
version = 1
view = "15x11"
mob = /mob/Player
loop_checks = 0
New()
..()
spawn(1)
MOTD = "Message Of The Day"
REPOP()
MOTD_Load()
proc
REPOP()
set background = 1
for()
sleep(600)
world.Repop()
proc
MOTD_Save()
var/savefile/F = new("MOTD.sav")
F["MOTD"] << MOTD
MOTD_Load()
if(fexists("MOTD.sav"))
var/savefile/F = new("MOTD.sav")
F["MOTD"] >> MOTD
world
New()
..()
spawn(1)
DBALLS()
proc
DBALLS()
set background = 1
for()
for(var/obj/Dragonballs/D in world)
del(D)
world << "<B><font color=green>Server Info:</font><B> The Earth DragonBalls have been scattered!"
new /obj/Dragonballs/Earth_Dragonball_1(locate((rand(1,world.maxx)),(rand(1,world.maxy)),1))
new /obj/Dragonballs/Earth_Dragonball_2(locate((rand(1,world.maxx)),(rand(1,world.maxy)),1))
new /obj/Dragonballs/Earth_Dragonball_3(locate((rand(1,world.maxx)),(rand(1,world.maxy)),1))
new /obj/Dragonballs/Earth_Dragonball_4(locate((rand(1,world.maxx)),(rand(1,world.maxy)),1))
new /obj/Dragonballs/Earth_Dragonball_5(locate((rand(1,world.maxx)),(rand(1,world.maxy)),1))
new /obj/Dragonballs/Earth_Dragonball_6(locate((rand(1,world.maxx)),(rand(1,world.maxy)),1))
new /obj/Dragonballs/Earth_Dragonball_7(locate((rand(1,world.maxx)),(rand(1,world.maxy)),1))
for(var/obj/Namek_Dragonballs/D in world)
del(D)
world << "<B><font color=green>Server Info:</font><B> The Namekian DragonBalls have been scattered!"
new /obj/Namek_Dragonballs/Namek_Dragonball_1(locate((rand(1,world.maxx)),(rand(1,world.maxy)),2))
new /obj/Namek_Dragonballs/Namek_Dragonball_2(locate((rand(1,world.maxx)),(rand(1,world.maxy)),2))
new /obj/Namek_Dragonballs/Namek_Dragonball_3(locate((rand(1,world.maxx)),(rand(1,world.maxy)),2))
new /obj/Namek_Dragonballs/Namek_Dragonball_4(locate((rand(1,world.maxx)),(rand(1,world.maxy)),2))
new /obj/Namek_Dragonballs/Namek_Dragonball_5(locate((rand(1,world.maxx)),(rand(1,world.maxy)),2))
new /obj/Namek_Dragonballs/Namek_Dragonball_6(locate((rand(1,world.maxx)),(rand(1,world.maxy)),2))
new /obj/Namek_Dragonballs/Namek_Dragonball_7(locate((rand(1,world.maxx)),(rand(1,world.maxy)),2))
sleep(3000)
DBALLS()
world
New()
..()
spawn(1)
Time()
proc
Time()
set background = 1
sleep(10)
if(Seconds >= 60)
Minutes += 1
Seconds = 0
if(Minutes >= 60)
Hours += 1
Minutes = 0
if(Hours >= 24)
Days += 1
Hours = 0
Seconds += 1
Time()
Del()
..()
MOTD_Save()
Nice job. You have the world being infinately rebooted and repopped. You will never get your world to be playable like that xD

You need to add sleep delays in those reboot and repop procs. Along with a sleep in the world/New() call to reboot/repop the world. That should kill your supposed cpu usage.
In response to Mizukouken Ketsu
These were rather obviously examples, and he also said so.
In response to Kaioken
Yes there examples look under the reply to Falacy to see my coding.