grid

The new grid: Sexy and short.

Yesterday I got the new cell host’s Grid System code integrated, up and running for the first time. Slight frame-of-reference whoopsie on the first run, I’d commented out some frame-of-reference code so if you weren’t at 0,0 you couldn’t see anyone :)

I’m stuck for words describing the elation this has induced in me and why.

I want to leap, gushing, into what it’s already allowed me to do, the immediate benefits and gains I can see as the cell host’s godfather. But I’m also aware that what I write here ends up in the forums and would likely get blown out of proportion :) So I’ll start with some obvious tech-head droolery.

$ for file in host/hostGrid.cpp updt/updtPackers.cpp
> do
>   wc -l pn-{1.32,1.33-newgrid}/WW2/src/${file}
> done

 1379 pn-1.32/WW2/src/host/hostGrid.cpp
  557 pn-1.33-newgrid/WW2/src/host/hostGrid.cpp
...
  2364 pn-1.32/WW2/src/updt/updtPackers.cpp
  1315 pn-1.33-newgrid/WW2/src/updt/updtPackers.cpp

And to give perspective…

1.32 host/hostGrid.cpp comments: 145
1.33 host/hostGrid.cpp comments: 275
1.32 updt/updtPackers.cpp comments: 163
1.33 updt/updtPackers.cpp comments: 209

Rewriting the grid.

Two of the core components of our game server systems are the poorly named “World Grid” and “Update System” (the names reflect what the systems do, but not their overall role in the game server cluster). The combination of these two is alternately called “The Grid” and “The Update System”.

In short: they divide the world up into small parcels of virtual space, track the players moving around in those spaces, and generate data packets describing movements between one player and another.

Written by coders not happy to co-operate together, hodged and podged over 10 years, sprinkled with genuine pixie dust(*); neither component lends itself to maintenance, study or peace of mind.

They were developed for 1999 hardware and lovingly hand-optimized to running with magnificent efficiency on an old Pentium III 800. But you would really have to go out of your way to make them less hostile to a modern CPU like the Dual Xeon Quad-Core 3ghzs our servers currently run on.

For 7 years+, they have been the bane of my existence.