Recent

Author Topic: Programming your own adventure games in Pascal  (Read 1682 times)

BobS

  • Full Member
  • ***
  • Posts: 153
Re: Programming your own adventure games in Pascal
« Reply #15 on: June 09, 2019, 09:10:56 pm »
I
Most other books I've seen on the topic are based on a dialect of unstructured BASIC.

BobS: I already had that site bookmarked, as I used to enjoy the old Infocom games. I think there are even a couple of ZIL compilers available. Unfortunately, Infocom used to have a separate interpreter for their games, so most of the actual processing was done was by that.
I've forgotten anything I knew about LISP, but still looking at the code it shouldn't be too hard to figure out what is going on and translate it to Pascal.  But I keep getting distracted by the text...especially Hitchhikers guide, some of which was written by the great man himself :) .

lainz

  • Hero Member
  • *****
  • Posts: 3197
    • Lainz
Re: Programming your own adventure games in Pascal
« Reply #16 on: June 09, 2019, 11:00:13 pm »
A lot of years ago I wanted to make a point and click game that's a kind of adventure game, I made small stuff like single level games but this tool is great for it

https://www.adventuregamestudio.co.uk/

You can also download games made by other people and see.

"The AGS Editor is a Windows-based IDE for creating your games as quickly and easily as possible. Everything you need from importing graphics and writing game scripts right through to testing your game, under one roof!"

I know that these games can be made with Pascal, but if is just for fun and no need to stick to Pascal, I always prefer the most easy tool for each job.

Wysardry

  • New Member
  • *
  • Posts: 17
Re: Programming your own adventure games in Pascal
« Reply #17 on: June 10, 2019, 02:26:38 am »
BobS: I believe ZIL is based on MDL, but with fewer instructions.

As far as I know, decyphering just the ZIL code would not teach you everything about how Infocom games worked as they are mostly data with the Z-machine interpreter doing a lot of the actual processing.

I'm not 100% sure, but I think the parser is built into the Z-machine interpreter (which is different for each platform).


Lainz: I'm not really interested in creating point and click graphical adventures, as my artistic skills are virtually non-existent and making them cross platform is more complicated.

Text adventures are also more practical for lone developers.

BobS

  • Full Member
  • ***
  • Posts: 153
Re: Programming your own adventure games in Pascal
« Reply #18 on: June 10, 2019, 02:51:57 am »
It's definitely a derivative of Lisp, you can see that in code.  But really just reading the text gives you a pretty good idea of how it was all set up.  I haven't looked into that sort of thing for a long time, but really I'd think the basics are pretty simple.  Create your story; set up a map (linked list or sparse array); set up what happens in each node and the conditions (like what you might have to carrying) to get out of it are (to each connecting node) and you have the bulk of the work done.  Maybe I'm forgetting something, but I think that's pretty much all there was to it programming wise.  The text was by far the most important part, as that's all there was to spark the imagination.

Wysardry

  • New Member
  • *
  • Posts: 17
Re: Programming your own adventure games in Pascal
« Reply #19 on: June 10, 2019, 03:58:55 am »
MDL is based on Lisp, yes. It was created at MIT, I believe. Some of the people involved in its creation started Infocom and created a subset called ZIL (Zork Implementation Language).

I'm guessing that parsing the player's text instructions would be the hardest part, especially if it can handle more than just two word verb noun phrases like "open door". The Infocom parser could understand instructions like "take the leaflet then read it" or "take all except the red ball".

BobS

  • Full Member
  • ***
  • Posts: 153
Re: Programming your own adventure games in Pascal
« Reply #20 on: June 10, 2019, 04:49:03 am »
I don't think I ever played one that accepted more than two word commands with a limited number of commands available.  But really how many actual commands did they have?  Not counting synonyms.  I doubt it was many, things would have gotten too slow on those old systems. 
...
A short time later his brain slowly started functioning after his encounter with real life:
Now that I think about it I did have a game that was based on Zork (or something similar), but got frustrated because it kept saying, "sorry I don't understand that" or something to that effect most of the time when I typed in what seemed like a reasonable command sequence (like: "face east and pick up the moonstone").

I seem to remember there is a whole web site somewhere devoted to text adventures that I read about a few years ago...I wonder what they use to develop them now?

Wysardry

  • New Member
  • *
  • Posts: 17
Re: Programming your own adventure games in Pascal
« Reply #21 on: June 10, 2019, 11:14:29 am »
Even Colossal Cave Adventure had a vocabulary of almost 200 words (although they were all just three letters long). I have heard that some later games can understand over 1000 words.

There are a few popular sites on text adventures and interactive fiction, including Brass Lantern (quite dated), The Interactive Fiction Archive and Planet IF.

Info on many creation tools - both past and present - can be found in the Authoring System category of ifwiki.

BobS

  • Full Member
  • ***
  • Posts: 153
Re: Programming your own adventure games in Pascal
« Reply #22 on: June 12, 2019, 06:26:23 am »
Well there look to be some decent tools available, so anything done in Pascal along those lines might not be worth the effort if the goal is to write adventures and not to learn the programming techniques.  But if was me, I'd start with something simple.  Really the parsing is not going to be that hard...it's not like you're trying to translate from Russian to English or something.  Some long case and if structures could probably do a lot of it.  Main problem will be dealing with things like "pick up foot", does that mean pick up that statue foot object or is the character supposed to pick up a foot (maybe in prep for hopping) (this is a contrived example of course).  You're either going to be doing a lot of what they did on Star Trek when the computer keeps saying "specify" or have quite a bit of context awareness built in to figure out the ambiguities.  Anyway I'd just start with a simple two word command structure, and once you've got that all figured out expand it to to handle more complex structure with what you've learned.

Edit: Main thing I meant to say was thanks for the links, very interesting--than I got busy writing that over long paragraph  ::) .
« Last Edit: June 12, 2019, 08:23:11 am by BobS »

Wysardry

  • New Member
  • *
  • Posts: 17
Re: Programming your own adventure games in Pascal
« Reply #23 on: June 13, 2019, 04:46:56 am »
I have several goals, one of which is to learn how to program in Pascal. Others include learning how to create more advanced text adventures games and hopefully to create a system that will make that easier for multiple platforms.

I'm not 100% happy with any of the currently available authoring systems, but I do intend to try a couple to learn how they work. My main issue with them is that they all use a separate interpreter/virtual machine, rather than compiling to a binary executable.

The development environments are also not very cross platform, which I find strange given that they aren't very resource intensive. At least two are written in .Net languages though.

I'll most likely start by trying to recreate one of the early public domain adventures - such as Colossal Cave Adventure - using an authoring system and then again from scratch in Pascal. I'll then move on to bigger and more complex games with better parsers.