Monday, December 4, 2017

Progress update #3 - Next step: vehicle synchronization (day 8)



Hello!

Yay! Another progress update! The project started a week ago and the progress since then is unbeliveable. There is a lot of positive feedback from My Summer Car community which motivates me to work even harder on the mod. Thank you all!

So going back to the progress update. As you probably noticed in the title of the post - the next step in the mod development is vehicles synchronization! Yes!

So far I did basic research of how vehicles are implemented into the game and if everything will go well in the next blog post I will be able to show you some footage with vehicles! Yay x2 😁!

So just to keep the form of the blog post. What I did on day #8?

Added custom LoadLevel method to call OnWorldLoad callback even if level is the same.
This was source of few bugs I had in the code. After level change in OnWorldLoad I'm initializing all object managers. The issue was that If level name was the same - the OnWorldLoad callback was not called so the state was broken. Custom LoadLevel "wrapper" will always call this callback.

Added arrays support to network message generator.
So my custom "protobuf-like network messages generator" (Maybe it is time to start calling it SummerMessages or MSCMPMessages or whatever?) finally supports arrays. This change allows me me to, for example send more objects into single messages.

Added world full sync message.
Thanks to the previous change. I am finally able to synchronize full world state when player joins session so, new player will see consistent world as the player(s) that are currently in the session. How awesome is that? 💪

Utils to convert network vector3 to game vector3 and vice-versa.
I wrote set of handy helpers that will let me perform conversion of network message containing vector to game format of vector. DIY!

Added play maker utils class.
As I'm doing more and more stuff with PlayMaker (love it btw) I needed to create proper place to put all the new functions to.

Moved game doors handling to game door manager class. Synced all basic doors.
Yay all doors are synced! Also! They synchronize it's state properly after joining to the session, so if another player opened some doors before you joined the session you will see them opened when you spawn in the world.

Make LoadAsset method public.
This method will be useful later, for example for loading custom animations. Because it will be definitely used from other classes than MPController (GameCharacter for example) I made it public.

Implemented full world synchronization on join.
Just implementation of the full world state synchronization in network manager.

Remove unused development ui.
Removed some GUI I wrote at the beginning of the mod development to debug local player game object. Not needed anymore.

Added vehicle sync related messages.
Added set of basic network messages related to the vehicle synchronization. I will use them later.

Print details about play maker state actions in world dump.
Added that for better understanding what each state in playmaker finite state machines is doing. Probably one day I will write some visualizer for all this data as trying to understand the whole logic of it just from plain text is pain in the ass.

Added interpolators.
Added generic interpolators class for use in various places to not repeat the same code in few places. I still need to refactor network player to use it.


In the end - a nice gif of properly working handling of vehicle enter/leave event tracking.




Thanks for your support!

Eryk


3 comments: