Home Unreal Engine

How is boat rocking done?

polycounter lvl 14
Offline / Send Message
mdeforge polycounter lvl 14
I have this idea that puts the character on a boat. Making a character to walk on an asset is easy enough, but how is boat rocking normally done? Via camera shaking? But what about when that boat makes a sharp turn? Surely that can't be accomplished with the camera. The whole horizon line moves! So how does the boat asset rotate and everyone's feet remain planted? Some sort of animation blend + physics modification?

I'm not asking for Kismet or code, just ideas on how I can tackle the technical feat behind this. This would be my second scene made in UDK. I'm just trying to assess if busting my ass for this would be worth while for a summer portfolio piece towards technical design, or if I should perhaps set my sights lower. It would look sweet in my portfolio, however, I would really like this to be a three month project, tops.

Anyway, enough rambling. Thoughts on the mechanics behind something like this?

Replies

  • Oniram
    Options
    Offline / Send Message
    Oniram polycounter lvl 16
    maybe try making the boat into a vehicle?
  • mdeforge
    Options
    Offline / Send Message
    mdeforge polycounter lvl 14
    I should work on my clarification skills if I'm interesting in technical design, lol.

    This boat is really a ship, and it's going to have a crew of people on it. I need to be able to walk around on it as well.

    So, correct me if I'm wrong, but a vehicle pretty much replaces my main character as the controlled object, right?
  • Shadownami92
    Options
    Offline / Send Message
    Shadownami92 polycounter lvl 7
    Is there any way to make it so all character meshes or character rigs are parented to the boat so they rock with it?
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Basically you're looking for a coordinate space transform for the occupants of the boat. The boat moves in world slave while the occupants move in boat space.

    General theory answer would be to give the boat object an array of pawns and call the array "passengers", and either set the boat as the owner of each of those pawns, or iterate over the array and rotate all pawns along with the boat. This would leave physics in world space and so make walking on deck hard like in real life. :)
  • mdeforge
    Options
    Offline / Send Message
    mdeforge polycounter lvl 14
    Thanks for the lead Vailias, that gives me somewhere to start.

    These assets would all be InterpActors, correct? And then I could use matinee to facilitate the animation provided the coordinate space transform is in place?
  • sprunghunt
    Options
    Offline / Send Message
    sprunghunt polycounter
    If you rock an interp actor with matinee and you adjust the physics properties to make it collide with pawns it should be the same as a rocking boat. It's the same principle as a matinee elevator.

    And if all else fails try rocking everything else in the scene with matinee and keeping the boat still. ;)
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    And if all else fails try rocking everything else in the scene with matinee and keeping the boat still. ;)

    haha! I was hoping someone else would suggest that.

    Strad: What class they are totally and completely depends on what you are doing with them and when.
    InterpActors look to be a replacement for the old Movers of UT99-2004 era, which were essentially level geometry only.
    I'm not 100% sure HOW a boat would fare being made up of those. However sprunghunt's suggestion of just making sure it collides with things should be fine.


    Really if you are just doing a cinematic then animate the boat and everything on it as a single skeletal mesh, then move the lot with the cinema you need.

    IF you need interaction, then make the boat an interpactor make everything else whatever it logically should be, and attach it all to the boat via kismet or code.
    Thankfully, as usual, Epic though of stuff like this so there's already an array for things like this in every actor.
    /** array of actors attached to this actor. */
    var const array<Actor>  Attached;	
    /** location relative to base/bone (valid if base exists) */
    var const vector		RelativeLocation;
    /** rotation relative to base/bone (valid if base exists) */
    var const rotator		RelativeRotation;	
    

    so your boat can have actors on it, and the actors on it can all have relative locations and rotations to the boat, that can be updated if need be.
  • mdeforge
    Options
    Offline / Send Message
    mdeforge polycounter lvl 14
    Thanks for all the help again! I was able to achieve some success this morning. I successfully got an InterpActor attached to the rocking boat. I animated the actor moving around and it stuck to the boat as promised! Do you foresee any problems with me doing it that way or is that pretty much what you had in mind?

    Where on earth do I go to set what the player is attached to? Is this is a kismet thing? I looked around the Kismet menu's and didn't see much pertaining to this. I'm probably looking in the wrong place.
  • Vailias
    Options
    Offline / Send Message
    Vailias polycounter lvl 18
    Glad you were successful!

    Not sure how to do it through kismet. It's a limited system, but good enough for most basic level scripting.
    A playerpawn should be attachable to another actor. Im not sure of the syntax though.
Sign In or Register to comment.