vittorioromeo/SSVOpenHexagon

Already downloaded Steam packs don't load if Steam API can't be retrieved.

Morxemplum opened this issue · 3 comments

While this really isn't that much of a bug per se, it definitely is a bit of an issue if you want to play Open Hexagon purely offline. Most people haven't been aware of this issue until now because most people launch Open Hexagon with a pre-existing internet connection. This internet connection allows them to connect to the Steam API and tells Open Hexagon to fetch all of the steam downloaded packs and load them into the game.

However, being online and offline doesn't make a difference when it comes to workshop packs that are already downloaded. They are still there because the files are stored locally on your computer. However, because you can't connect to the Steam API in a completely offline environment, Open Hexagon decides to not load in the workshop packs, reducing the user's experience.

I feel like even though we can't connect to the Steam API, we still should load any workshop packs that have been downloaded. It would greatly enhance the offline experience and help sell Open Hexagon better as an offline game. Open Hexagon already makes great contrast to many games today, which increasingly rely on the internet.

The main benefits of having an internet connection to Open Hexagon should only be to everything that ties in with Steam, such as getting achievements and participating in the leaderboards. And of course, Open Hexagon players should go online every now and then to ensure that their custom packs are up to date. However, everything else can be done without an internet connection.

Alright so I found the code excerpt that is responsible for loading the workshop packs
https://github.com/SuperV1234/SSVOpenHexagon/blob/10eb8abbe7c124eca2d59bfeb6739bb447b5377f/src/SSVOpenHexagon/Core/Steam.cpp#L216-L229

And that function definition is defined here
https://github.com/SuperV1234/SSVOpenHexagon/blob/10eb8abbe7c124eca2d59bfeb6739bb447b5377f/src/SSVOpenHexagon/Core/Steam.cpp#L185-L214

So I am noticing that the function uses SteamUGC(), which probably means that the function relies on the use of the Steam API to locate the packs and load them in.

If we want to solve this problem, we would need to either cache the locations in a file and read from the file when the steam API fails to load, or we can try to predict the directory that contains the packs and check that directory and load any packs that are in there.

Of course, this is meant to be an offline solution. So if the user either moves the packs somewhere else or delete the cache, then it won't be able to find those packs.

Each solution has their advantage and disadvantage

Creating cache would:
(+) Much less likely to fail
(-) We'd need to connect to the internet once to create / update the cache.

Prediction would:
(+) Don't need to connect to the internet to locate and load
(-) Much more likely to fail, as the user may be storing their workshop packs in a different location

I would much prefer to do caching, but if anybody objects feel free to comment.

This was completed, thanks.