
Thoughts on moving platforms the Player and A.I. can ride on?
Hey all. In 5.8 I'm working on a concept for a game that takes place on a train, and I'm wondering if any of you have already come up with solutions to the problems one might face when trying to do this?
I started with a simple mesh moving along a spline (https://youtu.be/kdMwa8JZNyE), driven by Event Tick to smooth out stuttering (timeline driven trains seem to stutter more), and while this does work I realized after implementing it that I'm going to have a ton of other issues like how would that work with navmesh and A.I.?
Even if you used navmesh invokers, the world location would be moving at the rate of the train, so your A.I. wouldn't be going to the correct place.
Also, you run into velocity and vector issues where you'd want the player's vector to match that of the train so they don't just fly off when they jump as the train goes around a turn. Those are just two of the issues I thought of on day 1 of implementation.
This lead me to thinking of another system which is to have the train be static and move the world past it, but then how do you make it feel like the train is able to turn and move up and down hill.
I was thinking to build a spline with 4 points that I can update at runtime. Points 1 and 4 move left or right/up and down and points 2 and 3 remain stationary just ahead of, and just behind the train to keep a straight section around the length of the train itself. Then I just have the environment scenery move along the spline the same way the train would have. This should theoretically give the illusion of the track curving either left or right and I just mask the ends of the spline with some fog. I plan to play with this concept tomorrow.
Has anyone else done this with a game yet? Wouldn't have to be a train. Could be something like a space ship, or other large moving object?