pizzaoverhead

[WIP] Free IVA Alpha v0.0.5 [1.6.x] (2019-02-06)

Recommended Posts

Free IVA! Free as in freedom: Get out of your seat while in IVA, move around inside your craft, open and close hatches.

During my work on KerbTrack, I noticed it was possible to change the position of the internal view camera to shift about in your seat. So: Why not take this all the way, and allow moving freely throughout the craft interior?

 

 

Plans

Movement

For debugging, movement is currently controlled with the WASDQE keys for forward, backwards, upwards, downwards, strafing and roll controls, with the mouse providing pitch and yaw. These keys are remappable in the settings.cfg file, however the mouse look axes are not yet. There is no "down", allowing you rotate freely at any angle (aside from some gimbal lock issues currently), similar to some space combat games, and float through the internal compartments. Gravity, where present, could be added at a later date. This would necessitate the addition of usable ladders and handholds to stop players from being prevented from returning to their seats in high gravity, such as on the surface of Eve. In low gravity, it would be interesting to experiment with momentum and pushing off from the walls of the craft.

Collision

At this point, there's nothing to impede your movement. You can travel right through hatches, bulkheads and the hull, off into space. This will need to be solved by writing custom collision methods for the character. My current intention is to use raycasting in the direction of travel to hit the part's collider from the inside, and implement character pushback based on this. After this point, other colliders for internal objects such as control panels could be added. Collision support has been added by creating primitive box colliders to create walls and internal objects.

Hatches

Being able to move between compartments is much more immersive when you can see between them via open hatches rather than phasing through closed doors. Ideally we want to provide easy compatibility with all stock IVA parts and any modded ones too. This means that editing the mesh to separate the hatch from the IVA model is infeasible. To get around this, we can use a depth mask to cut a hole in the hull, then re-add a separate hatch and hatch surround model. The depth mask consists of a primative cylinder flattened to a disc and placed over the hatch, with the position needing to be customised for each IVA hatch.

To allow us to see between compartments, we add the depth mask shader to the disc. The setup for this involves setting the disc to be at a closer render queue position (1999) to the current IVA (position 2000, standard geometry), forcing the adjoining IVA to be visible, and placing it on a yet closer render queue position (1998). The results can be seen here:

 

 

pmSQwLQ.png

 

A hatch surround model would be placed to cover the gaps left around the edges. Note that the handle is still visible. I'm still searching for an ideal solution to this, as extending the depth mask would necessitate a very thick replacement hatch to prevent cutting holes elsewhere when the player is alongside the hatch. Hatches can now define meshes which should be disabled when they are open. There is also a slight flicker when passing through the hatch, in the distance between the depth mask and the IVA hatch surface. This was solved by decreasing the distance between the depth mask and the surface, and adding an offset to the depth mask shader to prevent Z-fighting.

IVA designers: You can provide best support for this mod if you leave a hole in your mesh where the hatch should be and cover it with a prop hatch or similar.

Triggers

Being able to get out of your seat is fine for looking around, but it would be more useful to be able to interact with your surroundings. Potential ideas so far are sitting in a new seat, opening and closing internal hatches, and going on EVA. This will require custom placing of trigger colliders for each part, similar to how external hatches and ladders work. Taken a step further, this could combine with Connected Living Space and various life support systems to require you to close hatches on adjacent modules before going on EVA, or to provide airlocks.

Additional IVAs

Several parts have markings on their outside indicating that they have a hatch for pressurised crew transfer:

 

 

These parts could have custom IVAs added to allow travel through them. New custom pressurised variants of the Structural Fuselage and Rockomax Brand Adaptor would also be useful as they are often used in space station construction.

Development image diary

Last updated: 2015-10-11

 

 

Download (Experimental)

If you've enjoyed this, consider donating a cup of coffee to help with late night coding:

btn_donate_LG.gif

 

Keys:

 

  • Y - Enter free view
  • Alt + Y - Lock view
  • F - Open/Close hatch
  • Alt + F - Open/Close connected hatch
  • W - Forward
  • S - Backward
  • A - Strafe left
  • D - Strafe right
  • Q - Roll counterclockwise
  • E - Roll clockwise
  • Shift - Upward
  • Ctrl - Downward

 

Questions, comments, suggestions and ideas are welcome.

 

Change log

v0.0.4 (2019-02-06)

  • Added colliders to Mobile Processing Lab. It should now be possible to move around inside this part without floating through the vessel.
  • Added ability to open and close hatches in Mk. 1 spaceplane parts.
  • Can get into different seats in the same part or different parts.
  • Return to seat on leaving IVA view.
  • Fixed Mk. 1 inline cockpit being too narrow to pass through.
  • Changelog.
Edited by pizzaoverhead
New release.

Share this post


Link to post
Share on other sites

On a side note - maybe it would be easier to cut a hatch using alpha texture method? Well, not that I know how KSP handles transparency, but it is usually easier to implement in games.

Edited by sashan

Share this post


Link to post
Share on other sites
On a side note - maybe it would be easier to cut a hatch using alpha texture method? Well, not that I know how KSP handles transparency, but it is usually easier to implement in games.

My concern is that it would put the alpha channel out of use for anything that already uses it. I may explore this in future and see what, if anything, breaks. Thanks for the suggestion.

Share this post


Link to post
Share on other sites

It should have Gravity limitation on movement. When on a base on Eve, you shouldna just fly around.

Share this post


Link to post
Share on other sites

Awesome work!

If hatches have already been created as separate meshes, what would you propose for them to work better with your mod? Any issues if the hatches are props, and not part of the IVA model.mu?

Another question is how will this work between IVAs that are connected with docking ports (modded or stock)? would modpack docking ports need to have a void cut out in the bulkhead, or is there another method you are looking into?

Share this post


Link to post
Share on other sites
My concern is that it would put the alpha channel out of use for anything that already uses it. I may explore this in future and see what, if anything, breaks. Thanks for the suggestion.

Well, if it is used for transparency then it would be no problem. If it is used for reflectiveness... Then well, you can try using separate mask texture, not sure if it is possible in Unity tho

.

Share this post


Link to post
Share on other sites
It should have Gravity limitation on movement. When on a base on Eve, you shouldna just fly around.

That's the end goal, but it likely won't be in the first release. It would necessitate some method of providing hand holds and ladders. I'm not a fan of the idea of losing your craft because everyone's trapped in a heap in the bottom corner :)

Awesome work!

If hatches have already been created as separate meshes, what would you propose for them to work better with your mod? Any issues if the hatches are props, and not part of the IVA model.mu?

Another question is how will this work between IVAs that are connected with docking ports (modded or stock)? would modpack docking ports need to have a void cut out in the bulkhead, or is there another method you are looking into?

They'd have to provide some public method of being toggled or hidden. Props are readily accessible, so that should be fine.

I would consider externally mounted docking ports to be clamping points rather than crew transfer ports, until they're mounted over a crew hatch. You can't bore through all of the science equipment in the Mobile Processing Lab and still have it usable :) The code will be available if anyone wants to create such behaviour however.

I'd also like to add IVAs to crew transfer-capable parts that don't already have them: the HubMax 6-way connector, clamp-o-tron inline, docking ports, Z-4K battery bank and structural fuselage. All but the fuselage have markings indicating they have hatches for crew transfer. It's interesting to note that the Mk1-2 Command Pod and Mk1 Lander Can don't have any hatches in their IVA in spite of their being marked on the outside. I'll be adding hatches to the upper end of both of these as not having them just wouldn't be fun.

Share this post


Link to post
Share on other sites

I would consider externally mounted docking ports to be clamping points rather than crew transfer ports, until they're mounted over a crew hatch. You can't bore through all of the science equipment in the Mobile Processing Lab and still have it usable :)

I feel the same way about docking port placement :)

cant wait to try this out with my Node1 IVA

U78BgrG.png
Edited by cxg2827
Updated picture

Share this post


Link to post
Share on other sites
I feel the same way about docking port placement :)

cant wait to try this out with my Node1 IVA

http://i.imgur.com/7Inc0cu.png

Very nice! I can't wait to float through that module! For such detailed hatches, you could do an animated hatch showing the levers turning and the hatch swinging open.

Ooh, can we click on a hatch to open it?

That's the plan! It's early days at this point however. Only yesterday did I reach the point where I believe there are no remaining issues that would make this idea impossible to implement, so there's a lot of work to do to turn it into something actually worthy of being released.

Share this post


Link to post
Share on other sites

I hope it will be compatible with Kerbal Planetary Base Systems, because the IVA's of this mod are epic!

Share this post


Link to post
Share on other sites

Spams subscribe button, breaks finger...... Spams with remaining index finger.

Share this post


Link to post
Share on other sites

I'm thinking of having an extra crew member where possible on all my missions just so that I can use this to get more unique IVA views that can also include the actual crew, since no other mod out there lets you move the camera in IVA yet

Share this post


Link to post
Share on other sites
My concern is that it would put the alpha channel out of use for anything that already uses it. I may explore this in future and see what, if anything, breaks. Thanks for the suggestion.

You could create another shader that has an additional mask for the texture that is toggled on open. This would be the way I would do it. Then you could open and close the hatch, and if you used all 4 colors, you could create up to four hatches that could open and close.

Share this post


Link to post
Share on other sites

RasterPropMonitor has some handles you can use to get out of your ship, so I have to wonder how much that will do for you.

I think my brain is breaking from how amazing this mod will be.

Share this post


Link to post
Share on other sites

Looks promising!

My main concern is with how you're handling internal collisions. Your present approach would definitely work for most stock parts, but some mod crew cabins (such as FusTek):

- are made up of multiple intersecting colliders, which are needed for concave areas

- the internal may be shaped very differently from the exterior colliders (e.g. FusTek modules are round on the outside, but rectangular on the inside with chamfered edges plus some oddly-shaped circular segments for breakout areas)

I'd like to suggest some sort of override feature, where mod authors can specify their own custom internal colliders for their pods.

Share this post


Link to post
Share on other sites

In terms of collision, you could just brute force it and add a mesh collider the the internal model. This is far from ideal, but It would work with most, if not all internals.

Edited by MrHappyFace

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.