complete rewrite for mysql support and random spawn locations