Closed hawson closed 9 years ago
Tonight come in my mind 4 solution:
1) Time lock: colse the quadrant in order, and when a quadrant it closed you can not change it anymore. Now you can freely check collision also with the closed quadrant.
2) Overlapping priority: solving the overlapping postmortem using the priority between quadrant.
3) No house exiting: avoiding that a house can exit from a quadrant.
4) Mutex on border zone: Using a mutex or a semaphore in order to check all the house inside the semaphore without race condition
I chose the 2 one due two the fact that is the easiest one and can be added without to much refactory. Let's hope it works fine.
A simpler fix, for option 2 would be to create buildings like this:
Obviously, adjust the coordinates for each quadrant, but that should keep buildings from crossing boundaries This method may show the quadrant boundary artifacts, however.
This is likely due to the fact buildings along a quadrant edges are not checked against buildings in the neighboring quadrant.