Modeling cockpits

From PioneerWiki
Jump to: navigation, search

Making cockpits is quite similar to modeling ships technically.

 

Placement

Placement for the point of view is the origin: X:0, Y:0, Z:0. Take care to line up the interior properly with the help of the forward camera tag on the ship. It's generaly wise to have the ship model in the scene on a separate layer, to check if everything fits in there.

Alignment is the same as for ships: Y+ is forward, X+ is right, Z+ is up. (in Blender axis convention).

It's useful to place a camera at the POV, so the view can be checked easily. The default vertical FOV in Pioneer is 65°, which correspond to 97° in Blender (which uses horizontal FOV), or 14mm focal length if you are using 16:9 aspect ratio (1920*1080). I usually add rotation keyframe to the camera when it's looking forward, so if I move in the timeline, the camera resets to that direction. You don't need to export the camera.

Modeling

Pretty much the same as with ships. There are some prefab and material collections in the works which should speed up furnishing and texture creation.

Triangle budget is more loose though, since only one cockpit will be shown at any time. Don't push it to the millions though, but a couple 100 000 should be fine.

Don't use a lot of materials though, a lot of those can decrease performance. One for transparent stuff and one for solid should be enough in most cases, and with proper texturing.

.model files work the same as for ships, but there won't be any shield, collision mesh or LoD levels for it. Idle and gear down animations are untested.

Right now thruster exhausts won't show up even if they would be visible from the cockpit. But there's a PR that will allow for using thruster tags. They should be named the same as they are in the ship.

Interactivity

There are no interactive features for cockpits yet, apart from looking around. Dispays aren't showing anything, buttons aren't working. They are purely cosmetical right now (apart from the fact that they differentiate between ships, by limiting the view in different ways and amounts). 

Interactivity is planned, but there's not even an estimate on when or how they would work. If you are planning on making cockpits for the official Pioneer release, then you should keep this in mind, and make them so they are easily extendable, editable when interactivity comes.

Setup

  1. You need to place your cockpit files in a directory, and place that into the pioneer/data/models/. The default cockpit is in /misc, but in the future cockpits will have their own directory (/data/models/cockpits/ for example). 
  2. Edit the given ship's ships.json file in /data/ship. The cockpit line is usually empty. Add in the name of the cockpit.model file, without extension:
"cockpit" : "myship_cockpit",

If everything's in order, you should be able to try it out in-game. Make sure to enable the cockpits in the settings, which is off by default. You can also view it in the model viewer. Zooming in all the way should place the camera at the POV of the pilot.

Putting it into a mod

You can pack up your creation as a mod, which is easier to distribute. Useful for testing and discussing it during development.

In a mod file you basically replicate the directory structure of pioneer, but you only put in the data you want to change or introduce. So in this case (/data is ommited):

/models/cockpits/myship_cockpit/files of my cockpit
/ships/myship.json

Just zip this structure up you can use it by placing it in the mods directory.