GOG-Galaxy-Export-Script icon indicating copy to clipboard operation
GOG-Galaxy-Export-Script copied to clipboard

Rough draft of incorporating how long to beat times

Open shaapaoja opened this issue 3 years ago • 9 comments

Used the howlongtobeatpy to incorporate the how long to beat times. This does add a substantial amount of time to the script, so it probably should not be done by default.

shaapaoja avatar Dec 07 '20 23:12 shaapaoja

Created a draft pull request because I imagine there is a good chance that this is not how you would want this accomplished. Regardless I thought I would at least share what I put together because for a project I was working on I needed an idea on game completion times.

shaapaoja avatar Dec 07 '20 23:12 shaapaoja

There's nothing wrong with the code, although I'm wondering if we should merge this:

  • there's no way to know if the results in question are of the game itself, since it picks the best match from the results but we have no guarantees.
  • it significantly increases export times, it (obviously) went from a few seconds to several minutes now (not even finished yet). Update several more minutes later I interrupted it, and it was still at K.
  • unless I'm mistaken it's a single request for every single game. In my case there's about 1300 games, so it's 1300 requests in a handful of seconds. Sum it up for whoever does this at the same time, and we weaponized this tool into a DDoS vector.
  • there's no caching. It means that every time you re-export you redo all the requests all over again.

For smaller libraries it's a no brainer, but for huge libraries this can cause a lot of issues. If we want this feature, I would suggest doing a 2 pass for it, keep the export as is, and then use a second script to embed download times into the CSV, with caching to speed it up.

I'll let @AB1908 be the judge of that.

Varstahl avatar Dec 08 '20 11:12 Varstahl

Added significant performance improvements with the latest changes. I would suggest you try again as you have a larger library than I do. I looked into the howlongtobeat.com site and didn't see any particular way to get a batch of games at once except for using a steam ID, which clearly will not work for this case. I also ran this many times today and did not run into any DDOS type issues. Regardless if there is more that people can think of I would consider looking into helping more, but I personally believe it is in a pretty good state now. The first draft I knew was in a pretty rough state, but now I think it could actually be usable. I will obviously let you and @AB1908 be the judges though.

shaapaoja avatar Dec 10 '20 00:12 shaapaoja

Also forgot to mention I converted everything to be only in hours as I personally wanted to be able to easily sort by these times in Google Sheets. I created a number format of the following "# ?/? "Hours"; ; ; @" to show up nicely while being able to also add sorting.

shaapaoja avatar Dec 10 '20 00:12 shaapaoja

Wow, I've been busy and this was indeed on my todo list. This code is now far beyond what I can comprehend so I might have to do quite a bit of reading before I can fully understand and review the thing. Thanks for all the work though!

I think @Varstahl raised quite a few good points and I do prefer the output in hours as well. I believe converting hours to days, months, etc is quite doable on a user's end.

Initially, I had thought of doing a "percent match" when using HLTB and I'd set a threshold for a value to be accepted. Does the library have anything like that? If not, I suppose we'll have to come up other ideas lest we allow false positives to creep in. What are your thoughts?

AB1908 avatar Dec 22 '20 12:12 AB1908

I think it may have broken, for me the output file has "UNAVAILABLE" as every entry in the HLTB columns.

FolkSong avatar Oct 09 '21 07:10 FolkSong

I've been unable to test this as I've been busy with some other projects. Perhaps the HLTB wrapper has changed significantly since last this was used.

AB1908 avatar Oct 11 '21 10:10 AB1908

Just FYI I've started using Playnite which has HLTB and export plugins, so please don't look at this for my sake. I would suggest anyone using Gog Galaxy to give Playnite a try.

FolkSong avatar Nov 06 '21 19:11 FolkSong

I've done exactly the same. Playnite seems to be much better suited to my needs and offers native export options haha.

AB1908 avatar Nov 07 '21 14:11 AB1908