ID:109771
 
I'm one of the two programmers that works on Dragonball Phoenix. And I feel there's certain credit that needs to given.
But first, I'll explain the why.

Over the course of several months, the game has risen in popularity. Or perhaps I should say playerbase as I'm not sure which it really is.

Where servers would normally get around 60 players tops, having an average above 70 is now something I consider 'normal'. Mind you, the amount is 'normal' in the sense that I see it often but I'm still surprised by the actual amount.

In the past, 60 players would've been a 'max' as the game would use a ridiculous amount of CPU and anymore would just cause lag.

It wasn't until I removed and tweaked some of the more iffy background processes that 60 players still allowed the game to be reasonably playable.
But of course, as soon as your capacity to hold players increases, more flock to that very server.
And so, the server peaked at 75~ players and the entire game turned into a lagfest.

As coincidence would have it, Stephen001 had only recently released his Event Scheduling library.
After a bit or profiling of the game and studying the library, I gave implementing it a shot.

Very much to my surprise the game had actually improved. Where, with about 75~ players the game would ask between 80-120% CPU. The game would now peak at 60% with the same amount of players.

Using the library for some more improvement allowed the server to handle 100 players with very little lag. The occasional 'spike' of the game is still present, causing the game to freeze for 2-3 seconds. But these spikes are not consistent and do not make the game unplayable.

As such, I'd like to extend my gratitude to Stephen001 for writing this fantastic library.
Without it, I'm sure I would've pulled my hair out several weeks ago.
I still am not 100% sure how this library would be implemented into currently-existing games. From what I've interpreted, the library's demo doesn't even work; the command "Schedule_Massacre" is supposed to output "Fired!" 10,000 times yet it doesn't.

I apologize if I'm just completely misunderstanding how this library works.
It's scheduling timers in the Test.dm, not the TestEvent. Schedule_Massacre() is to demonstrate the performance aspect of firing lots of events, you can profile that to see how the scheduler handles 10000 recurring timers.