Home > Game Stuff > Summit’s upcoming packages

Summit’s upcoming packages

November 13th, 2008

Over the past couple of months, I’ve decided to take a different approach to optimizing gameservers. First and foremost, I had to peek at their code.. considering VALVes code has it’s roots from quake code, it was pretty simple to reverse engineer the game to see what functions are doing what.. using olly/ida with visual studio, i was able to reconstruct their sleep code for “Linux” and rewrite it to be more modern. I’ve created a module that is loaded during the game’s init in main() to override those functions and replace them with what I deem optimized.

- memcpy now uses SSE2 registers to save L1 cache.
- time is now serviced by clock_gettime()
Adaptive Sleeping code:
- usleep() is deprecated. We use clock_nanosleep all the way now.
- Adaptive TSC based sleep timers that can be switched on and off. This uses the TSC’s register to get ultra accurate times from the
the processor, and we can schedule a wakeup exactly, with about 200ns of erroring.
- A shared process, /tmp/clock.mmap that is read every few seconds to get time from the OS. This reduces expensive context switching
into the kernel.

About 25 users tested it so far, and everyone LIKES it. There was 2 users who said they couldn’t tell a difference, but I think they said that because I was in the inital beta phases.

Overall this module FIXES busted code. The game is probably 1000x more accurate now (using tv_nsec instead of tv_usec) and it gives you an idea of what really goes on.

Game Stuff

  1. No comments yet.
  1. No trackbacks yet.