Update #5: Building System

Since the last post, i have finally got the building system to a point where i fell i can move onto other core elements. The last 2-3 weeks have been quite a headache, as i met problem after problem with how i was going to build the system, almost too many to even mention. Following from the last post i was changing the building system, from placing individual wall segments to a system where each side of a room was an entire wall/object, from which walls/windows can be cut from.

Alongside this, rooms(box object to represent room area) were to be created at the same time within the physical walls. At first i encountered problems when trying to place a room inside another room, i had to use a boolean cut function to cut the one room from the other, which ended up not enabling certain mesh collider attributes that i needed to detect furniture... So after much fiddling i reverted back to a system where the player just drags an area to zone a room (ie. Prison Architect).

Now i just needed to be able to merge/cut walls together that overlap, so that there were not any duplicates and so that windows and doors would work. I eventually decided to merge all the walls together into one object at run-time which seemed like the simplest and most straight forward way. The problem was that as the floor-space/size increased the repeated Boolean operations began to corrupt the mesh, rendering the idea useless. It wasn't a total loss, i decided to go halfway and only merge walls that were directly overlapping and that had the same orientation. This method seems to work well so far while still offering better performance and a lower risk of any mesh corruption.

In other news, I added a lot of scenery objects including a beach, headlands, more trees and hills. The framework for the AI is in place, and at the moment i can have agents Check In, be assigned a room, wander, sleep, shower and go to the toilet which are all based off of their individual needs. This is being done by utilising Utility Theory AI to find the highest priority need and then address it, all done with a behavior tree.

Leave a Reply