ID:273617
 

Problem description:Recently my server that can handle 50 people with no lag suddenly started lagging and using more CPU and the newest update i think was medals. Medals wouldny cause any lag the game only checks for medals after the end of a match or when you do certain specific ones like the one you get for entering training mode

What game is it?
In response to Pumacatrun2 (#1)
Dragonball Tournament Fighters 2
Profile the game, analyse the bottleneck, then provide the relevant code in order for people to help you.
Inferno L Flames wrote:
Problem description:Recently my server that can handle 50 people with no lag suddenly started lagging and using more CPU and the newest update i think was medals. Medals wouldny cause any lag the game only checks for medals after the end of a match or when you do certain specific ones like the one you get for entering training mode

The reference entries for both GetMedal and SetMedal state that they contact the BYOND hub and that this process takes a few moments to complete, which halts the execution of code until the BYOND server responds. Without any further information, I suspect you have not spawned the calls to these procs to avoid this.
In response to Mobius Evalon (#4)
so you mean a simple spawn would fix this problem most likely if it is the medals
In response to Inferno L Flames (#2)
I did it but apparently the lag got worse

heres one medal code

 spawn()
var/hasmedal = world.GetMedal("Getting Ready", usr)
if(hasmedal == 0)
spawn()
world.SetMedal("Getting Ready", usr,"InfernoLFlames.DragonballTournamentFighters2","blahblahblahmypassword")
In response to Inferno L Flames (#6)
Code:One example of my code that gives you a medal
spawn()
var/hasmedal = world.GetMedal("You're Alive!?", M)
if(hasmedal == 0)
spawn()
world.SetMedal("You're Alive!?", M,"InfernoLFlames.DragonballTournamentFighters2","PWBLAH")


Problem description:My game is on a shell server and was able to handle 50 people with no lag suddenly it started getting like a lot of lag spikes and the only recent update i made was medals i made a topic before and they told me to add spawns and i did and the lag just got worse

In response to Inferno L Flames (#7)
My comment still stands, profile the actual game world and show the relevant code of the bottlenecks.
In response to Schnitzelnagler (#8)
i cant do that if im not the one hosting
In response to Inferno L Flames (#9)
Then send the host your debugging build and ask for the world to be profiled, or try hosting yourself for the time ti takes to diagnose an issue?