Creating Complex Rotating Skeletal Mesh Platforms, More Progress, 5 Videos of a feature-breaking issue

#Rotating Skeletal Mesh FBX For You on DropBox

Here’s my exact asset on dropbox if you wish to use it for testing.

The only socket/bone I’ve tested with is Top

NathanLyer/AnimatedPlatformCircularFlying.FBX

Enjoy!


Dear Friends at Epic,

#My Dream

I have the dream of creating complex rotating platform complexes that are based on skeletal mesh actors

the skeletal mesh actor itself has no collision, its only purpose is to provide the socket locations

I am attaching the platform end points that the player stands on by attaching them to the sockets of the skeletal mesh like so:

TopPlat->AttachRootComponentTo(Mesh, Top, EAttachLocation::SnapToTarget);

In this way I have easy collision and basing with a skeletal mesh that is playing animations

at this point keeping the platform oriented upward and the rotation itself are actually animations on the skeletal mesh


Everything works great visually when the player is not based, the platform rotates perfectly to always face upward and the entire structure rotates smoothly


#The Issue

but even in single player, when the player bases on the platform which is based on the skeletal mesh socket

then the platform starts to jitter at seemingly random intervals not related to specific rotations

To me this seems to have something to do with the platform responding to the fact that player is based on it in some way that is interfering with its ability to perfectly be based on the mesh socket

any ideas on how I can remove the jitter?

It makes my game mechanic unusable at present


#Video 1 on DropBox

I have a 27.8 MB .wmv video of this issue, comparing when player is based and when player is not based

Nathan_Lyer/RotatingSkelMeshPlatforms.wmv

#Alternative Attempt: Controlling Rotation via C++

I was having the same issue, but only on the client machine, when controlling the rotation of the platform and skeletal mesh through code.

Controlling rotation through code, the single player / server side works perfectly even when character is based.


#Video 2 on DropBox

NathanLyer/RotatingPlatformMultiplayerRotViaCode.wmv

This is a 33.5 MB video showing the alternative c++ method, controlling rotation of platforms entirely through code. The server is perfect (upper left), but the client has the same jitter issue that the altenative animation rotation single player has


#Video 3 on DropBox

The third video of 15.4 MB in size shows multiplayer with the animated rotation version,

as well as the robustness of animated rotation version when there are many on screen at once

MultiplayerWithAnimatedRotation.wmv

Hopefully this provides sufficient data for you to analyze and find solution to smooth this out

so I can fully implement this game feature

Thanks so much!


#Summary

Video 1 demonstrates the single player having a jitter issue when the platform complex is controlled via animations

Video 2 demonstrates controlling the rotation of the platforms through code, and how the entire game feature works perfectly on the server, but the client has the same jitter issue that was seen in video 1 with animation rotation method.

Video 3: demonstrates multiplayer with same animation rotation method as Video 1


In all videos, the server is the upper left , and the client is lower right :slight_smile:


Project Can Be Uploaded

I can upload my project to drop box if you’d like :slight_smile:


#Worth Noting

As you can see from video 2,

the player does not always stay based at the actual surface of the platform and the feet sometimes go through the platform.

This happens SMOOTHLY on the server

and in a very jittering way on the client

I think the jittering might be related to this somehow


#Why Use the Rotation via Animation Method?

I noticed that with controlling the rotation via c++ and constantly updating the skeletal mesh rotation,

when having more than 3 rotating platforms on the screen, there was some kind of network lag happening

This does not happen with the animation rotation method

Thanks!

Rama

Just curious, were you able to over come the jitter effect in Unreal 3? I had a similar problem in UDK but never quite figured it out.

Hi Rama,

Can you try running the following quick test to see if you still get the issue?

Place your SkeletalMesh in the level with the animation on it set to loop. Then add your platform or another flat-topped staticMesh in the level, and use the Level Blueprint with the node Attach Actor to Actor to attach the platform to the Socket in the SkeletalMesh. In the Details panel for the platform, ensure it’s Rotation is set to Absolute Rotation, and then PIE.

We have run this test in the ThirdPersonTemplate and experienced no jittering or collision issues. Your results may help us narrow down the issue.

Cheers!

@Matt
“Just curious, were you able to over come the jitter effect in Unreal 3? I had a similar problem in UDK but never quite figured it out.”

I never tried this in UE3, but it does sound like an area of the engine that could really be polished to make UE4 shine among middleware engines for enabling complex 3D multiplayer MOVING platforms :slight_smile:


@anonymous_user_1da90bc6,

Thanks for the reply Stephen!

I did achieve greater success when I switched my feature from character to skeletal mesh actor

However as documented below the jittering issue is happening for me even when generating a circular path entirely through code and setting a static mesh actor’s position to that generated path every tick.

See below for more details at your convenience.

Thanks again Stephen and Epic!

I’m loving UE4!

Rana

#Rotating Skeletal Mesh FBX For You on DropBox

Here’s my exact asset on dropbox if you wish to use it for testing.

The only socket/bone I’ve tested with is Top

NathanLyer/AnimatedPlatformCircularFlying.FBX

#Noticeable Progress Switching To SkeletalMeshActor

I changed a bunch of my C++ code to use Skeletal Mesh Actor instead of Character.

This change alone caused the feet of the server to stay planted properly!

Yay!

Please note the progress was made via the c++ method of spawning the SkelMesh Actor and spawning the platform that gets attached to it, as seen in Video 2.

#Multiplayer Still Not Ideal

The client still has the feet going through surface thing

as well as continued jittering in multiplayer.

So it sounds like whatever is different between Character and Skeletal Mesh Actor that keeps the actor’s feet on the floor

whatever is special about Skeletal Mesh Actor is not replicating


#Video 4 on Drop Box

NathanLyer/Video4_UsingSkelMeshActorInsteadofCharacter.wmv

I posted a video showing my latest progress

#AbsoluteRotation

I really really hope

bAbsoluteRotation = 1; //scenecomponent.h

is how you set it to true!

Here’s my code for setting absolute rotation

void AJoyPlatformBase::PostInitializeComponents()
{
	Super::PostInitializeComponents();
	
	//SceneComponent.h
	if(SkeletalMeshComponent) 
	{
		SkeletalMeshComponent->bAbsoluteRotation = 1;
	}
}

#Summary

Significant progress and debugging info has been acquired (thanks to Stephen of course!!!),

switching my game feature from using a Character as a wrapper for the skeletal mesh,

to using a Skeletal Mesh Actor,

caused 1 huge noticeable improvement, although this improvement does not replicate.

(The improvement is that the server’s feet stay firmly planted on the mesh unlike the prior 3 videos)


Thanks for the significant progress Stephen!

Rama

#Further Investigation: The Jitters Have Nothing to Do With Skeletal Mesh Actors

I just did a test where I made a mesh constantly update its location to a circular path controlled entirely through code, no sockets or skeletal mesh actors involved.

The strange jittering behavior shows up again !


And once again, the jittering only occurs when the Player character is based on the mesh, mesh moves smoothly otherwise.


Here also, the feet move up and down slightly, something that is somehow fixted by the use of Skeletal Mesh Actors

But the jittering problem to me seems related to the mesh reacting to the Player being based on it

I’ve provided video 5 to illustrate this evidence

#Video 5 on Drop Box

NathanLyer/Videos/Video5_JittersWithCircularPathViaCode.wmv

Here’s my code for creating circular path entirely through code

    void AVictoryPath::StartCircularPathCalcs()
    {
    	
    	VICTORY_GETPC
    	
    	DoCirclularPathCalcs = true;
    	CirclePathIncrementAngle 	= FRotator(0, 0, 0);
    	
    }
    void AVictoryPath::CalcCircularPath()
    {
    	//Inc Rotation
    	CirclePathIncrementAngle.Pitch += 1;
    	CirclePathIncrementAngle.Normalize();
    	
    	//Calc Vector
    	CirclePathCalcVector = GetActorLocation() + 512 * CirclePathIncrementAngle.Vector();
    	
    	//Set Actor Location
    	if(Test) Test->SetActorLocation(CirclePathCalcVector);
    }
void AVictoryPath::Tick(float DeltaSeconds)
{
	Super::Tick(DeltaSeconds);
	
	//Server Side Only
	if (Role != ROLE_Authority) return;
	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	
	if(DoCirclularPathCalcs) CalcCircularPath();
	
}

My latest research above is the most compellingly useful and important from my perspective, because it effects all movement of static mesh actors,

is there some other way to simulate movement besides SetActorLocation() every tick?

Rama

this issue of non-skeletal-meshes having the same jittering issue is being continued over here

https://rocket.unrealengine.com/questions/7943/best-way-to-simulate-movement-in-c.html

but I am not marking this as resolved because it is very far from being resolved and I am not even sure if the above thread will resolve it, as there is no attempt to address multiplayer in the other thread.

:slight_smile:

Rama

Hi Rama,

Apologies for the delay in the response on this. I know that you have made a lot of progress on this since the question was first asked, and that you have discussed the issue in at least the one other post as well.

I’d like to catch up on where this particular issue stands currently. Can you please concisely provide a short summary on the current issue as you see it? Is this issue reproducible in a fresh project?

Thanks for your help.

Lovely to hear from you Stephen!

#Current State of Based Platforms on Skeletal Mesh Actors

Here’s the current state of the specific topic of using moving platforms with skeletal mesh actors:

In this specific case the platform’s location is NOT set every tick using SetActorLocation.

In this case the platform is “snapped” / has its base set to the socket of the skeletal mesh actor.

  1. server - the feet stay firmly planted on the surface, but the client character who is also based on the same platform appears to jitter constantly
  2. client, the feet do not stay firmly planted on the surface of the platform as it rotates, and the server character appears to jitter

#Reproducing in Fresh project

If you have your own rotating skeletal mesh actor, or you want to use my asset from drop box, you could

NathanLyer/AnimatedPlatformCircularFlying.FBX 
  1. put it in a level and
  2. also make a static mesh actor
  3. set the SMA to moveable
  4. add the sMA to the “Top” socket of the skeletal mesh actor (After making a socket for it upon import
  5. The anim blueprint is just the entire contents of the FBX as an animation sent to Result
  6. The skeletal mesh actor will most likely need to be scaled about 5 to 10 times bigger than it is on import.

When I do the above in a multiplayer game I get the results I mentioned above :slight_smile:

I’d be very curious to see if the results very between beta4 and beta5 !

#I am Eager To Assist

If there’s anything you’d like me to do, including making videos, on my end, let me know!

Thanks again Stephen!

Multiplayer 3d platforming is a huge part of my game and I dont think I can do it without your help :slight_smile:

Rama

Thank you for the clarification.

I have tested this both in Rocket and our current internal build, where I have recreated the issues and made reports for them.

Cheers!

wohooo!!

Thanks for bringing this to the attention of the Team, Stephen!

:heart:

Rama