Closed McDiod closed 6 years ago
Look like this is working. Load time comparison to original system yet to come. Check demo mission on server grad-replay_rework_testX.Altis
.
Tested with 4 people on dedicated without any major issues. One small issue is a freeze that happens here on the clients. Might be a problem on longer missions, because TFAR might time out or Windows could complain about Arma not responding. See video at 00:13.
Recording duration: 30 minutes Precision: 1 / second Final database size: 1790
Edit: freeze fixed
excited for the performance comparison
Might be a problem on longer missions, because TFAR might time out or Windows could complain about Arma not responding.
If needed you could temporarily increase the TFAR timeout to something like 30 seconds. And then revert it back after you're done.
Performance comparison added to OP.
Okay so functionality-wise this should be fine. The only thing that I'm not 100% sure about is this new function:
https://github.com/gruppe-adler/grad-replay/blob/saving-rework/functions/server/fn_canTrackUnit.sqf
Which replaces this:
https://github.com/gruppe-adler/grad-replay/blob/master/functions/server/fn_startRecord.sqf#L97
I think the end result is the same, but I might have missed something.
I suggest we do a test build of Breaking Contact with this, test that again with as many people as we can get and then use it in an actual game on a monday.
I would suggest passing _isMan into that function as parameter instead of calling the relatively expensive isKindOf
again. As performance in that loop is kinda important.
I myself would even go so far as to not pass any arguments but instead re-use the variables from the higher scope.
Just saw you don't have _isMan before calling that function. But I think overall it would be better to move it above. The only case where _isMan is not needed is the empty vehicle case. And that returns true, thus enters the actual code which needs _isMan anyway. So _isMan is always needed anyway.
I myself would even go so far as to not pass any arguments but instead re-use the variables from the higher scope.
Does passing arguments and the params
command have a big enough impact on performance to justify that? I mean I guess with the right comments we won't get confused about it in the future, but it's still kind of ugly.
big enough impact on performance
is always relative. For the TFAR player position update loop it got a big enough impact that it matters for me. But only in the microsecond range.
Vehicle icons are still showing up multiple times.
https://github.com/gruppe-adler/grad-replay/blob/saving-rework/functions/server/fn_canTrackUnit.sqf#L8 vielleicht ist es aber auch einmal der fahrer und einmal das fahrzeug als solches
WIP again, newest changes still need testing
Works. Can be merged if you don't want to do any additional testing.
Changes to Original System
sendingChunkSize
as a config valuePerformance Comparison
Comparison to old system was done on a dynamic mission and with a sample size of one, so take this with a grain of salt.
Recording duration: 30 minutes Precision: 1 / second Final database size: 1790
Old system load time: 183s New system load time: 33s
However the load times are basically hard coded by
GRAD_REPLAY_SENDING_DELAY
. Seefn_preparePlaybackServer (old)
andfn_preparePlaybackServer (new)
.The new system saves time by reducing the sending delay as well as sending multiple arrays at once (
GRAD_REPLAY_SENDING_CHUNK_SIZE
). It also loses some extra time while the clients assemble their database arrays for playback.So the question is not how much faster the new system is, but how much extra speed it can get away with before running into synchronization issues. In a four player test there seemed to be no issues, but that might change with 30+ players.
https://youtu.be/qMKz6xqvOao
Example
Example array as stored and then broadcast by the server:
The same array, but assembled by client for playback: