I have had some people from other games ask me to explain the lasting appeal of EVE Online. I’ve directed them to Crazy Kinux’s thread for WoW players, talked about comparisons with original Star Wars Galaxies (which I played for 5 years), and then found this little nugget:
Easily the most awesome lecture of the conference, CCP’s CTO explaining the code and design of the simulation system behind the EVE Online servers: DESTINY.
The key point is a chaos-theory equation system of potential spheres of influence for every actor in a space. Essentially the algorithm goes something like this:
1) Begin server frame.
2) For each ship, calculate a sphere of possible client interaction based on the ship’s dimensions, weapons systems, visual range, etc.
3) Using chaos theory equations of possible changes in a ship’s behavior before the next time slice, fractally extrude out a set of event cylinders (with hemispherical caps) of the ship’s possible influence before the next frame, within the 3D space.
4) Loop through the generated event cylinders and look for intersections. Lump intersecting masses together as “causality bubbles.” Sets of events that could potentially influence one another.
5) Rapid cache out the causality bubbles as separate sets and defer the simulation of each bubble out through microtasklets in Stackless Python.
6) Send only the information relating to a player’s intersected causality bubble/matrix to that game client. (Dump client’s simulation state from pervious frame in lieu of the server’s state if they disagree.)
7) Allow the client and server to run the simulation of that causality bubble in parallel. Continue the simulation on the client to make it appear seamless.
8) Yield to other causality bubble simulations in DESTINY and Sleep() for 1000ms.
9) Download any input changes by the ship’s pilot from the client at the end of the server frame. As ships do not respond to inputs instantaneously in EVE, this is fine.
10) Push that input into the force equations in the physics simulation for next frame.
11) Push the causality bubbles’ simulation result to TRANQUILITY, the actual server Main() process.
12) End server frame, loop while the execution context has not received a shutdown signal.
This prevents you from encountering a runaway O(n^y) algorithm of every ship in a solar system potentially acting on every other, and by only sending updates to clients based on that client’s ship’s causality bubble, it allows the game to be played on only dial-up modem speeds.
The only downside is in large space battles, in crowded spaces. In these scenarios, the intersection of extruded causality cylinders tends to encompass the entire system. This ship can influence this ship which can influence these ships which influence… etc. So the partitioning of simulation afforded by causality bubbles goes away. They tossed out some similarly awesome-sounding ways to fix this, that are in development, but I’m not allowed to talk about them.
Other really sweet things they did:
– Dynamically generated all solar systems in the universe using actual supercomputer-run disk accretion models. This means every solar system was formed the same way actual astronomical ones are, and no system is artificially held together by anything that would not work in real physics.
– Originally, the random seed to generate the EVE universe was taken from the server’s Epoch Time at the start of the universe generation. The guy in charge decided, the night before launch, to regenerate the entire universe at the last minute with the seed “42.”
– The location of solar systems relative to one another were modelled after cellular cohesion equations – the same thing that makes gold deposits form, blood vessels to grow in your body, and sets the pattern of the universe filaments as seen in the Cosmic Microwave Background Radiation.
Yeah, this is totally geeky, but it’s also incredibly cool for anyone that understands physics, programming, science and extruding believable science fiction from it. Really, it doesn’t get more awesome than this.
EDITOR NOTE: Yeah, yeah, 42, the answer to all questions, I know. – Hitchhiker’s Guide to the Galaxy