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:
- Take the Trike and roll along any major airport until you can view both the terminal, the takeoff runway, and the landing runway;
- Park it and find a good view, or slew if you can control it well enough, until you have a great vantage point
- Turn the sim speed up to 4x, all AI works up until that point
- 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.
Comments
Anonymous
October 28, 2007
PingBack from http://msdnrss.thecoderblogs.com/2007/10/28/game-engine-design-design-goals-and-choices/Anonymous
October 28, 2007
KISS - KEEP IT SIMPLE STUPID! 2 WORDS - Google EarthAnonymous
October 28, 2007
still i believe the engine is very un-optimized inspite of what's going on in the background, maybe because of the sloppy code. I think multi-threading wasn't implmented until SP1, that sort of code must be written from ground up you know- especially if you have that level of complexity? you can achieve whatever you want if everything around you is dynamic, beautiful water, scenery etc, the experience changes dynamically like generating waves as airplane gets closer to the water. Use CryEngine 2 next time, tell Bill Gates to license one.Anonymous
October 29, 2007
Hi Phil Many thanks for the regular updates which are very useful. One problem many of us suffer from is knowing whether we are processor or graphics card bound with our hardware and software configurations. Is there any way we can see whether frame rate restrictions are caused by the processor speed or the graphics card which generally seem to be the two main framerate limiting factors ? Thanks once again LuftyAnonymous
October 29, 2007
The comment has been removedAnonymous
October 29, 2007
Hi Phil, I appreciate your information and I do not ever intend to bash you, your team, or the product. What it comes down to is that I cannot afford to buy the machine required to run FSX and Acceleration well. I also can't afford to buy an expensive car; that doesn't give me the right to whine to the automaker. I accept what life gives me. While I'm sure FSX is an excellent product; it's out of my reach and perhaps out of the reach of those that are having a difficult time with it. Phil, I wish you well and you are a better man than me to stay on the boards in spite of the flak you have been receiving. Take care.Anonymous
October 29, 2007
I agree with ramprat. Nothing is perfect, but one thing that I appreciate is Phil and the ACES team participating in forums and providing updates. Compare and contrast with a few years ago. We had absolutely no idea what was happening, whether fixes were likely to happen or even is MS knew about problems. The best we had was to email TELL_FS and hope that there might be someone monitoring it. We're light years away from that and I salute Phil and his team for their openness and technical expertise. AndyAnonymous
October 31, 2007
Hi again mr Phil, My Specs are: P35 mb, Quad Core, 4GB mem, 8800GTX, Vista x64, SATA II disks etc. I am now running Acceleration, my FSX settings is same as before Acc. about 85% of sliders to the right, no shadows, bloom, traffic etc. When flying Free in the Istanbul scenery, I get 5 FPS. This is the most awesome pc-graphics I ever seen so far. But Why does it look like I am having 200% of slider to the right? -I mean, I did not change any settings after Acc., and there are 1000's and 1000's of small houses (beautiful ones though)? And what would you say to people who want's to upgrade their pc's for flying FSX, '-don't buy hardware for FSX yet, because there is no that can handle it' ??? /Jazzselect SwedenAnonymous
November 04, 2007
The comment has been removedAnonymous
November 10, 2007
The comment has been removedAnonymous
November 10, 2007
The comment has been removed