Monday, December 8, 2014

3DWorld 3D Game Engine Intro

This is my first post of my first blog. Let me start with one thing: Graphics development is my hobby, not my job. I don't expect to make any commercial products or get paid for any of this work (yet). My real job is in EDA software development - but there are similar areas of the two fields. For example, I wrote a layout viewer that combines graphics algorithms and EDA algorithms.

This blog will be about my 3DWorld game engine and computer graphics in general. I started working on the 3DWorld project way back in 2001 when I took CS184 Intro to Computer Graphics at UC Berkeley. I wrote an entire game engine in OpenGL from scratch and it has many of the elements used in commercial games, plus some new things I invented. I have two modes - landscape and universe. Well there are really two versions of landscape mode: finite and infinite, so maybe there are really three modes.

The landscape mode has a tiled terrain with generated trees, scenery, water, grass, etc. The user can walk around in an infinite generated virtual world, or I can load landscape data from USGS DEM databases and Google maps. The finite worlds (generated either from finite procedural data or other real-world sources) tend to be more interactive and game-like, but they're, well, finite and less interesting. There is also a geometry file format that can be used to create buildings and stuff like that out of primitive objects (triangles, voxels, or parametric volumes). I created my parents' house and a 4 story office building down to small details. I have a first person shooter "smiley killer" game in there with animated 3D smiley faces. It's pretty funny but also violent as you can kill them in various ways with more than a dozen weapons (and they fight back!) You can shoot them, blow them up, set them on fire, crush them, freeze them, poison gas them, etc. Pretty much everything in the game is dynamic and destroyable with shadows, high quality lighting, very real physics, AI, etc.

The universe mode is more of a space combat game in an infinite generated/procedural universe. It supports multiple governments, fleets of ships, planet colonization, space combat, interstellar travel, etc. The AIs are very good. I have all the real planetary physics in there but on a smaller scale so that planets and stars are closer together for reduced travel time. Everything moves under the influence of gravity (including all stellar bodies) in a reduced timeframe. The ships are very unique and animated, and can be damaged etc. They have fighters, short and long range weapons, "personalities", and all that stuff. I even have code to generate star/planet/moon names. Lately I've been moving all the planet rendering into a single vertex/fragment shader and it looks very real.

Both of these modes can handle larger environments and more dynamic objects than other games I've played. The landscape mode can support tens of thousands of objects and tens of KM view distance, and the universe mode can handle thousands of ships in huge armadas, all with their own AIs.

Since I have everything written and working already (though always in progress), I can't really give my step-by-step progress like I see in other blogs. I can explain some of the ideas and algorithms I came up with, and the problems I ran into with their solutions. I need to figure out how to post screenshots here, and if I can manage to take videos of 3DWorld I'll try to put them up as well.

No comments:

Post a Comment