Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Add Stardew Valley Support #593

Closed
wants to merge 9 commits into from

Conversation

kurumushi
Copy link

This will add Stardew Valley Support to the installer. This supports the Windows version of SDV, running on proton. It does not support the native version. I have not yet tested extensively, but it seems to work for me with no issue.

The only change I made was to add a run-command argument to protontricks, allowing you to run an arbitrary command inside the prefix. This was done so that I could use the SMAPI installer, rather than choosing individual files via game_scriptextender_files. SMAPI can be a moving target, and in my opinion, it's easiest left to let it handle it's own additions and subtractions.

I also added a new variable "game_smapi_version" to facilitate both the downloading and installing SMAPI with minimal changes needed on upgrade. This could be changed to a more universal variable if others find the need for something similar.

As it stands, the installer is heavily focused on bethesda titles, and I tried to keep within the existing paradigm as much as possible, but in the future it may be a good idea to make a few tweaks making non-bethesda games easier to add.

@kurumushi
Copy link
Author

One caveat that I've discovered is that just like the installer, SMAPI requires wineconsole to run. This is easily done by editing the executable in MO2 to point to "C:\windows\system32\wineconsole.exe" and adding the proper path to SMAPI.exe as the arguments.

Copy link
Owner

@rockerbacon rockerbacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking the time to work on this. Looks almost good to go, just take a look at the comment below and also:

One caveat that I've discovered is that just like the installer, SMAPI requires wineconsole to run. This is easily done by editing the executable in MO2 to point to "C:\windows\system32\wineconsole.exe" and adding the proper path to SMAPI.exe as the arguments.

Could you add instructions on how to do that to post-install.md?

There should probably be some feature that automatically sets up executables within MO2, that's a common requirement for a few things. But that's for a future PR.

# This command is ugly, but necessary
# Needs to run through wineconsole in order to work with .NET's System.Console

"$utils/protontricks.sh" run-command "$game_appid" "wineconsole '${extracted_scriptextender}/SMAPI ${game_smapi_version} installer/internal/windows/SMAPI.Installer.exe' --install --no-prompt --game-path 'Z:\mnt\lingames\SteamLibrary\steamapps\common\Stardew Valley'" \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --game-path parameter seems to be hard-coded to a specific location in your system, which isn't a portable solution.
The "game_installation" variable set by load_gameinfo.sh will hold the install location. This should convert it to a Windows path:

echo "$game_installation" | sed -e 's/^/Z:/' -e 's@/@\\@g'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, the path was definitely a mistake on my part. Rushed from the yelling at the computer phase to the clean up for pull request phase. 😛

@kurumushi kurumushi requested a review from rockerbacon April 13, 2024 01:39
@rockerbacon
Copy link
Owner

Looks good to go. I just need some time to test a few things and we can move for a merge and release.

@rockerbacon
Copy link
Owner

Ran some tests today and noticed the Stardew Valley install directory isn't automatically detected by MO2 during instance setup. Can you confirm that?

@kurumushi
Copy link
Author

It is not on my test either. Should it be? I thought it was just a quirk of running MO in wine.

@rockerbacon
Copy link
Owner

It is not on my test either. Should it be? I thought it was just a quirk of running MO in wine.

All currently supported games are automatically detected with no additional work required. I don't know how the MO2 detection algorithm works, it is possible it doesn't work for SDV or that it may need some additional hints.

We can't proceed with it as-is because:

  • Most users won't know where the game is installed
  • Wine's file picker hides "hidden" files and folders by default and the only way to show them (that I know of) is a setting in Winecfg. This is a huge problem for the default libraries which lie within either "~/.local" or "~/.var"

What we need to evaluate:

  1. Does directory detection of SDV work on Windows?
  2. How does MO2 search for the SDV directory? I took a quick look at the MO2 Source Code but couldn't immediately find the code that does it.
  3. Can we automate a solution that allows the SDV directory to be found?
  4. If the above is not possible, can we pre-configure MO2 to automatically use the correct path and skip instance configuration?
  5. If the above is not possible, how do we provide users with information on how to find their game?

Copy link
Owner

@rockerbacon rockerbacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to address the issue of the SDV directory not being found before continuing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants