I do not want to have spawn campers in my game. Is there a way to script the game to spawn people in random locations away from any nearby players instead of using predefined spawn points? I also had the idea that shooting at a player you just saw spawn in would give you a warning but if you don’t stop shooting it auto kicks you from the server.
Or what about if you just spawned in and someone starts shooting at you you are immediately teleported somewhere else.
Would it not be better to implement a system where by a newly spawned player can not take damage for X seconds… similar to CS Go. Therefore the player has a chance to run and take cover.
Kicking someone for shooting a newly spawned player seems a bit extreme.
No because in games with that the spawn campers would stay hidden and follow you arround until the timer wears off. Then they kill you. This is going to be a survival game where in order to get resources you have to travel to the main land where all the other players gathering resources would be. So it would still not be that difficult to kill new players with no good gear. For it to be fair the only way you can kill another player is if you randomly run into them while exploring.
Ps this is going to be a massive map so it would be unlikely you would randomly run into someone.
This might be a discussion more suited to the Game Design forum (at least, so far). But yeah, given what you’ve said, it sounds like it might work to randomly spawn away from any other players. Just pick a random spot, see if there are any enemies within R radius, and repeat until there aren’t.
This is basically the Largest Empty Sphere problem. You can solve this using Voronoi Diagrams. Simply spawn the new player on any point along the edge of the largest Voronoi cell which is outside the minimum spawn distance.
Alternatively you can use Delaunay Triangulation if you want the vertexes of said voronoi cells which to spawn your character. Just choose the vertex with the largest triangulation radius.