Tuesday, March 17, 2009

The Leapfrog



This is The Leapfrog, she's the example ship I'm using to explain the 3d modular ship- which, as I've said, isn't really much different from that in 2d.

The leapfrog is made of up tile-like map data which defines the hull (as you can see from the skeletal version), to which objects (like the canons, the accordion airlock, the engines, etc.) and decals (like the "L-52" and "Frog") are affixed.

The hull configuration consists of one byte per cube (as seen in the skeletal version- 3 bytes of header data define the bounding box). These pieces, when rendered, access different models that fit that configuration (each relatively simple) as defined by the type. To these are applied the appropriate multitextures as defined by the type and in the map data.

The hull types themselves are stored as in a 'palette' of materials referenced by two bytes in this example (we could probably safely scale this back to one byte- 256 different kinds of armor per ship being more than adequate, as it's unlikely that even more scavenging players would often reach it).
This is primarily an issue of game logic, the style of model only representing one byte in each type- other values include things like damage resistance, weight, materials, etc. (these are of little concern to the rendering, so I won't address them here)

After the model has been determined, and the base texture, more local map data defines colour (one byte)- basically 'paint job'- as well as damage/grunge (done through multitexturing) and joint fusing (which I'll address later).

From there, various items (decals and objects) are affixed to the hull, which acts as a matrix of hard points- they have different logistical considerations, which I won't go into here.

The Leapfrog is a small ship- comparable to a simple starting ship. Her map data is only about 1.5 kb (this can't be compressed much further, as it's almost entirely non-redundant binary). The average ship would be about four times her size, though map data for such a ship would only be about 2 or 3 kb. A large ship would be about ten times her size (bear in mind this means more 'decks' and not necessarily much larger on the screen)- probably between 4 and 5 kb. A very large ship might be 10 kb- though once they get large enough, there's some redundancy in structure that would lend itself to some compression). An asymmetrical, and very complicated, space station might be 50 kb. A planet might be several hundred kb.

No comments: