Open GooberRF opened 1 month ago
I've significantly overhauled this PR. It now provides the ability to customize and modify the stock game spawn selection behaviour, which is a substantially better approach.
It also ups the limit of spawn points from 32 -> 2048.
This PR adds several options under the
$DF Player Respawn Logic:
"group" indedicated_server.txt
. These options on the whole provide server operators with a level of customizability of the respawn point selection logic that they've never had previously.The default values shown below are functionally identical to the stock game behaviour, with the only notable caveat that the RNG method is
std::mt19937
(typically more performant and has better results) as opposed torand
.Default values:
Explanation of options:
+Respect Team Spawns
- Self-explanatory: if true (default), respect team flags on spawn points. If false, ignore them. Option can be useful if for example, a server wanted to run TDM on a CTF map but use DM-style RNG spawn selection logic as if it were a DM map.+Prefer Avoid Players
- If true (default), players have a higher likelihood of spawning away from other players, though RNG is still applied (via the same method as in the stock game).+Always Avoid Last
- If true, avoid spawning the player at the same location twice in a row.+Always Use Furthest
- If true, remove RNG from the equation and always spawn the player at the furthest spawn point from other players. (unless that's the last one they spawned at andAlways Avoid Last
is also on - in that case, use the second furthest)+Only Avoid Enemies
- If true, when calculating the distance a spawn point is away from players (with eitherPrefer Avoid Players
orAlways Use Furthest
), ignore teammates and only consider distance away from enemies.+Use Item As Spawn Point
- Takes item types from items.tbl. If any specified, when the level loads, generate additional respawn points at every instance of the item type specified. Add additional+Use Item As Spawn Point
lines to specify additional item types for generated spawns. Expects format+Use Item As Spawn Point: "Medical Kit" 9
0
, it will always generate them regardless of Multiplayer Respawn Point count. This is to allow server operators additional control - ie. only spawn players at Medical Kits IF the level has an insufficient number of spawn points configured. The idea behind this is that if the map has enough spawn points without generating more, it's best to just use those, however if the map doesn't have enough, generating additional spawn points would be needed to make it playable and allow the server operator to run that map in their rotation when they otherwise would be unable. (I plan to use this extensively at Game Night to expand the pool of playable maps)This PR also:
This PR revolves #56