desh wrote:
I just noticed another thing that needs to be implemented: random spawns. As of right now, players will spawn into the game in sequential spawn order.
For example, on dm6 there are 7 spawn points:
1) Hole in green armor room
2) Near rocket launcher by red armor
3) Mega-health room
4) Top of stairs going towards green armor
5) Top of stairs going away from green armor
6) Hole near grenade launcher
7) Behind Red Armor
Let's say two people join the game. Player 1 spawns at spawn #1, player 2 spawns at spawn #2. The next person to join the game or the next person to die will spawn at #3, then at #4, then at #5, #6, #7, #1, #2, etc. It is sequential. It is generally accepted that sequential spawning is outdated and that random spawning is necessary for competitive play. I hope that this can be implemented. Thank you.
I find it somewhat strange that 11 years after Sujoy's demonstration of spawn-raping on dm2, this has still not been implemented. And it's not that hard, either. Here's a basic idea:
In the spawn function for info_player_deathmatch, increase a global variable by 1. Then, when a player comes to be spawned, do something like r = floor(random() * num_ipdm) + 1; and then do the find() r times, and use that as the first attempted spawnpoint.
However, this isn't completely foolproof for mods like RuneQuake, which won't attempt to spawn a player in where there's no space for him. From what I rememeber of the RuneQuake source code, it will then go onto the next spawnpoint in the list. Meaning that (taking your example) if you are standing on #4, and the code rolls #4, then the player will appear at #5, meaning that the randomness can be influenced. The way to do this is to create a randomized circular linked list of deathmatch spawnpoints as they are spawned, and then traverse this list instead of using find().
Creating such a linked list is much easier when you have a global to assist you. I'm not sure how to do it when you don't have a global that you can look at every time you need to. Also, circular linked lists are easier to create than non-circular ones, as (if you're not worried about the order) you can insert them at any point.