hettoo / racesow

A warsow mod dedicated to race
http://racesow.warsow-race.net
4 stars 3 forks source link

Autorecord demos, clientside (suggestion) #23

Open QaleQ opened 10 years ago

QaleQ commented 10 years ago

Pretty much what the title says.. There's already a rs_autorecord command, but it seems broken at the moment. Would be great in combination with the option to upload demos to the site manually some time in the future, perhaps?

kalhartt commented 10 years ago

Why doesn't this work for you? It works fine for me. Set rs_autoRaceDemo 1 (requires cgame, maybe game and client)

QaleQ commented 10 years ago

obviously i set it to 1 :p it creates a correctly named 0 kb demo file.. using the cgame and game that you compiled, same issue before!

QaleQ commented 10 years ago

Got it working now. However, it's kind of flawed it seems. The first demo you do on a map (the one that creates the map-folder) is always broken. This is not linked to what time you get in comparison to other times. It's just, the first autorecorded run you finish on a map will not be successfully recorded (this also applies to if you remove the folder mid-session, the next run will create the folder and thus also be 0KB). I kind of disapprove of the extreme redundancy of the file name format aswell, so if you're gonna dive into this code you could perhaps look at a better alternative for that.. Also, for it only to keep the personal best (or a custom specified number of demos would be even better, but supposedly harder too) and delete the rest would be a great feature.. you'd be spending hours just going into each individual folder and delete all but one or a few demos in each folder, if you put it off for a while :P

kalhartt commented 10 years ago

On linux x86_64, I'm not getting the 0KB issue or first demo issue. I vaguely remember K1ll complaining about some of the trap* filesystem commands and wonder if there are platform related issuses.

I agree on the naming format, I was thinking we could move the printf template to a user variable. Maybe rs_autoDemoName, need to see if Q_snprintfz supports positional syntax. Also do we wan't to include player name in the filename? Sanitizing the player name could be a pain.

I'm not sure about keeping best x demos per map, you can always do something like ls -1 | tail -n+4 | xargs rm. It might also be common to download other ppl's demos into the same folders (since its in a folder labeled autorecord I'm not against it). Also its easiest and cleanest to delete the oldest files, to delete the worst records we need to parse every filename in the directory, this smells impossible with the custom naming above.