Tuesday, December 2, 2008

Modular Ship Design Mockup

Based on ship tiles, with square and half-square (triangular) tile types.


Chris T said...

Sounds good, this would have good benefits. Would offer more fun and more unique posibilities in my opinion.

We will need to make sure that there are enough components created in a way that avoids repitious occurances. A simple component development procedure would be ideal so as not to conflict with time spent on making it look good.

Nice idea

Lotus said...

I agree, makes perfect sense. I would like to know what, if any, extra functionality would be required from the engine to allow this, and whether or not this should be done directly in the engine or by an external tool.

Blake said...

There are several engine relevant things:

1. Ships would have internal components that could be targeted by a clever adversary by hitting the ship in the right place.

"Ah, that's a MF-452 class freighter- the warp drive is located aft center, ten meters from the bow- a sharp targeted shot there will take out its warp and leave it a sitting duck"

A successful shot that penetrates the armor on a square could do damage to any components located under that square, disabling essential components and crew- Puncturing the hull also evacuates the air of the ship up to walls or a door (this can be problematic for crew and some instruments).

2. New components can be installed anywhere they fit and have the right resource channels (which have to be laid), old components can be uninstalled or moved around to prevent their being damaged:

"Oh ho, he shot my old warp drive room! He's smart- but I'm smarter. I relocated the warp drive into the cargo hold, moving the mess hall into the old warp room and evacuating and sealing it when I detected his ship- he's destroyed naught but a few tables and chairs."

And essentially, armor squares can be replaced or upgraded. This is the system by which ships can be built from a combination of scrap parts, or modified from stock ships into specialized player ships.

These things need an in-game UI to do, which covers the following layers:

A. Structure. Structure is the thing that players see foremost; it looks like various kind of armor, support lattice, or floors. Structure is based on a grid, made of squares (the equivalent of three meters to a side), half-squares (large right triangles), or quarter-squares (small right triangles) There are several kinds:

I. Plate. From plates are built wings and the covers to rooms. Plate can contain resource channels, and have items installed on top if it (like jets or guns).
II. Room. Room is an internal structure. Like Plate it can have resource channels and items installed in it (like power plants, atriums, and command consoles). Unlike plate, it can hold atmosphere (it has an external wall).
III. Lattice. Lattice is support structure; it can carry limited resource channels, but cannot have items installed on it or hold atmosphere.
IV. Hatch. A hatch can transform between sorts of plate and room states (to release cargo or ships from a ship).

B. Resource channels. On a 'layer' under every Structure is the resource channel layer- electric lines, fuel lines, etc. These lines can be broken by being damaged- they flow resources from item to item around the ship. These are not tile based, but flow from point to point. When this 'layer' is viewed, the resources are distinguished by the colour and type of line (dotted, ladder, etc.)

C. Items. Items produce and consume resources, and generally give something to the ship or crew. They can be installed on most kinds of Structure, and range from Weapons to Kitchens (to feed the crew). Items can be installed anywhere on structure where there is room for them, and will function when they have the right resources and are operated (if need be). Some items are permitted to stick out past the structure (guns and propulsion, usually), some must be completely within it. Some items are permitted to overlap, or stack, some may not.

D. Repeat N times. This system permits ships with several decks- merely repeat the structure, resource channels, and items for each deck. Special items called lifts or elevators transport crew between levels. Special connection points on the resource channels [seen as small circles on the example] can connect the resource channels between levels.

E. Decals. This is a top 'layer' above everything else, and includes visible effects such as damage (burns and bullet holes), and decals that are seen on the ship (Skulls or flames or racing stripes)- there's no reason to have several of these, because the ship is only seen in a 2d plane.

The decals are entirely superficial, and don't have any game play purpose, but act to make the ship a bit more distinct. Functionally, this works like the items, so it's not really very relevant programming-wise, save that decals are added when and where damage is done (important to keeping track of how and where one has damaged an enemy ship).

After the UI, there are a few more minor things the engine would be doing:

3. Item functions mapped to numbers, in turn mapped to keys or mouse actions. There should be an auto-mapping feature- If the player wants to turn left, the propulsion on the right side of the ship fires (for example)- how efficiently this is done would depend on the impulse pilot NPCs.

There should be a visual logic UI system for more advanced players, though, so they can hotkey what they want (applicable as the same system for shields and weaponry).

4. Torque and propulsion needs to be calculated based on engine thrust, since the players can put the engines anywhere they want- Relatively simple 2d physics.

From applied forces, it would also be good to run some very basic architectural calculations on the structure joints (sheer, compression, and tensile)- another relatively easy thing to do.

These would prevent fission engines from being placed on the tips of spindles and being used as very improbable ships, for example.

The final application of physics is a crude drag calculation resulting in drag values for each Structure unit based on what is in front of it, behind it, and its material, as well as global values for approximated lift and control relative to weight and cross sectional area.

The drag results in heat damage and applied force, which can burn a ship up or tear it apart when it enters an atmosphere or nebula- or less dramatically, just slow it down.

Drag adds another consideration for ship design and strategy- eluding pursuit by larger or less aerodynamic ships by escaping onto a planet or into a dense nebulae at high speeds where the larger or less streamlined ship can not follow.