Giter Site home page Giter Site logo

syzygy's Introduction

System Syzygy

System Syzygy is a puzzle game, in the style of Cliff Johnson's The Fool's Errand and 3 in Three, and of Andrew Plotkin's System's Twilight.

https://mdsteele.games/syzygy/

License

System Syzygy is licensed under the GNU GPL, version 3. System Syzygy is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

System Syzygy is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

The complete license can be found in the LICENSE file.

Building and running locally

To compile and run the game without having to install a release package, run:

$ cargo run --release

(Building/running in release mode is highly recommended for playing the game; the non-release build enables some otherwise-distracting features intended for development/debugging, and also there's one particular late-game puzzle that runs quite slowly in debug mode.)

Alternatively, if you want to invoke the built binary directly, use the SYZYGY_DATA_DIR environment variable to tell the game where to find its resource files, e.g.:

$ cargo build --release
$ SYZYGY_DATA_DIR="${PWD}/data" ./target/release/syzygy

Building a release package

The below instructions are for reference purposes. To install a pre-built release package, visit https://mdsteele.games/syzygy/download/

Mac OS X

  1. Install the SDL2 framework under /Library/Frameworks/.

  2. Install cargo-bundle (version 0.4.0 or later).

  3. Run cargo bundle --release.

  4. Fix the binary's rpath:

    $ install_name_tool -add_rpath "@executable_path/../Frameworks" \
        target/release/bundle/osx/System\ Syzygy.app/Contents/MacOS/syzygy
  5. Strip the binary:

    $ strip target/release/bundle/osx/System\ Syzygy.app/Contents/MacOS/syzygy
  6. (Optional) Remove i386 architecture from the bundled SDL2 framework:

    $ BUNDLE="target/release/bundle/osx/System Syzygy.app"; \
        FILE="${BUNDLE}/Contents/Frameworks/SDL2.framework/Versions/A/SDL2"; \
        lipo "${FILE}" -remove i386 -output "${FILE}"
  7. (Optional) Sign the app bundle:

    $ codesign --deep --force --verbose \
        --sign "3rd Party Mac Developer Application" \
        --entitlements "data/osx/entitlements.plist" \
        target/release/bundle/osx/System\ Syzygy.app
    $ codesign --verify -vvvv target/release/bundle/osx/System\ Syzygy.app
  8. (Optional) Create signed installer package:

    $ productbuild --component "target/release/bundle/osx/System Syzygy.app" \
        /Applications --sign "3rd Party Mac Developer Installer" \
        "target/release/bundle/osx/System Syzygy.pkg"

Debian Linux

  1. Install SDL2:

    $ sudo apt-get install libsdl2-dev
  2. Install cargo-bundle (version 0.4.0 or later).

  3. Run cargo build --release.

  4. Strip the binary:

    $ strip target/release/syzygy
  5. Run cargo bundle --release --format=deb.

Windows

  1. Follow these instructions for installing SDL2 where Rust can find it.
  2. Run cargo build --release.
  3. Copy SDL2.dll to target/release/SDL2.dll.
  4. To create the zip archive, open target/release/ in Windows Explorer, select both syzygy.exe and SDL2.dll, right-click, and select "Send to > Compressed (zipped) folder".

syzygy's People

Contributors

mdsteele avatar michaelcmartin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

syzygy's Issues

"Zoom" for windowed mode

The windowed mode for syzygy is rather small on modern large monitors. It would be useful if there were a 2x or even 3x "zoom" for the window; the pixel-art nature of it would I think be fine with this (so each pixel becomes a 2x2 square of pixels in "2x zoom" mode). I think that there are relatively simple SDL features to enable this: SDL_RenderSetLogicalSize might be the way, although I am no expert.

(It might also be helpful to document explicitly that one needs --fullscreen=false to run in windowed mode.)

Immediate panic when compiled with Rust 1.48

If you build and run with the latest version of Rust, the main thread panics immediately after the window is created.

This appears to be due to a change in how uninitialized memory is handled in unsafe code:

mem::uninitialized will now panic if any inner types inside a struct or enum disallow zero-initialization.

This seems to be an issue with your fork of Rust-SDL2: upstream patched it as part of version 0.33.

The simplest workaround would simply be to note in the README that one should stick to rustc 1.47; a more aggressive fix would be to update your SDL2 fork to patch on top of the latest 0.34.2,

Debian package is invalid

After following the instructions to build a Debian package (plus installing libsdl2-dev, without which the build failed), when I try to install it I get this error:

$ sudo dpkg -i /home/qwandor/src/syzygy/target/release/bundle/deb/syzygy_1.0.0_amd64.deb
dpkg: error processing archive /home/qwandor/src/syzygy/target/release/bundle/deb/syzygy_1.0.0_amd64.deb (--install):
parsing file '/var/lib/dpkg/tmp.ci/control' near line 1:
invalid package name (character ' ' not allowed (only letters, digits and characters '-+._'))
Errors were encountered while processing:
/home/qwandor/src/syzygy/target/release/bundle/deb/syzygy_1.0.0_amd64.deb

can't start

After building the executable on Linux:

RUST_BACKTRACE=1 ./target/release/syzygy
thread 'main' panicked at 'screen_fade: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:1009:5
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:477
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:391
   6: rust_begin_unwind
             at libstd/panicking.rs:326
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   8: core::result::unwrap_failed
   9: syzygy::gui::resources::ResourceCache::get_sprites
  10: syzygy::modes::title::control::run_title_screen
  11: syzygy::main
  12: std::rt::lang_start::{{closure}}
  13: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  14: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:103
  15: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  16: main
  17: __libc_start_main
  18: _start

"make install" is missing

# Let's compile it

me@host:~$ sudo apt-get install libsdl2-dev python curl curl libssl-dev cargo rustc
me@host:~$ git clone https://github.com/mdsteele/syzygy
me@host:~$ cd syzygy
me@host:~/syzygy$ cargo build --release

# It does not run

me@host:~/syzygy$ ./target/release/syzygy
thread 'main' panicked at 'screen_fade: Error { repr: Os { code: 2, message: "No such file or directory" } }', libcore/result.rs:916:5

# So let's debug

me@host:~/syzygy/target/release$ strace -f ./syzygy 2>&1 | grep -i fade
[pid 25810] openat(AT_FDCWD, "/usr/lib/syzygy/data/sprites/screen_fade.ahi", O_RDONLY|O_CLOEXEC <unfinished ...>
[pid 25810] write(2, "screen_fade: Error { repr: Os { "..., 81 <unfinished ...>
[pid 25815] write(16, "\1\0\0\0\0\0\0\0", 8screen_fade: Error { repr: Os { code: 2, message: "No such file or directory" } } <unfinished ...>

# It seems like it is trying to open something that does not exist at that location

me@host:~/syzygy/target/release$ ls -lh /usr/lib/syzygy/data/sprites/screen_fade.ahi
ls: cannot access '/usr/lib/syzygy/data/sprites/screen_fade.ahi': No such file or directory

# How would I go about installing this in the proper place?
# Why is it not accessing it using paths relative to the main executable?

me@host:~/syzygy$ find . -name '*screen_fade*'
./data/sprites/screen_fade.ahi

sudo mkdir -p /usr/lib/syzygy/
sudo cp -r ./data /usr/lib/syzygy/

# This is my system

me@host:~/syzygy$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="18.04 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.