Reworking the Base Interactable


Problem:

One thing I tackled this week was to refactor the base interactable class and all its child classes. One of the issues we were having before was that it had bad and messy code because it was not correctly replicated. Because of this, there were weird work arounds in place that caused warnings to popup in the logs and caused noticeable client side latency. Out of the three child interactables: Buyable Door, Weapon Wall Buy, and Revive, the Revive had the most issues. It had the worst latency when the client player was reviving the server player.

Solution:

The Solution when refactoring was to first make all interactables spawn on the server and be set to replicate, and also have Net Load On Client checked if it needed to be dragged in the level. Once this was the case, all the logic for being interacted with by the player through the IIneractable interface was now run on the server. This makes it more smooth and warning free, and also has noticeably less latency while reviving. It also enabled me to delete some of the old work around functions and clean up everything to be more readable.

Get Deadlands Duel: Time Rift Rumble

Download NowName your own price

Comments

Log in with itch.io to leave a comment.

(+2)

Keep up doings God's work my man.

(+2)

Reworking the Interactable was amazing, Glad to see how smooth it is in the game. Cant wait to see more!

(+3)

Bjorn working his magic on the networking as always. Game is smooth and snappy.

(+3)

Thank you for doing that amazing work! The base interactable performs so much quicker and easier now.

(+3)

Bjorn, great stuff, will keep an eye on this!