TTT2 icon indicating copy to clipboard operation
TTT2 copied to clipboard

BUG: First Round Problems Mega-Issue

Open EntranceJew opened this issue 6 months ago • 11 comments

There are a slew of problems that occur exclusively on the first round, uncertain as to what the problem may be.

Door Linkage

A door, during its first round, will behave as expected when paired: https://github.com/TTT-2/TTT2/assets/5711436/b7b01244-145d-450b-a3aa-e165a2e8af6c

A door, during later rounds, will behave erratically: https://github.com/TTT-2/TTT2/assets/5711436/b353aa1d-468b-446d-8aed-8aeb722fe788

This may never occur if a door is broken off of its hinges, due to key values not being reset on round restart. Most notably, the stack trace changes to include a concommand even if the round concludes naturally:

first round:
Trace:
    1: Line 32    "Trace"        lua/includes/extensions/debug.lua
    2: Line 305    "SetUp"        addons/ttt2/lua/ttt2/libraries/door.lua
    3: Line 891    "nil"        addons/ttt2/gamemodes/terrortown/gamemode/server/sv_main.lua
    4: C function    "CleanUpMap"
    5: Line 895    "CleanUp"        addons/ttt2/gamemodes/terrortown/gamemode/server/sv_main.lua
    6: Line 974    "nil"        addons/ttt2/gamemodes/terrortown/gamemode/server/sv_main.lua

second round:
Trace:
    1: Line 32    "Trace"        lua/includes/extensions/debug.lua
    2: Line 305    "SetUp"        addons/ttt2/lua/ttt2/libraries/door.lua
    3: Line 891    "nil"        addons/ttt2/gamemodes/terrortown/gamemode/server/sv_main.lua
    4: C function    "CleanUpMap"
    5: Line 895    "CleanUp"        addons/ttt2/gamemodes/terrortown/gamemode/server/sv_main.lua
    6: Line 974    "PrepareRound"        addons/ttt2/gamemodes/terrortown/gamemode/server/sv_main.lua
    7: Line 1415    "nil"        addons/ttt2/gamemodes/terrortown/gamemode/server/sv_main.lua
    8: Line 54    "nil"        lua/includes/modules/concommand.lua

Long Load Dragging

If a server has been running for several rounds, a client which has been through several reconnects via mapchange will begin to experience an increasingly long join time to a server, and will frequently miss the first round post-mapchange and become a spectator. image

Partially Unknown Roles

A player which followed a server through a mapchange yet did not connect until later on, may have been assigned a role -- and the game will progress normally with a few problems:

  • The scoreboard will trickle in drawing new player ID tags, as often as the scoreboard thinks to refresh, every 3 seconds.
  • The roles of many player roles will remain unknown throughout the entire round, even if their corpse has already been identified by a detective.

A great deal of these errors are obscured by the several times SendFullStateUpdate() are run through-out a round, even just within the BeginRound() function alone. More significantly, a number of significant round information factors such as corpse detection are not sent along-side a ``SendFullStateUpdate()`.

Weapon Slot Reassignments Failing To Take

image image image

floor-spawned weapons will fail to receive certain properties when the game loads, but on subsequent rounds they will be just fine: image

this does not apply to equipment purchased from the traitor shop, it has its properties set accordingly

EntranceJew avatar Feb 04 '24 19:02 EntranceJew

image example of a player not having a role when late join occured

EntranceJew avatar Feb 10 '24 06:02 EntranceJew

floor-spawned weapons will fail to receive certain properties when the game loads, but on subsequent rounds they will be just fine

This is because the setting is only used on creation of the entity. For the setting to take effect, the entity has to be respawned. This is no issue with weapons in the shop because they are always spawned on buy.

A solution here would be to iterate over all existing entities on the map and update their values. I'm not 100% sure if that is worth it, but that would work!

TimGoll avatar Feb 12 '24 08:02 TimGoll

xample of a player not having a role when late join occured

I'm not sure I'm understanding your problem. What's wrong with being a spectator here? You'll spawn in during the next round

TimGoll avatar Feb 12 '24 08:02 TimGoll

xample of a player not having a role when late join occured

I'm not sure I'm understanding your problem. What's wrong with being a spectator here? You'll spawn in during the next round

image what role is this player

EntranceJew avatar Feb 12 '24 08:02 EntranceJew

floor-spawned weapons will fail to receive certain properties when the game loads, but on subsequent rounds they will be just fine

This is because the setting is only used on creation of the entity. For the setting to take effect, the entity has to be respawned. This is no issue with weapons in the shop because they are always spawned on buy.

A solution here would be to iterate over all existing entities on the map and update their values. I'm not 100% sure if that is worth it, but that would work!

these are weapons that are being spawned via ttt_random_weapon and therefore aren't on the map when it loads, if we're calling the random spawn function on equipment and have entspawn.SpawnRandomWeapon and WEPS.GetWeaponsForSpawnTypes then we should have the settings ready, or wait until we do

EntranceJew avatar Feb 12 '24 08:02 EntranceJew

image

spectator not acquiring the traitor role color, presumably from a late join

EntranceJew avatar Feb 17 '24 23:02 EntranceJew

image image

also they weren't even traitor that round?

EntranceJew avatar Feb 18 '24 00:02 EntranceJew

https://github.com/TTT-2/TTT2/assets/5711436/ae18df72-baf6-4974-8d4e-843b8cf8b2b9

i joined and just knew everyone's roles

EntranceJew avatar Feb 18 '24 04:02 EntranceJew

except the detective who drew as innocent? or was innocent but drew as the detective? (damph)

EntranceJew avatar Feb 18 '24 04:02 EntranceJew

https://github.com/TTT-2/TTT2/assets/5711436/7c99ccd4-46a8-4178-bdd3-391ce026907a

scoreboard took a long time to fill out with players, was kinda slack in doing so

EntranceJew avatar Feb 24 '24 03:02 EntranceJew

Some issues mentioned here might be fixed with #1532. It is hard to test for me, but I saw some parts in the code that could cause these reported issues.

TimGoll avatar May 24 '24 19:05 TimGoll