The current spawning system is very slow and buggy. It turns out that spawning is actually very hard! It needs to have no race conditions and be able to reliably spawn players quickly. This probably should be separated into another service
Spawn flag on the user document. if a user is being spawned, atomically set a flag so only one service can spawn that player.
Find a spawn location
Should find it quickly
could be pre-calculated. Could spend free time finding spawn locations, storing them and picking them off to spawn users.
spawn locations should be spread out from other users
spawn locations should have a lot of open space
spawning could possibly modify the map to flatten terrain
Once a spawn is found, actually place the user in that area
The current spawning system is very slow and buggy. It turns out that spawning is actually very hard! It needs to have no race conditions and be able to reliably spawn players quickly. This probably should be separated into another service
Spawn flag on the user document. if a user is being spawned, atomically set a flag so only one service can spawn that player.
Find a spawn location
spawning could possibly modify the map to flatten terrain
Once a spawn is found, actually place the user in that area