Search Unity

If you wanted new players to spawn with a 30 second window of safety how would you do this?

Discussion in 'General Discussion' started by Arowx, Jun 25, 2022.

  1. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    In a multiplayer game even AAA games seem to have spawn point problems but some seem to manage amazingly well given the chaotic nature of multiplayer games.

    So how could you ensure that a spawning player has a time window of safety?
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,151
    Your question is so vague and open-ended that it's almost impossible to answer. This depends heavily on the specific game. I wouldn't even go with 30 seconds for most games, instead dropping that down to 5 seconds, maybe 10. 30 seconds is absurd for basically any action game, especially in progress.
     
  3. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    OK lets work the problem.
    Unity has two systems that could help.

    Occlusion - could be used to work out cover and visibility from other areas of the map.
    Navmesh - could be used to work out pathing distances or potential time from a spawn point to enemy player points.

    So in theory a safe spawn dataset could be generated for a map that could find regions that are safe to spawn in for a limited time.

    I'm thinking some kind of heatmap that is updated based on enemy positions and potential movement and lines of sight.

    Respawn is often a delayed action so the respawn heatmap could be generated over a number of frames kind of like temporal texture mipmapping/LOD-ing this could also help optimise the system as large enemy occupied areas could be removed in the first pass limiting the higher detailed passes to areas with lower enemy occupation.

    Side Note: Wouldn't good AI need this kind of dataset to fight in a modern FPS.
     
    Last edited: Jun 25, 2022
  4. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,151
    Or you could just use spawn points and implement several seconds of non-combat time after respawning.
     
  5. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    I think that's the old school way of doing it with golden shielded players spawning on spawn points then having n seconds of invulnerability to get out of a hot spawn.
     
  6. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,151
    A fair few games still use it, largely because it's a tried and tested solution.
     
  7. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,853
    Test line of sight raycasts to local enemies in x radius from a List of waypoints. Spawn at the first waypoint that returns false to line of sight raycasting hit. No need over thinking this or instituting some ghawdawful mess of interfaces, alternate navmesh and other bloat molarkey. Save those bells and whistles for the enterprise client who seem impressed by such.
     
    Ryiah likes this.
  8. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Sounds like a level and game design problem not a technical one. If you are testing line sight during gameplay maybe your level design need some more iteration.
     
  9. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Surely high end shooters will need a tool set to analyse LOS across a whole map/level to analyse it for weak points?
     
  10. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,151
    Visibility calculations are already done with internal tools specifically geared towards the project in question.
     
    MadeFromPolygons and Ryiah like this.