More Housing
As last week I worked on improving the housing / building system. This time I mostly worked on getting the internal systems to work correctly. We saw problems with replicating the entities over the network. Internally buildings are grouped together to “BuildingGroups” on the server-side everything was grouped together correctly, but on the client-side due to latency and unordered messages we often ended up with multiple groups even though the components belonged to the same one. Why is this bad? The system relies on the correct constellation of groups in order to correctly perform collision detection and socket handling.
I fixed the problem by caching the incoming buildings that are children of others and check them periodically if their parent element is already created if not they go back into the queue and will be checked the next time. This causes some wait time in the creation of the buildings locally but fixes the other problems with the grouping of the components. However I realized that the longer wait times sometimes results in falling through the floor. Fortunately, this is due to the fact that the building modules are still missing a specific tag in order to be recognized by the collision detection on our server. Hopefully I will have this fixed by the next week.
Furthermore I added all the necessary items that need to be crafted by the players in order to build all the parts. The next step is to add the recipes to our database thus they can actually craft them when they have all the materials. I hope we can conduct a test of the current system in the upcoming weeks.