demille / encrusted Goto Github PK
View Code? Open in Web Editor NEWA z-machine (interpreter) for text adventure games like Zork
Home Page: https://sterlingdemille.com/encrusted
License: MIT License
A z-machine (interpreter) for text adventure games like Zork
Home Page: https://sterlingdemille.com/encrusted
License: MIT License
Trying to build the project locally, and am running into some sort of conflict with wasm-glue. Has anyone run into this before?
Compiling wasm-glue v0.1.0
Compiling syn v0.15.26
error[E0425]: cannot find function `set_print` in module `io`
--> /Users/dan/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-glue-0.1.0/src/lib.rs:125:9
|
125 | io::set_print(Some(Box::new(printer)));
| ^^^^^^^^^ help: a function with a similar name exists: `_eprint`
error[E0425]: cannot find function `set_print` in module `io`
--> /Users/dan/.cargo/registry/src/github.com-1ecc6299db9ec823/wasm-glue-0.1.0/src/lib.rs:131:9
|
131 | io::set_print(Some(Box::new(printer)));
| ^^^^^^^^^ help: a function with a similar name exists: `_eprint`
The rustyline crate provides a nice and clean way to set up an interactive console while supplying tools for creating a history and navigating the command line.
I'm not sure when this was introduced, but typing x
as an abbreviation for examine
is a feature in most Z-machines I've used, and its absence is tedious.
I have been working on an Android port of encrusted and I forked the project to make it behave more like a library crate(removing all UI implementations, JS...). I then created my own crate that depends on it and implements the UI in a way that I want. I think it's always best to keep the core emulation code in a separate crate to be more reusable (like for example https://github.com/mikebenfield/euphrates).
Are there any plans to make encrusted a more developer-friendly library? As I said, I have a fork that Im working on that removes some parts of, but there are more parts I would like to revisit like the UI trait (I dont like the fact that the trait needs to care about the specific implementations), maybe a more generic Read/Write-like traits would be more suitable. In upcoming weeks, when I feel its something worth a PR, I will push the repo and we can discuss this further.
I think Z-machine emulator is something worth having as a library, because its pretty hard to implement well. And because of the size of the code I would much rather tweak this, than rewrite it from scratch.
I finished Infidel, it showed me final score and the game hangs (as it's supposed to.) I wanted to try something else for last move. Control-Z gave a bunch of z-machine errors, but then it put me back in the game, and I can do more control-Zs to back up, but RETURN doesn't do anything so I can't type commands.
Pressed back a few times and then issued a command and got the following error:
Unexpected zmachine error:
Error: Panicked at 'already borrowed: BorrowMutError', /checkout/src/libcore/result.rs:916:4
at env.trace.t (https://sterlingdemille.com/encrusted/worker.js:1:18917)
at t (https://sterlingdemille.com/encrusted/worker.js:1:8345)
at wasm-function[160]:622
at wasm-function[231]:310
at wasm-function[230]:117
at wasm-function[229]:123
at wasm-function[382]:147
at wasm-function[40]:139
at wasm-function[122]:3616
at b.feed (https://sterlingdemille.com/encrusted/worker.js:1:9896)
In the web browser, it sure would be nice to be able to select text so I can copy it to the clipboard.
After losing at Infidel, it asked Do You Want to Play Again? and not paying close attention I typed "restore" which crashed the z-machine. Then I couldn't use Encrusted anymore. Even if I open it in a new window, I get a z-machine error message and am stuck. Had to Delete Saves to get back to normal.
Use RegTest for running tests. This is a proven system which makes it very easy to add new tests.
Also, in addition to Czech and Praxix, I'd recommend Minizork for authentic Infocom, Advent.z3 for the modern ZILF compiler, and Curses.z3 (first release) for Inform.
And if you come across anything which isn't caught by Praxix, I'd always be happy to accept pull requests for more tests. :)
I tried to run Lost Pig and got this stack trace & error:
Pig lost! Boss say that it Grunk fault. Say Grunk forget about closing gate. Maybe boss right. Grunk not remember forgetting, but maybe Grunk just forget. Boss say Grunk go find pig, bring it back. Him say, if Grunk not bring back pig, not bring back Grunk either. Grunk like working at pig farm, so now Grunk need find pig.
thread 'main' panicked at '
Opcode not yet implemented: set_text_style (VAR_241) @ 0x27c7d
', /home/rory/.cargo/registry/src/github.com-1ecc6299db9ec823/encrusted-1.1.0/src/rust/zmachine.rs:1344:18
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:39
1: std::panicking::default_hook::{{closure}}
at src/libstd/sys_common/backtrace.rs:70
at src/libstd/sys_common/backtrace.rs:58
at src/libstd/panicking.rs:200
2: std::panicking::rust_panic_with_hook
at src/libstd/panicking.rs:215
at src/libstd/panicking.rs:478
3: std::panicking::continue_panic_fmt
at src/libstd/panicking.rs:385
4: std::panicking::begin_panic_fmt
at src/libstd/panicking.rs:340
5: encrusted::zmachine::Zmachine::handle_instruction
6: encrusted::main
7: std::rt::lang_start::{{closure}}
8: main
9: __libc_start_main
10: _start
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.