NetDuke32: Current netcode known issues.
Writing this issue to keep track of all known issues specifically with the lockstep netcode implementation.
1. For some reason, the master has this kind of broken pacing of movement, that causes things like doors and objects to move in a very jerky fashion. As if interpolation is broken/going all backwards.
- This might have something to do with totalclock/ototalclock. Offline play is fine, and Slaves in online play do not exhibit this issue nearly as often as the master. Slaves seem to do some kind of totalclock correction, maybe that has something to do with it? Attempts to replicate this behavior on the master has resulted in disaster (hung games, massive lag, etc). Any suggestions on how to fix this are very welcome. This is something that affects all kinds of ports with the same lockstep netcode; xDuke, JFDuke3D, and even NBlood.
- See: Net_ParsePackets, and Net_HandleInput. PACKET_TYPE_MASTER_TO_SLAVE and PACKET_TYPE_SLAVE_TO_MASTER are the packets for sending data to and from master to slave, and vice-versa, so those are good places to look. Should also investigate G_DoMoveThings, G_MoveLoop, and the section of app_main that calls G_MoveLoop.
Just some thoughts: Perhaps interp would be better off calculated from something other than totalclock and/or ototalclock? Maybe a separate ototalclock-like value that doesn't get interrupted by delays in the move loop? (like in situations of network lag), maybe ototalclock itself should be updated differently? (actual old clock value, rather than += TICSPERFRAME?)
2. If all but two players quit, the last player gets a false-positive "OUT OF SYNC!" error message.
- For example, if there's 4 players, and player 4 and player 2 leave, player 3 will get an "OUT OF SYNC!" error, but it's a false-positive, because the games actually do remain in sync perfectly fine.
- I'm not entirely sure why this is happening, but I believe there's a chance the 3rd player is getting old sync info from a time before the 2nd player disconnected, or perhaps something is getting royally screwed up with the order of sync data in the packet.
- See: Net_GetSyncStat, Net_AddSyncInfoToPacket, and Net_GetSyncInfoFromPacket. These are in sync.cpp.
3. If you drag the game window, or attempt to resize it, the game stalls and lags the match until you stop dragging/resizing.
- Dunno why this is happening, but I'm guessing it has something to do with the event handling. I need to make it so doing these actions doesn't halt the game.