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
193 stars 56 forks source link

Controller_config_generator #71

Closed DogancanYr closed 4 months ago

DogancanYr commented 4 months ago

gbe_fork/tree/dev/tools/generate_emu_config/controller_config_generator Can it be added as an exe to the Tools section ?

otavepto commented 4 months ago

It's a simple python script, could be run like this:

DogancanYr commented 4 months ago

It's a simple python script, could be run like this:

* Install python >= v3.10

* Change directory to `tools\generate_emu_config`, then open CMD

* Run `recreate_venv_win.bat`,
  This creates a virtual python environment

* Run `.env-win\Scripts\activate.bat`
  This will activate the virtual environment

* Run the python script and pass the vdf file
  `controller_config_generator\parse_controller_vdf.py xbox_controller_config.vdf`

I know, but some games require a controller file and users who are not familiar with Python cannot run it. Besides, I didn't even know this existed, I thought everything was in the releases section. Can't you add this to be more user friendly ? Please .

DogancanYr commented 4 months ago

Can't it even be added to the generator to automatically create controller config ?

otavepto commented 4 months ago

Yeah it's really not intuitive, I'll add the steps to use these scripts in the main/front readme. The release readme is more oriented towards the main script generate_emu_config in its binary form, hence adding these steps won't make sense there, as the end user cannot access the python scripts.

In the original repo only the .py scripts were offered anyway, and I wanted to compile the main script since it's the only one I use. Maybe I'll look into producing other scripts in binary form later.

otavepto commented 4 months ago

Now both achievements_gen.py and parse_controller_vdf.py are compiled into separate .exe files, they can also accept multiple files at once from the command line. When you run them without any input, they will display a simple help page. Give them a test, from the PR's build artifact, and let me know your feedback/

DogancanYr commented 4 months ago

I think the pull request could not be compiled.

otavepto commented 4 months ago

These are just the regular emu builds, I cancelled them since the emu code wasn't changed, but the generate_emu_config build was successful

DogancanYr commented 4 months ago

After I learned that I can download the structure created from the Action header, it works as it should, does default.txt have an effect or is it there to be a sample file.

otavepto commented 4 months ago

It's one of the generated mappings so not an example, I don't know really if a game would read that, potentially similar to #64

DogancanYr commented 4 months ago

Do you planning to add it into the config generator soon ?

otavepto commented 4 months ago

It's already released 😄 Check the releases section, it's bundled inside the generate_emu_config archives

DogancanYr commented 4 months ago

This also works, but when I create steam_settings from the generate_emu_config file, it does not create it automatically. I have to create it with the parse_controller_vdf file. It adds extra steps, By default or -controller command can be added.

otavepto commented 4 months ago

Yeah this happens because the main script generate_emu_config only looks for xbox one and xbox 360 .vdf files. You can see the code here https://github.com/otavepto/gbe_fork/blob/883dfac04f7c9a118fd900e5fe8870c2aa96001f/tools/generate_emu_config/generate_emu_config.py#L803

But now since the vdf parser is a separate exe, you can easily workaround that and generate the config from any vdf file. Grab the vdf file from the backup folder which is generated when you run the main script.

DogancanYr commented 4 months ago

It is true, but other people or those who published the cracked game on cs.rin will not implement this much and some games will not have controller support and this will cause problems for people.