Download

Help with moving a character inside a moving ship

I’ve been searching for tips/help regarding moving around inside a moving ship but all the answers I’ve found have been from years ago (Example, Example) and I’m curious if there’s been any improvements or changes since then? The plan is to make a multiplayer game so I need to have more than one person in the ship.

The three ways I can think of to achieve this are:

1 - Move the ship in the world and have the player follow along
2 - Move the world around a stationary ship
3 - Make the interior of the ship a separate level from the exterior

Ideally I’d like to use the first option but everything I’ve tried so far has resulted in a lot of janky movement when the client is trying to update its position.

Is there a way to have the ship interior be a sublevel of the persistent level and update its position when the ship moves? Could I have the interior be a separate physics grid that ignores the persistent level?

Any and all ideas would be much appreciated!

Got any gameplay video to show your setup / what you’re dealing with?

Always an interesting topic… Those who’ve slain Root Motion in Multiplayer probably know all the secrets, as it likely requires a large rewrite of the CMC (for multiplayer especially). The core problem is, UE4 + UDK treat characters on a moving platform like an obstacle (similar to being outside the front of the ship blocking travel). So even if you work around the problem with some ‘glue’, there’s always other use cases to trip you up (including what happens if the character needs to jump etc).

Because of that I think removing collision on the character completely is the way to go. Instead implementing some form of alternative collision detection and manual movement. So manually controlling walking / jumping anims and movement, and then either attaching the player mesh to the ship to sync movement or updating it cleverly behind the scenes to keep everything in sync without rubber banding / blurring. A custom collision system could use live-tracing / overlaps / predictive movement to handle characters bumping into each other or the hull. Ship control interaction could be done using the WIC etc.

The problem with AFF style Render-Texture is that it works well for AFF, but for other games just getting RT to accurately match the rendered Viewport is a challenge, before even dealing with all the performance side-affects. Clearly its the easiest solution to fake the effect though. Moving the whole world around the ship would help resolve origin rebasing issues which would be great too obviously. But OR has its own performance issues. There are a few other threads on this iirc, but I don’t think any of them ever nailed it. Star Citizen may offer some useful insights. I forget what its called, but its like a nested physics volume (where the inside of the ship has completely different physics to the outside). However, they both live side-by-side, so the inside movement and custom gravity doesn’t fight the outside ship movement or gravity, because you don’t want two or more opposing movement or force systems, or you get all the problems you see in UE4 / UDK.

Does this help? I think SetBase is replicated:

Also this thread might help:

Thanks for the replies, I’m very novice with unreal and I’m only using blueprints since I don’t really know how to code.

@EntrpriseCustomr I recorded a video from my project https://streamable.com/99mtlq where I first show the ship movement blueprint and then what it looks like in action
As you can see the client is being moved along with the ship but its very jagged and jumps around quite a bit.

At the moment I have the ship and players inside a sublevel (shown in green using “level colouration” visualizer) of the persistent level, I have no idea if this does anything, good or bad.
You can also see the outliner when no one is possessing the ship

This is what the outliner is showing when player 0 (host) is possessing the ship

@perspecdev It sounds like just what I’d want but I don’t have the knowledge to implement “SetBase” using code.
I’ll read through the jittering link you provided

Minor edit: What I want to have happen is that the clients character and camera would move and rotate along with the ship and not lag obviously

@CybranM

I’ve some ideas / suggestions about how you might be able to be get SetBase exposed to BP (offline is better so check PM). But that won’t solve all the problems (see the thread @perspecdev linked to). However, if you do get this working in the future please share…

Most of the tests I did before were in UDK and the results were unpredictable with Collision occasionally breaking down and players falling through the ship. Pretty sure I tried the UDK equivalent of ‘based’ too (Kismet used to offer a way to let devs access underlying UnrealScript without needing to write code).

But there’s just so many variables here…

Is the ship one component or many… Any flaws in the mesh collision… Is the ship movement Physics based or Interp’d / Translated… Is max / min speed a factor and does using CCD help… When the ship is in motion, can players jump / crouch / fall without glitches… In short, can you have a full live firefight going when the ship is at max speed…