otavepto / gbe_fork

Fork of https://gitlab.com/Mr_Goldberg/goldberg_emulator
https://gitlab.com/Mr_Goldberg/goldberg_emulator
GNU Lesser General Public License v3.0
191 stars 55 forks source link

Tool to generate mods.json #122

Open M4RCK5 opened 2 months ago

M4RCK5 commented 2 months ago

What about having a tool that detects the folder names (mod id) inside "steam_settings\mods" and retrieves the mod info and thumbnails, kinda like "generate_emu_config.exe" but allowing the user to place it inside "steam_settings" so each path it generates in the "mods.json" file its relative to the "steam_settings" folder.

otavepto commented 2 months ago

The emu has something similar. https://github.com/otavepto/gbe_fork/blob/c48b5c4a3798f7245c3d89a36eacde1175215ddb/dll/settings_parser.cpp#L929-L935

Some things would be hard to detect though, ex: given a mod folder mods/112233/, with the equivalent mod_images/112233/

M4RCK5 commented 2 months ago

i was thinking on making an little script with culr + jq to get some info about the mods trough the steam web api (GetPublishedFileDetails) but idk how to know each "primary file"

otavepto commented 2 months ago

Yeah that's the main problem. It's a good idea nonetheless, tools which automate these configurations are always appreciated given how tedious these configurations are. If you stumbled on a discovery it would be great honestly 👍

M4RCK5 commented 2 months ago

Yeah that's the main problem. It's a good idea nonetheless, tools which automate these configurations are always appreciated given how tedious these configurations are. If you stumbled on a discovery it would be great honestly 👍

Atm i've made some batch scripts to setup the emu easily with the most commont options, im using editenv to filter the user input for some options and also using steamless_cli + generate_emu_config (its mostly just "write the app_id/build_id, login to get the achivements, drag and drop the executable and done) and i was thinking on moving it to golang as an excuse to try that language (also having a low footprint cli tool for all os could be great).

Also i have some scripts to get the mods trough steamcmd and added support for collections too using the steam web api so thats where the idea came from.

Another things ive seen with the emu are: -Some games need the "force_language.txt" file and with others it doesnt even work (old build of Rocket League, need more testing), what about making it so when u have that file and its empty it forces the language thats on "steam_setttings\settings\launguage.txt" that way we can force the language that we set trough the overlay without having it on two diferent files. -DX12 achivement images show with glitched colors (Deep Rock Galactic latest build)

Edit: Using steamcmd i found that the mod filenames are inside the "depotcache/*.manifest" files and used this to dump its content, maybe SteamKit2 can help with this (if it can retrieve the ".manifest" files it could be even better).

PD: the latest emu-win-release.7z trows a false positive, can it be reported to microsoft maybe to solve it??

otavepto commented 2 months ago

If you already had luck with steamcmd/SteamKit2 and created a tool maybe it's better to link to your work instead of integrating it directly, since that's more maintenance.

Regarding the antivirus report, that's basically every release 😄 every time. It cannot be solved due to the randomly generated fake certificate during the build.

If steamcmd/SteamKit2 can actually tell the primary file that would be almost 50% of the problem done, the tool can then read that file from disk, calculate its size and generate the corresponding JSON entry. I assume the preview file would be also available, while it is just an image, some games will hang or cause a weird behavior if they can't read that file.

The rest of the JSON object are more cosmetic than an actual necessity, like votes up vs down, mode score 0.0 --> 1.0, name and description, etc... These could be generated randomly, and the name of the mod could be set to the name of it's folder.

M4RCK5 commented 2 months ago
  • language.txt is only read from the global settings folder, it won't work if it's placed inside the local steam_settings folder. If it doesn't work, probably the game isn't using Steam APIs to query the language since that's what this file changes really.

What if im using "local_save.txt (.\steam_settings)"?? Actually i always use it that way so i can pack the game with the emu (sorry im not fully understanding how it works).

If you already had luck with steamcmd/SteamKit2 and created a tool maybe it's better to link to your work instead of integrating it directly, since that's more maintenance.

Gonna see what i can do, if i have some success with it ill let u know.

otavepto commented 2 months ago

local_save.txt will do the trick 👍 , basically it forces the path of the global saves folder, on Windows it is %appdata%\Goldberg SteamEmu Saves\. You can definitely use the local save to change that.

https://github.com/otavepto/gbe_fork/blob/ca8fb4bc358f2e726715c5796fdbedebe28cd2d9/dll/settings_parser.cpp#L1324-L1326