Zork for Lync - Part 1

You are standing in an option field west of a white house, with a boarded front door. There is a small mailbox here.


Saturday, 12 July 2014

 

zork1_osxOk, maybe not only Zork for Lync specifically, but a Z-Machine interpreter for Microsoft s Lync platform.

But first, a little history 

Back in the 1970 s, Joel Berez and Mark Blanc created the Z-Machine, the virtual machine used by games company Infocom to deliver its text adventure games, such as Zork, Planetfall and the Hitchhikers Guide to the Galaxy.

These types of games are known as Interactive Fiction, simulated environments in which players use text commands to control their characters as the game plays out. This was before the days of colour graphics, animation and Xboxes!

One of the first computer games I ever played was Zork, on my old Apple ][e (which still runs great today!), so I gave myself a challenge of creating a Zork clone using Lync as the console.zork

Zork was written in 1977, and utilizes a specialized virtual machine created specifically for the game, interpreting the ZIP (Zork Implementation Language) code.

Today, there are many different Z-Machine interpreters, for a number of different platforms, but as I spent a large amount of my day inside Lync, it seemed logical to extend the capabilities of the UC platform to include  non-business  application.

Building a Z-Machine

Creating a Z-Machine interpreter is not a simple task, however the standard is well documented, and many people have accomplished this in the past. For the purposes of simplicity, and to allow my interpreter to utilize a large catalogue of games, I ll be working with the .z5 format, and testing using games compiled by Infocom in the 1990 s using Zilch.

The application will parse and interpret a decompiled instance of the .z5 files. The output resembles assembly at first glance.

l0007:         jeg57 #84 ~l0008 
               jeg48 #15       rfalse 
               print_ret      "Why don't you just walk like normal people?" 
l0008:         jeg57 #63 ~l0009
               print_ret      "How romantic!"
l0009:         jeg57 #3b ~rfalse
               get_parent     "mirror" local0
               get_parent     "mirror" sp
               jeg6b local0 sp ~l0010
               print_ret "Your image in the mirror looks tired."
l0010:         print_ret "That's difficult unless your eyes are prehensile."

Where does Lync fit into this?

Traditionally, Z-Machine interpreters utilize simple text-based consoles for interacting with the player. This can be via a java or html5 app, an iOS app, or other desktop applications for a variety of operating system.

Lync, in its simplest form is an Instant Messaging client   having the ability to send and receive text messages between Lync or Skype users.

My Z-Machine interpreter passes its output to the Lync application, and receives commands from the user simultaneously.

One of the great advantages of this is persistence and continuity   in normal console games, the user needs to leave the console open to continue playing.

With Lync, gameplay is controlled by the Z-Machine interpreter, and can be continued at any time without having to open a console or other application. Players can move between Lync clients across their devices (PC s, tablets, smartphones) and continue their game at any time.

Communicating with Lync

Lync is complex Unified Communications platform, providing Instant Messaging (IM), Audio and Video conferencing, Application sharing and more.

Microsoft have made available a number of APIs for Lync, and I have chosen UCWA (Unified Communication Web API) as the means to communicate with the Lync client.

zork4lync

Component Description
Hosted Lync Service The beta system is based on telewebica s hosted Lync platform, a multi-tenant Lync 2013 service.
Virtual Lync Client (UCWA Endpoint) Each player communicates with a virtual Lync client, or endpoint, that is dynamically created and connected by the Z-Machine interpreter. As players exit the game, endpoints are disposed of, re-creating themselves when a player returns.
Z-Machine Interpreter Windows server application
SQL Server 2014 Stores game state and analytics
Z5 File Zork 1 game file (or any other ZIL-based game)

Progress so far

Basic command and text processing is working, my next step is to start creating a simulation of the ZIL memory and stack subsystems to persistently track location and inventory.  Whilst still in a very early form, it’s starting to come together.

capture1 Capture2

 

Get involved

Interested in helping test this app? Contact me via email or on Lync, and I ll send you details on how to connect to the Interpreter.

Once it s a little more stable, I ll publish details of it here for people to play.

What s Next

Part 2 of this series will show more detail on the UCWA conversations required to build this project.

References

Z-Machine Standard – http://inform-fiction.org/zmachine/standards/index.html

How to Fit a Large Program in a Small Machine – http://mud.co.uk/richard/htflpism.htm

UCWA   http://ucwa.lync.com

Get Lamp   a documentary about adventures in tet – http://www.getlamp.com/

 

 

 

Tags

Code, IT, Lync
Share with: 



Support this Site



Popular Articles

What is Kutamo?
Kilimanjaro 2023
Kilimanjaro 2015
Kilimanjaro 2013
Australian Postcodes
New Zealand Postcodes
Worldwide City Database

Recent Articles

Favourite Links

Kutamo Studios
ErrLog.IO
Kutamo
AfterTheCloud
Kilimanjar 2023