-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: First Round Problems Mega-Issue #1360
Comments
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! |
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 |
these are weapons that are being spawned via |
Garry.s.Mod.x64.12472.2024-02-17.22-41-14.mp4i joined and just knew everyone's roles |
except the detective who drew as innocent? or was innocent but drew as the detective? (damph) |
Garry.s.Mod.x64.7576.2024-02-23.21-09-55.mp4scoreboard took a long time to fill out with players, was kinda slack in doing so |
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. |
This pullrequest is quite large, all over the place, but *mostly* moved code. I try to highlight the changes. After Gathwar asked for a level reset button (resets the round time, rounds played, karme, score etc) I started investigating this topic. The current gameloop is a mess at best and bug ridden at worst. There are no major bugs, but every now and then someone complains about syncing errors, they are probably all caused by our current game loop. I stumbled upon many bandaid fixes and tried to remove all of them. While doing so I reduced the amount of timers by a lot, reduced the network trafic and made the system more robust. For some reason every round state change (`ROUND_PREP` etc) triggered a full reset on the client: ![image](https://github.com/TTT-2/TTT2/assets/13639408/2024ada1-0d59-41ad-a728-a22cf2cc7687) This might seem like a sane solution, but it actually caused issues because it clashes with `SendFullStateUpdate`. Whoever wrote that part of code was aware of it, but chose to fix it by adding two more syncs triggered via timers: ![image](https://github.com/TTT-2/TTT2/assets/13639408/5b9e0764-4317-414b-aa09-2de61c8e98bd) The first sync, called in `roleselection.SelectRoles()` is almost always overwritten while the second one comes through. Since our networking system only syncs differences, this can cause issues with players not knowing about their team mates. For late joiners I added this instead: ![image](https://github.com/TTT-2/TTT2/assets/13639408/8db73f75-489b-44f9-ae7b-1bda49abd93b) It makes sure that the client is receiving the data they need. Speaking of late joiners. This is some syncing that was done before: ![image](https://github.com/TTT-2/TTT2/assets/13639408/06c0e015-5208-4775-996e-51b6b97c9a03) Note here that players are not able to receive data when in `PlayerInitialSpawn`. Therefore the one second timer. This probably works in 99.5% of the cases. But sometimes it fails and the client doesn't know about roles. I also wrapped many `GlobalXX` variables inside descriptive functions. Moreover I tried to clean up `sv_main`. I'm not yet done. And the mess with the replicated convars (seriously, client checks in a server file? :D) should be cleaned up as well. This makes the changes in #1527 redundant and will probably fix some of the issues from #1360 Relevant existing functions still have their alias, so it doesn't break everything: ![image](https://github.com/TTT-2/TTT2/assets/13639408/5dbd3b6c-cc6c-400d-8b4b-cd03b2bbdd2f) --------- Co-authored-by: Histalek <16392835+Histalek@users.noreply.github.com>
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:
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.
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:
A great deal of these errors are obscured by the several times
SendFullStateUpdate()
are run through-out a round, even just within theBeginRound()
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
floor-spawned weapons will fail to receive certain properties when the game loads, but on subsequent rounds they will be just fine:
this does not apply to equipment purchased from the traitor shop, it has its properties set accordingly
The text was updated successfully, but these errors were encountered: