Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for non bethesda games #66

Closed
duran55 opened this issue Nov 17, 2024 · 7 comments
Closed

support for non bethesda games #66

duran55 opened this issue Nov 17, 2024 · 7 comments

Comments

@duran55
Copy link
Contributor

duran55 commented Nov 17, 2024

Any plans to add basic modding support for non bethesda games?

@cyberrumor
Copy link
Owner

Sims 4 support has been in the back of my mind for some time now. This isn't something I'll likely do soon, but I do want to do it eventually.

In order to support non-bethesda games, I'll need to do a fair bit of refactoring. I want to solve this with dependency injection. Each game could have a sort of strategy associated with it, where that strategy will consist of things like which folders mods get installed to; whether the game supports plugins, and if so, where those live, their file extensions, how they are ordered, etc.

Once the groundwork for this is done, it should be possible to add support for any game (not just Sims 4) by adding a strategy.

I'm hoping those strategies can primarily be dataclasses, but I suspect I'll have to write dedicated methods for at least some functionality, which is what I'm trying to avoid. I don't want a situation where I have to write an entire game-specific mod_controller for every game I want to support.

@duran55
Copy link
Contributor Author

duran55 commented Nov 17, 2024

What about a simple strategy where you need only to symlink (or copy) the files and nothing else.
I am currently modding Tomb Raider 123 Remastered and it is simply copying files in game dir.

@cyberrumor
Copy link
Owner

Assuming every mod is packaged perfectly, where you can just extract them to the game directory and do nothing else to get it working, it would be pretty easy. I figure the bulk of the work is adding the ability to manage games which support this, although maybe we already kind of have it with #42 (comment), though it requires bespoke configuration.

I suspect there's a small amount of games where modding is that easy, and even then, files might need to go into specific subdirs, and mods might not be packaged correctly.

In any case, I'll see if I can setup the dependency injection / strategy pattern and make a generic extract-to-game-dir strategy to utilize. Maybe split out the bethesda strat while I'm in there.

After that we can look at adding games which can utilize that strategy to the game selection menu so they don't require manual configuration.

@cyberrumor
Copy link
Owner

Quick update on this. We now have a ModController and a BethesdaController which inherits from the ModController. It's basically what I was trying to avoid but after looking at the problem for long enough, I decided it was the best way to proceed. Next steps are to get non-bethesda games loading with the generic ModController.

cyberrumor added a commit that referenced this issue Dec 14, 2024
Make controller.game detect the game directory called
"Tomb Raider I-III Remastered" for steam app ID 2478970. This game will
launch with the generic controller.mod, which is only tested implicitly
through tests for controller.bethesda.

I don't own this game so I haven't manually tested it.

If you have the file
`~/.local/share/ammo/Tomb\ Raider I\-III\ Remastered.json`
you will need to delete it or rename it in order for ammo to present the
automatically detected game rather than the game configured manually via
that file.
@cyberrumor
Copy link
Owner

cyberrumor commented Dec 14, 2024

Let me know if that works without your "$HOME/.local/share/ammo/Tomb Raider I-III Remastered.json". I don't own the game so I can't test it.

I think most mods should work, but just poking through the nexus, I noticed there's a few that might have extra folders above the directories named after integers. I'm not sure if they are supposed to be packaged like that or if you will manually need to remove the extra directory.

If you want to add support for more games that use the generic controller.mod, see commit d4abbf4 for an example. Feel free to submit PRs to add more compatible games.

Once I get some tests configured for the generic controller.mod, I'll start adding them to the list of supported titles in the README.md.

@duran55
Copy link
Contributor Author

duran55 commented Dec 14, 2024

Great! I updated ammo to latest and ran it. No game selection screen is present. After some digging I found this:

ammo looks for libraryfolders.vdf under .local/share/Steam/steamapps but I don't have such dir. I found the file with locate under:
~/.steam/steam/config/libraryfolders.vdf
~/.steam/steam/steamapps/libraryfolders.vdf

So it looks like my steam installation is under ~/.steam not ~/.local/share/Steam

Update: after fixing the steam path now I see the game selection screen. I will test further and let you know.

@cyberrumor
Copy link
Owner

Hey Duran, I'm going to close this ticket since it's now easy to add support for games that are compatible with extracting mods to the game directory.

Since it looks like Tomb Raider I-III Remastered mods are mostly going to expect to be able to overwrite original game files, ammo probably won't be able to support that due to it requiring a virtual file system in order to avoid breaking the vanilla game directory. Sorry about that. I'm going to remove it from controller.game, so you'll continue to need a json file at "$HOME/.local/share/ammo/Tomb Raider I-III Remastered.json" if you want to keep hacking at it on your fork.

I've opened #69 to track support for unexpected steam game directories. Pretty sure it should be safe to rely on the ~/.steam symlink to solve that problem.

I'll continue to explore further generalizations to lib.normalize and any other random stuff I notice in the future.

cyberrumor added a commit that referenced this issue Dec 14, 2024
The vast majority of Tomb Raider I-III Remastered mods are asset
replacers that work by overwriting the original game files.

The best way to solve this problem is with a VFS (similar implementation
to MO2). This is outside the scope of ammo since it would require ammo
to launch the game in order to expose the VFS to the game.

This reverts commit d4abbf4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants