Game Engine Design, Design Goals, and Choices

There was a recent thread about game engines trying to compare them on avsim.com. And I thought I would collect some of the thoughts here, clean it up, and re-publish it.

 

Lets talk about the terrain, some ( but not all ) of the objects in the world, night lighting, and AI. There are a lot more topics we could cover but these four will occupy both plenty of space in this post and plenty of space in your head.

 

The way FSX deals with terrain is, I think, a bit different than a level based game; even one that “streams” in relatively large levels. Why do I say this? Data generation and runtime handling. On the data generation side, it usually true that levels in level based games are authored by someone who touches each and every triangle. This care in the size and complexity of the data set is something FSX cannot do. There is a process that takes approximately 4 Terabytes of data, that’s 4000 Gigabytes, and compresses it down through various techniques to the 15 Gigabyte or so that is deliver on DVD. It’s an automatic process. The engine that loads this dataset must both load data of this scale, and have a scheme for loading in new segments as the user flies from one area to the next ( which could be consideredc a type of streaming ) and thus missed a chance at some optimizations a game that "knows" about its level data might be able to make. On the runtime handling side even though FSX stores quite a bit of DEM data on the users machine, there is still a pretty intensive terrain generation process going on because the full world at 1m DEM resolution would be way bigger than what is actually stored on disk. The US is typically stored on disk as a 30m data-set and outside the US the data sets can vary up to about 90m depending on what the national owning authority paid for in terms of satellite time. IIRC, we shipped 3m LIDAR for Mt St Helens in Acceleration to support a mission. That one area alone is like 100m on disk. So this is one difference from other engines, the sheer size of the data and the size of the runtime manipulation we must perform on it. 30m source data and a slider set to 1m is causing a lot of interpolation code to run on the BGL data as well as a tessellation to triangles for the hw rendering. And depending on how far you fly from origin, a re-tessellation has to occur to avoid floating point errors creeping in. This is due to the WGS-84 64-bit float coordinates the data-set is stored as, and the 32-bit float coordinates we have on the graphics hw to render with. Next, the way the terrain textures are generated is pretty unique and that is how all vector data (hydrology for streams, roads, rails) coastlines, vegetation, etc appears. I highly recommend Adams' paper at https://dev.fsinsider.com/developers/Pages/GlobalTerrain.aspx. The overall terrain approach is noteworthy enough that GDC accepted a session proposal based on it in 2006.

On to objects in the world; of which there are several classes. Lets talk about just custom objects and Autogen objects and not "Living Worlds" objects or traffic or others. "Hi def" airports that have custom objects ( 1200 or so locations planetwide ) are similar between FSX and level-based games in that there are pre-built objects that are loaded and placed. Same with the custom objects in cities. The scale of this, eg 1200 separate locations planetwide, might be a bit larger than the design points in Crysis have to deal with, but the idea is similar although let me clear again without vidding their source I am speculating there just like everyone else. Autogen trees and buildings are different in kind from what other titles do. Autogen is pieced together automagically from landclass mapping data and geographic/cultural region data on the fly. Thats why they are called Autogen. Trees use both landclass and geographic data to generate themselves. Buildings use geographic and cultural data as well as human footprint data to generate themselves. Autogen building roofs are actually stored in a separate BGL allowing even more dynamic runtime composition based on this cultural/regional mapping. That flexibility does come at a cost, though. But its hard to see how the user base would accept less variability in the world. Autogen gets its share of criticism for being too cookie-cutter as is. Its a hard problem. Cell densities and visibility have an impact here too. The range of Autogen goes up to 6000 per cell for both buildings and trees. What is 2x6000x16=? 192k is what my math shows. That is just the Autogen objects for a 4x4 grid around the viewpoint. IIRC our grid is 2nm on a side. Thats only 8nm x 8nm. So our Autogen densities result in a lot of objects. But that is what it takes for LA, or London, or Paris, or Tokyo or any of the other big cities to appear real. Yes we batch, and yes we LOD - but even there its a lot of individual objects even if you cut down the verts and use a single texture. I think that too is a bit different than level based games. And the combination of the world object techniques together is again somewhat unique. Usually its either fixed maps and objects, or completely random maps and objects. Not use of both specific fixed data at such a large scale with controlled variability to generate the illusion of planet Earth.

And the way night is handled is another difference. The lighting technique we use for night lighting allows generation of thousands of emissive light sources, which is how you get the wonderful nighttime cityscapes. As well as the great night airport experience, which again is one of the reasons I begged to be able to fix the 737 and A321 because when they rolled by dark on the tarmac it really destroyed the night experience. If you don’t know what I mean mean do this:

  1. Take the Trike and roll along any major airport until you can view both the terminal, the takeoff runway, and the landing runway;
  2. Park it and find a good view, or slew if you can control it well enough, until you have a great vantage point
  3. Turn the sim speed up to 4x, all AI works up until that point
  4. Watch and enjoy

This gets you a great view of the airport night experience and its very soothing, almost like a screensaver. The sim delivers a pretty good 24 hr 365 day a year experienceand that is something we are continually adding to.

AI is, I believe, the bit of the same and different. All AI follow paths. The scale of a continental road network is a bit different, though. And I think the nature of generating commercial flight plans within a connected network, relatively random but non-crashing GA flights, and several layers of boat traffic (including commercial/military shipping and ferries that follow timed schedules) as well as the at-airport vehicle behaviors means both titles have non-trivial AI capabilities that have overlap and unique aspects.

That is a lot to chew on, and we didnt even touch water, shadows, day time lighting, VC or 2D panel, or a range of other topics. There is just a lot going on in FSX.

From this one should get that while all games do have commonality, genres do have differences. And those differences do matter in terms of design and choices.