Code Monkey home page Code Monkey logo

zork's Introduction

README


UPDATE: Because I either have too much time on my hands, or an odd (borderline unhealthy) obsession with all of this, I've been using AI image generators to create pictures of various locations in Zork. In a separate project I've put together an http server that will display room images as the user moves from place to place. It's not integrated here yet because I don't really have enough images to make it worthwhile, but it's been a fun thing to play around with. Images I have so far are saved in the zork_pics folder. Filenames are the room ID (the first string for each room in roomdefs.h). If I can come up with enough rooms I might add the server to display them as you play. My current server supports png and jpeg (as you can see by the various generators I've used, which create images in different formats). If anyone wants to contribute, add an image and send a pull request! I can promise you neither fame nor fortune, but you can rest easy knowing you've contributed to a bit of Zork history.


This is a C++-20 port of the final 616-point Zork, written at MIT around 1978-1981. The goal was to do a port as directly as possible, meaning that the original logic, structures, functions, modules, etc. are ported as-is. Therefore, it is not necessarily the most "C++" way of doing things. The main exceptions to the MDL code are saving/restoring, which uses the Boost serialization libraries, and I/O, which uses C++ cin/cout. Restarting also needs platform-specific code to find the application's location. There is also no attempt to obfuscate or encrypt any of the text, rooms, puzzles, and so on. With the number of walkthroughs on the internet, it seems pointless to take such precautions.

The port has become more of a project for me to play around with new C++ features as they're added, so updates that are posted recently probably aren't fixing anything or changing any functionality. Hopefully they're not breaking things either...

There is a full map of Zork here: https://www.reddit.com/r/zork/comments/10tlxfd/new_zork_map/.

One additional modification: Use the "TERMINAL" command in Zork to simulate the feel of a 1970's-era terminal output.

Builds are supported for Linux (gcc-13 required), MacOS and Windows (32 and 64 bit, Visual Studio 2022 required). There is nothing using any non-standard C++ anywhere in the code, so it should be simple to port to other platforms. It also makes extensive use of C++-20 features, and thus a C++-20-compliant compiler is required.

Build requirements:

Boost (www.boost.org) - Requires the filesystem, serialization, and system libraries. This build used version 1.85.0, though earlier versions will probably work fine, within reason.

CMAKE BUILD

Presets have been added for Linux, Mac and Windows. Presets will be created in the "out" subdirectory. CMake Build Recipe (Tested in Ubuntu 22.04 w/ gcc 13.1.0).

The presets use Ninja for the build. Other build systems are untested, but would presumably work.

zork's People

Contributors

jclaar avatar jclaar4 avatar michaelveth avatar

Stargazers

 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

zork's Issues

Arrow keys

Could you add support for left/right arrow keys to edit the command line in place and up/down arrows to access a command history?

Issue with your 585-point map

https://u.pcloud.link/publink/show?code=XZtedOXZS9FFLIh4HHSGeYd7Dr8Rb8Juhfwk

Here is a link to download my digital copy of the finalized 616-point map. This is the map the original creators made back in the day, but unlike the usual copy this one has been completed with the later puzzles... and the quality is perfect, not that old aged copy.

Sorry to submit this as an issue but I couldn't find another way easily.

...Jeremy Kapp

P.S. This is super high resolution and the size is 36x24, the standard poster size. Fit's a poster frame if printed.

Zork crashes if not in current path

Zork crashes if the executable is not in the current path:

$ which zork
/usr/games/zork
$ ls zork
ls: cannot access 'zork': No such file or directory
$ zork
terminate called after throwing an instance of 'boost::process::process_error'
what(): execve failed: No such file or directory

Patch for upstream version from Bitbucket

--- mdlfun.cpp	2019-12-28 22:40:39.384126978 +0000
+++ mdlfun.cpp	2019-12-28 23:04:55.587833908 +0000
@@ -9,6 +9,7 @@
 #pragma warning(disable: 4244)
 #include <boost/process.hpp>
 #pragma warning(default: 4244)
+#include <boost/dll.hpp>
 
 std::string pw(SIterator unm, SIterator key);
 std::string username();
@@ -54,7 +55,7 @@
 		// exit.
 		while (status == 1)
         {
-            boost::process::child c(argv[0], "-go");
+            boost::process::child c(boost::dll::program_location(), "-go");
             c.wait();
             status = c.exit_code();
         }

I also needed to add libboost_filesystem.a and -ldl for the link step in the makefile.

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.