nstlaurent / DoomLauncher

Doom Launcher is a doom launching utility and database for custom wads and pk3s
GNU General Public License v3.0
225 stars 19 forks source link

Use -levelstat instead of -statdump for Woof/Nugget #295

Closed Dezaimasu closed 6 months ago

Dezaimasu commented 10 months ago

As described here https://github.com/fabiangreffrath/woof/issues/1313 -statdump stats.txt will not output the statistics for E*M8 levels, unlike -levelstat

Dezaimasu commented 8 months ago

So it's already done in the latest release, thanks a lot for that. But now sometimes it won't grab the stats from levelstat.txt file for some reason. Yesterday I played a wad and and everything worked perfectly, saved all stats from first 3 maps, but today I was back to playing it, beat level 4 and DoomLauncher didn't saved anything. Here's the levelstat.txt file that was in NuggetDoom folder, this one wasn't grabbed by DoomLauncher for some reason. levelstat.txt

Dezaimasu commented 8 months ago

The problem in MAP04 - 43:50.80 (1:28:46) K: 207/206 I: 66/66 S: 1/1 is (1:28:46) Apparently it was not expecting hours in par time in brackets so it wasn't able to parse this string. The same levelstat.txt file but with 1: in par time removed works just fine: MAP04 - 43:50.80 (28:46) K: 207/206 I: 66/66 S: 1/1

nstlaurent commented 8 months ago

That is because writing hours is technically incorrect. The format from prboom only writes minutes and seconds. So 1 hour and 28 minutes would 88 minutes. I might be able to work around it.

stats[level].stat[TT_TIME]/TICRATE/60, (float)(stats[level].stat[TT_TIME]%(60*TICRATE))/TICRATE, (stats[level].stat[TT_TOTALTIME])/TICRATE/60, (stats[level].stat[TT_TOTALTIME]%(60*TICRATE))/TICRATE, stats[level].stat[TT_ALLKILL], stats[level].stat[TT_TOTALKILL], all[level].kill, stats[level].stat[TT_ALLITEM], stats[level].stat[TT_TOTALITEM], all[level].item, stats[level].stat[TT_ALLSECRET],stats[level].stat[TT_TOTALSECRET], all[level].secret );

Dezaimasu commented 8 months ago

In case you need it, the wad is here /idgames , the NEW.WAD. It a very old wad, and it doesn't have any custom DEHACKED/MAPINFO so it's should be the default MAP04 value. Which is apparently only 2 minutes? I'm not familiar with how it works, I thought par time was a static value, but here it increases the longer I play the map.

Also I checked the Woof repo, it was implemented like that back in 2021 https://github.com/fabiangreffrath/woof/pull/232 and hasn't changed since. It explicitly uses hours: https://github.com/fabiangreffrath/woof/blob/1797adf6acc351184527f4432be3322c5b79de61/src/g_game.c#L1384

In PrBoom+ (I assume that's where it was first implemented) it is indeed only minutes and seconds, no hours https://github.com/coelckers/prboom-plus/blob/969515162c5aebea4ad7a125ee178dcad3d576ad/prboom2/src/e6y.c#L1029 But I'm not sure if this should be reported to Woof devs as a bug considering there are no strict specs for -levelstat feature.

nstlaurent commented 8 months ago

I agree. I don't think anyone is really parsing these outside of Doom Launcher anyway. I have a fix that should work for everything. Build here

nstlaurent commented 6 months ago

Fixed with 3.7.5