-
Notifications
You must be signed in to change notification settings - Fork 0
/
TODO.txt
138 lines (122 loc) · 7.65 KB
/
TODO.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
:: gpporoblox design notes
things it needs to do
-manage start game timing
-manage initial game sync
:: 7/2024 startup process
-all players join, expect them to have GGPO initialized (to set up event listeners)
SKIP-send synchronization event, wait to receive synchronization event response for all players
-send start event, include server_synch_start_time https://create.roblox.com/docs/reference/engine/globals/RobloxGlobals
-upon receiving start event, start GGPO at time server_synch_start_time + 3 sec - ping https://create.roblox.com/docs/reference/engine/classes/Player#GetNetworkPing
:: 7/2/2024 disconnect notes
-need download game state (at ggporoblox level) that initialize ggpo with correct information at given frame
-and adds appropriate frame data info to CARS
-is there a P2P version of mid game join? NO
-no disconnect handling, since one player DC means desync
-so you just have that players input in prediction mode indefinitely, NBD, may result in big rollback
-but in that case either
-CARS can either disconnect that player (not allow old inputs when that player joins)
-pause the game and wait for player
-stop the game due to player drop
-you want to make sure all players have the same prediction for that player though, should befine.
-in the future you might have a disconnect consensus algorithm or osmething to handle such cases
-cars tracks DC state of players, specifically if no input has bene received, the player is "DC'd" and not allowed to send old inputs until they reconnect
-you need a way to force that player to drop its own inputs (perhaps using CARS authoritative input or just reinitializing that peers GGPO)
-you could also just restart that client
-same algo can be used when player actually quits and rejoins
## NEW WIP
-cars disconnect handling (see notes above)
-explicit init
-just need to update UDPProto_LazyInitPlayer everything else is OK to lazy init I think
-are you sure though?
## WIP TODO IGNORE
DONE-consider getting rid of the J parameter for gamestate stuff?
-pull out utility methods into its own file
-maybe pull out types into its own file
-fix udpproto owner data lastFrame issue
-causing harmless asserts to hit due to udproto tryig to pass on nil inputs from the owner
-fix lazy init tracking problems (probably by adding explicit init routine)
-- TODO this won't always work due to lazy init. If we have a lazy init player, we won't have a lastFrame for them in the map, and we will confirm past their frames which is bad :(
-should you just have an explicit setup routine? and save lazy init for players being added mid game
-this will still have the problem where you don't know about a lazy init player and discard confirmed frames after their inputs you don't know about
-you can solve this wil explicit player add packets though that force the lazy init of those players
-cleanup logging
-maybe replace frameNull with nil...
-more tests
DONE-CARS test
DONE-force longer desync
-component tests for
-inputqueue
-sync
-out of order packets in MockGame
-cleanup routine for savedstate in synced
-add override and consistency assert in InputQueue_AddInput
DONE-need to dinstguish between local input and remote input and local player remote input
-prob OK to assert that remote input is never double added?
-do i need to track last added remote/local input?
-ideally the same mechanism can be used to assert/override inputs that arrive out of order or from non auth peers
-Pretty sure you need to let sync know somehow that inputs were overridden
V2-udpproto to support spectator mode
-reject/assert/log on input
-player number is spectator
V2-allow dynamic player entry/exit
-need methods to initialize at given frame/state
-probbaly have a server input for such events
-startgame + player data (frame 0 input)
-maybe have an all players synced msg (when all players have reasonable rift) (probbaly not needed)
-player disconnected (input for a player after they disconnected is invalid, should never happen)
-player reconnected
-player joined
-game end (probbaly not needed)
V2-consider adding sync routine to udpproto
V2-allow self to be flagged as authoritative inside sync/inputqueue
-otherwise, allow peer to override self inputs
-if peer does not send self inputs (but send other stuff for that frame) assume that local inputs are correct/authorized
-NO this won't work, because peer sends player inputs from many different frames
-instead, just have server send back player inputs to confirm them OR send a separate confirmation packet
-why do I want server to override player inputs again?? IDK
V2-figure out how to handle initial player data
-prob best just to recommend X frames for syncing initial state and rift
-send player data as server input on frame 0
IGNORE/DONE-add disconnect tracking
IGNORE/DONE-figure out what to do when player is disconnect
-refer to orig ggpo implementation
DONE/SORTOF-repeat test with UDPPROTO_NO_QUEUE_NIL_INPUT
-also move UDPPROTO_NO_QUEUE_NIL_INPUT into config
DONE-make all functions local
DONE-inputqueue needs explicit las frame tracking because sometimes we clear out all the cnofirmed frames
DONE-isprodxy is udpproto is wrong, you need to have ggpo peer take the input and share with other udpportos
DONE/IGNORE-nobody is calling SendPendingOutput on CARS (because we never add input to it)
DONE-fix input queu prediction
IGNORE-switch to jest
IGNORE-since you added potato/severity stuff, you probably need custom serialize/deserialize for gameinput
-just do gameinput_serializable without the potato
-just delete the potato stuff
DONE-call GGPO_Peer_DoPoll inside GGPO_Peer_AdvanceFrame
-- TODO maybe poll here?
IGNORE-add polling timer to udpproto include calling UDPProto_OnLoopPoll
-I guess you need to do this in the API layer (not a module script)
IGNORE-also need to call peer::DoPoll every now and then (NO, this is done by the API user, but you still need to call it after ADvanceFrame)
DONE-need to better track starting frame in InputQueue
-Sync_LazyAddPlayer will init an inputQueue with no inputs, at that point we are already predicting to frame n (say) but there won't be any inputs in the queue
DONE/IGNORE-add logging helpers to easily log tables and stuff etc
DONE-you need to set inputQueue.first_incorrect_frame
DONE-need to pass in gameinput equal function
DONE-you also need to reset first_incorrect_frame (resetPrediction)
DONE-change Sync_AddInputXYZ to make a copy of input and set the frame in there rather than use inout_input, it can return an output frame
DONE-- TODO call this inside of the AdvanceFrame function above to be more consistent with GGPO API usage
DONE-summary of weird shit
DONE-sometimes input frames get niled by the time they arrive over the fake network, I thin this is due to references everywhere. You need to deep copy before sending over the fake network.
DONE/FAIL/LOL-ASDF why does endpointstuff subscribe get mixed up???
DONE-utility methods
DONE-better logging function, maybe extract callsite from debug.callstack or whatever
DONE-proper table counting method to replace #
DONE-proper table empty method to replace #/next
DONE-MockUDPEndpointManager_AddUDPEndpoint is incorrect
-it needs to make a pair of endpoints with matched send/subscribes
DONE-add player to subscribe callback
DONE-meed to call Sync_AddRemoteInput somewhere
-GGPO_Peer_PollUdpProtocolEvents is wrong
DONE-allow OPTIONAL input sending in udproto
-you still need to set lastAddedLocalFrame because SendPeerInput won't get called in the not sending case
-INSTEAD just require calling SendPeerInput with nil input
-AND you can optimize by not sending the input if its nil