Closed tylerdq closed 1 day ago
Possible duplicate of #24
BrogueCE is another project that provides a nice solution to a similar challenge (although that game is written in C not Rust): https://github.com/tmewett/BrogueCE/blob/master/linux/brogue-multiuser.sh
@tylerdq this makes sense and seeing the BrogueCE implementation helps. What would be your ideal way to configure this? Would an ENV var work? SOKOWORLD_ASSETS=/some/path
Let me know how you'd expect this to be determined and I can implement it.
I could also add a CLI arg for when the sokoworld
executable is run, something like sokoworld --assets=/some/path
.
I was thinking a build option but an ENV var is good as well. If a CLI arg is preferable for you though that would work fine! For example, if it ends up being a CLI arg I'd just make an abbreviation for sokoworld on my end in my shell (fish).
After considering a build option further with reference to the cargo-build documentation I realize I don't actually understand how that could be implemented. So one of the two solutions you suggested would probably work best.
@tylerdq I added support for this in https://github.com/brettchalupa/sokoworld/pull/44, which merged into main
and will be in the next release (v0.3.0). I tested it a bit locally, and both the env var SOKOWORLD_ASSETS
and the --assets
CLI arg are working as expected. It's kind of a nice feature in that it allows someone to mod the game, add custom levels, change the sprites, etc.
You should be able to run it now like this:
/usr/bin/sokoworld --assets ~/.local/bin/sokoworld/assets
Or wherever you want to put things. Let me know if you run into any issues!
Very nice. I rebuilt and both of these approaches work for me. I'm having issues actually playing it due to an unrelated issue with alsa but I need to investigate that more to see if something is misconfigured on my system.
Thank you!
On Linux, after building I copied the sokoworld binary to
/usr/bin/sokoworld
and when I try to run the game I get the following error:Is it possible to configure the build to install the game data to another folder that the binary can reference at execution, or is it a hard requirement that the game needs to be executed from the distribution folder?