ddnet/src/game/client/components
bors[bot] 5528cde5f6 Merge #869
869: Complete rework of the ghost and race recorder r=Learath2 a=Redix

This PR fixes a lot of issues with the ghost and race recorder, introduces a new ghost file format and implements some pretty useful features.

**A quick overview:**
 - When you cross the start line multiple times, both (ghost and recorder) will only restart if it is a non-solo server
 - If available, both will use the race timer to recognize the start instead of searching for the start line
 - Fastcap support for both
 - The recorder immediately starts when the Tee spawns, so the preparation steps (which are quite important for speedruns) will be included in the demo. If you do not cross the start-line within 20 seconds, it will stop the demo until you really start.
 - Better ghost menu (colors, reloading, deleting and saving ghosts)
 - The ghosts are more resistant against lags (old ones were sometimes completely useless due to small lags)
 - New ghosts files are significantly smaller
 - Cleanup, bugfixes..


**About the new ghost format (version 4/5):**
This format is used by Teerace for over a year now. The code for handling the binary files was moved to the engine. It includes an auto updater which creates a backup of all ghosts and converts them to the new format afterwards. The major differences from the format used by DDNet right now (version 2), are the ability to store multiple types of data, the usage of delta-encoding and a more portable header.

For whatever reason, the ghost stores values for every predicted tick, but without tick information, so lost snapshots can make them unusable. The new code uses the original values from the snapshots including ticks but it can also handle the old ones without. Since hardly any server uses the high bandwidth option this practically reduces the file size.

Like the demo recorder the ghost recorder directly stores the data to a file (every 50 snapshots) instead of writing the whole file at the end of the race. Indeed this can be changed with only a few lines if the old behavior is preferred.

The updater can handle version 2 (DDNet) and 3 (old teerace format, only slightly different from version 2) files. The updating already happens when the files are scanned for generating the list in the menu and not only when you activate them. The change from version 4 to 5 was only needed due to a bug in the implementation, the ghost loader can read both.

Some numbers about the file size: (map: hotrun, both about 30 seconds)

 - Old ghost: 30.4 kB (converted: 10.7 kB)
 - New ghost: 5.4 kB


**One thing about the race recorder:**
The old implementation compared the new file only with the first file it found for the particular map. The new one compares with all related demos and deletes them possibly, so that only the best demo is left. Since DDNet can also store the demos without name, this might also delete demos from other players, that you might have in your directory.
To prevent this I at least check whether the demo contains the player name if `cl_demo_name` is on. 
In my opinion the better solution would be to remove `cl_demo_name` and always use the player name.
2017-10-30 20:27:10 +00:00
..
background.cpp make background class inherited from maplayers and change some things in 2017-09-12 20:13:53 +02:00
background.h make background class inherited from maplayers and change some things in 2017-09-12 20:13:53 +02:00
binds.cpp Removed default bind for home key (kill) 2017-07-26 20:43:26 +02:00
binds.h Clean up key binding a bit 2017-07-21 19:32:32 +02:00
broadcast.cpp Hide empty broadcast messages. 2017-05-20 13:59:39 +02:00
broadcast.h made broadcast text a bit smaller and cut it off if it's bigger than the screen. Closes #313 2010-12-16 03:17:16 +01:00
camera.cpp fixing most wrong code pattern 2017-09-13 20:33:58 +02:00
camera.h Simplify Dyncam and fix #311 2015-08-27 20:26:05 +02:00
chat.cpp Simplify emoji 2017-10-28 09:08:17 +02:00
chat.h Simplify emoji 2017-10-28 09:08:17 +02:00
console.cpp Allow changing UsernameReq while connected 2017-10-16 20:08:39 +02:00
console.h Reopen: Add a flag for rcon login via username (#800) 2017-07-24 21:43:55 +02:00
controls.cpp Allow moving mouse while spectating and typing (fixes #798) 2017-07-21 19:24:18 +02:00
controls.h Fix dummy input reset 2017-03-06 19:45:39 +01:00
countryflags.cpp Fix whitespaces a bit 2015-07-09 02:12:35 +02:00
countryflags.h added a config to display the code string of a country flag instead of the image. Closes #897 2012-01-08 18:16:38 +01:00
damageind.cpp Remove Damage Indications when entering game (fixes #29) 2014-09-03 14:17:44 +02:00
damageind.h Remove Damage Indications when entering game (fixes #29) 2014-09-03 14:17:44 +02:00
debughud.cpp Add show angle in debug 2017-04-24 14:11:22 -07:00
debughud.h added "Whitespace and line Endings cleanup" by GreYFoX 2011-04-13 20:37:12 +02:00
effects.cpp Fix sound enabling and disabling (fixes #82) 2014-10-25 02:52:08 +02:00
effects.h Remove Damage Indications when entering game (fixes #29) 2014-09-03 14:17:44 +02:00
emojis.cpp Removed alias->utf replacer, added alias lookup instead, modified CEmojis class 2017-10-28 09:08:17 +02:00
emojis.h Removed alias->utf replacer, added alias lookup instead, modified CEmojis class 2017-10-28 09:08:17 +02:00
emoticon.cpp Revert "Revert "Refactor dummy input and demo filtering"" 2017-02-28 10:08:14 +01:00
emoticon.h fixed eyewheel (originally from Chairn) 2015-11-15 00:31:24 +01:00
flow.cpp added "Whitespace and line Endings cleanup" by GreYFoX 2011-04-13 20:37:12 +02:00
flow.h added "Whitespace and line Endings cleanup" by GreYFoX 2011-04-13 20:37:12 +02:00
ghost.cpp Fixed several issues with the ghost (thanks to Learath2) 2017-10-28 14:23:24 +02:00
ghost.h Fixed several issues with the ghost (thanks to Learath2) 2017-10-28 14:23:24 +02:00
hud.cpp Switch cl_showfps 1/2 2017-10-20 22:27:53 +02:00
hud.h Added cl_showping 2016-05-03 16:06:10 +02:00
items.cpp also remove references to CGameContext from CServer 2017-06-05 22:31:56 -07:00
items.h some trivial fixes 2011-12-04 14:21:20 +01:00
killmessages.cpp Switch cl_showfps 1/2 2017-10-20 22:27:53 +02:00
killmessages.h Render kill messages with ddrace team color (only with cl_chat_teamcolors 1) 2015-04-12 15:19:47 +02:00
mapimages.cpp more warning fixes 2017-09-27 15:01:38 +02:00
mapimages.h create overlay textures for entity overlays, instead of rendering glyphs 2017-09-12 20:15:37 +02:00
maplayers.cpp fix the code layout 2017-10-25 15:42:06 +02:00
maplayers.h for tilelayers, go thorugh them layer by layer to reduce GPU overload by 2017-09-27 12:20:23 +02:00
mapsounds.cpp Fix style in several places 2017-03-22 19:45:14 +01:00
mapsounds.h Make detail flag work for sounds (fixes #103) 2014-11-25 21:01:31 +01:00
menus.cpp Really only download ddnet-info.json at correct time 2017-09-08 22:16:00 +02:00
menus.h Improved ghost start accuracy 2017-09-28 16:01:59 +02:00
menus_browser.cpp Make sending name to info.ddnet.tw optional, show dialog at start and some minor fixes 2017-09-07 20:51:46 +02:00
menus_demo.cpp Localize Date, Demo 2017-10-28 01:22:11 +02:00
menus_ingame.cpp Fixed several issues with the ghost (thanks to Learath2) 2017-10-28 14:23:24 +02:00
menus_settings.cpp Localize friend message 2017-10-28 01:21:32 +02:00
motd.cpp Handle multi-line motd correctly in the console 2017-04-03 12:29:31 +02:00
motd.h added "Whitespace and line Endings cleanup" by GreYFoX 2011-04-13 20:37:12 +02:00
nameplates.cpp Don't reset antiping subconfiguration on startup 2015-09-10 12:09:38 +01:00
nameplates.h Updated copyrights 2010-11-20 21:26:06 +01:00
particles.cpp Introduce cached ticks for client again, this time with workaround for 2016-06-28 23:36:34 +02:00
particles.h added "Whitespace and line Endings cleanup" by GreYFoX 2011-04-13 20:37:12 +02:00
players.cpp A few fixes in ghost and race recorder code 2017-09-28 16:02:00 +02:00
players.h Use existing code for rendering the ghost 2017-09-28 16:01:58 +02:00
race_demo.cpp Move RaceHelper to src/game/client 2017-10-06 22:13:35 +02:00
race_demo.h Clean up ghost and race recorder 2017-10-06 22:01:33 +02:00
scoreboard.cpp Clean up time handling a bit 2017-09-03 08:48:21 +02:00
scoreboard.h Add cl_show_local_time_always (fixes #319) 2016-04-27 19:22:55 +02:00
skins.cpp Add kitty skins (by Ravie + fuzzy ninja by patwo.*) 2017-07-25 00:11:37 +02:00
skins.h added "Whitespace and line Endings cleanup" by GreYFoX 2011-04-13 20:37:12 +02:00
sounds.cpp Fix whitespaces a bit 2015-07-09 02:12:35 +02:00
sounds.h Fix whitespaces a bit 2015-07-09 02:12:35 +02:00
spectator.cpp Resize window without restarting client 2016-04-30 17:59:58 +02:00
spectator.h Fix spectating in demo viewer and add a button to choose to follow a player 2015-07-26 18:21:51 +02:00
statboard.cpp use str_append for appending strings 2017-07-24 15:27:30 +02:00
statboard.h Sticking to naming convention. Freeing allocated memory. 2017-05-08 21:55:03 +02:00
voting.cpp commanddescription can now be placed directly in 2015-12-28 16:19:52 +01:00
voting.h Removed level stuff 2011-08-13 02:11:06 +02:00