make entity manager and spatial manager global
cleanup for multiplayer