-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix - Optimized NetworkTransform on all networked prefabs in the Invaders sample [MTT-7599] #168
Fix - Optimized NetworkTransform on all networked prefabs in the Invaders sample [MTT-7599] #168
Conversation
…unecessary transform data The server is not interpolating the ennemies position and given the game doesn't have any animation, not interpolating anything allows for the same movement feeling between clients and host.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks smooth!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sure that they were improvements, but what were the changes to Invaders Game Manager and SceneTransitionHandler prefabs?
Just listed would be fine.
@fernando-cortez I think they got reserialized because I touched them, but haven't changed anything, the diff is only the component order that changed, not sure why. |
Ah that makes sense! I think that's fine if they go through. |
58580c2
Description
The gameplay feeling is very different on clients vs. host in the Invaders Sample.
This PR is changing the interpolation of netwrok transforms to false in order to fix the issue.
Because the game is not using any physics or animations to move transforms in the scene, the server itself is not doing any interpolation between positions and simply forces the new transform position of enemies or bullets. Removing the interpolation prevents the client from smoothing that movement locally and makes all movements looks like they are behaving the same on the host and any client.
While updating the NetworkTransform, we also removed most of the sync values of the transform to keep only the ones that changes during the gameplay.
Players and SuperEnemy only need to sync their postion.x because they can't move vertically.
Enemies only need to sync their position.x and position.y.
Shields don't move, their NetworkTransform has been removed.
Bullets only need to sync their position.y because they only move vertically.
Before changes Host vs. Client
pre-changes-invaders.mp4
After these changes Host vs. Client
post-changes-invaders.mp4
Issue Number(s)
MTT-7599 - Turned interpolation to false on all the networked transform to make movements between host and client render movements the same way.
Contribution checklist