Since there have been a few questions and some talk about Alan, I
thought it would be a good idea to introduce Alan to you ;-).
Alan is a system to define text based adventures, or interactive
fiction (you knew?). A primary design decision is that it should be
very easy to define the basic structure of your story so the system
supplies reasonable default behaviour unless you specify otherwise.
The system directly supports concepts found in all the 'classic'
adventures, locations, objects, actors etc. So perhaps that type of
interactive fiction is currently best supported.
Through a special 'syntax' declaration the author can define complex
and flexible player input and connect that with the actions that it
should result in.
The main idea behind all the design decisions is that you should get
much functionality with little input (or few lines of code, if you
prefer), rather than to allow full flexibility, like in a general
programming language (which by the way also allows for programmer
mistakes, so called bugs, which suddenly and unexpectedly hits the
*User*). The structure of the Alan language makes it possible to
protect the player from authoring ('programming') errors by analysing
and diagnosing them already at compile-time.
Ok, enough hype. Lets look at a small example. A while back someone
wrote a message to the one of the Implementors, which he shared with
us in Netland, in which he wrote:
>I've always wondered about the programming environment you folks used.
>What machines did you use to write a game on? Something like a PDP or one of
>the other "big" computers of the day, or did you actually do evelopment on
>machines like the Apple ][ or TRS-80? Also, what did ZIL/ZIP (which is
>correct?) code look like: For example, if you wanted to code a room such
>that:
>
> 1) the room's name was Gruble
> 2) the description was "this is a description"
> 3) north took you to room "Rumble"
> 4) west took you to room "Tumble"
> 5) if the user had foobared the barfoo then
> 5a) Add to description "hole in south wall"
> 5b) south leads to room "Arstol"
> 6) item "nabble" is here
> 7) item "krabble" is here, but can only be picked up if
> the player wasn't carrying item "frabble"
Sorry, I have lost that persons name, but thanks anyway! I thought
this would make a good example to give some feeling of the flavour of
the Alan language. So here goes:
Location gruble
Description
"This is a description."
If barfoo Is foobared Then
"There is a hole in the south wall."
End If.
Exit north To Rumble.
Exit west To Tumble.
Exit south To Arstol
Check barfoo Is foobared
Else "You can't go that way."
End Exit.
End Location.
Object nabble At gruble
End Object.
Object krabble At gruble
Verb take
Check frabble Not In inventory
Else "You are not carrying the frabble."
End Verb.
End Object.
That's it. Ok, I'll admit it's a bit of a mouthful just of hand, but
print it out and consider it. I'm not going to explain it since this
is not indended to describe the language, but just to give an idea of
its style.
Also a while back someone (other) said he finally had finished his
code to handle containers in TADS (I think). Probably that handling
was very elaborate and does not at all compare to what you get with
the following Alan definitions:
Object chest At tresury
Container
Limits
size 5 Else "It doesn't fit in the chest."
Count 6 Else "There is only room for 6 items."
End Object chest.
Syntax
put_in = 'put' (obj) 'in' (cont)
Where cont Isa Container
Else "You can not put anything inside the $2."
Verb put_in
Check obj In inventory
Else "You don't have the" Say obj.
Does
Locate obj In cont.
End Verb put_in.
Ok, end of examples (I won't explain this one either, just feel it).
The current version of Alan is 2.3 which runs on Sun/UNIX and Amigas.
We are planning the release of 2.4 in a few weeks time which will
include support for PC/MSDOS/OS2 and VAX/VMS. Bug fixes and some minor
enhancements to the language and documentation will also be included.
A major revision of the manual is planned after that, and we (or
should I say one of us!) are also working on a larger game for
release.
Below you'll find the ANNOUNCE file for version 2.3. Interested people
may contact us at:
alan-r...@softlab.se pseudo-mail-server for deliveries
th...@softlab.se me
go...@ida.liu.se
Sorry for all this bandwidth waste for commercials ;-)
ALAN ADVENTURE LANGUAGE
Release 2.3
Finally, the 2.3 version of the Alan Adventure Language System is now
available.
The Alan System is a special purpose language for creating interactive
fiction or text adventures. It consists of a compiler which compiles
Alan source to an intermediate form and an interpreter that
interprets such an intermediate form.
The Alan System is request-ware. The complete system is available
without charge through electronic mail on request from
Send a message with a single line like:
SEND <text>
for documentation, where <text> is one of TEXT or POSTSCRIPT for plain
ascii or PostScript versions of the documentation, or
SEND <platform>
for a complete distribution including documentation, demos and
executables for <platform>, where platform currently is one of:
AMIGA
SUN
A VAX/VMS version is imminent and ports for MSDOS and MAC are planned.
Archives are distributed in various formats depending on platform.
NOTE however that these packages (the complete distributions) are NOT
freely distributable, each package will automatically be registered on
the requestor.
The complete distribution contains an archive including the
documentation, some examples and the interpreter which are freely
distributable. Please forward this to friends or copy it onto any
FTP-sites. But remember that the compiler may NOT be copied or
redistributed. For complete copying conditions refer to the file
COPYING in the distribution.
You may contact the authors on the following email addresses:
th...@softlab.se
go...@ida.liu.se
Happy Authoring!
The ThoNi & GorFo Adventure Factories
--
Little languages go a long way...
----------------------------------------------------------------------
Thomas Nilsson Phone Int.: (+46) 13 12 11 67
Stenbrotsgatan 57 Phone Nat.: 013 - 12 11 67
S-582 47 LINKOPING Email: th...@softlab.se
SWEDEN Thomas_...@augs.se
----------------------------------------------------------------------
That was me. I wrote it in ADVSYS, actually. And once the basic framework
was in place, doing stuff like what you have below wasn't very complicated.
> Object chest At tresury
> Container
> Limits
> size 5 Else "It doesn't fit in the chest."
> Count 6 Else "There is only room for 6 items."
> End Object chest.
I didn't implement size vs room, so it's not an issue although it would only
be a few more lines of code to do it. An object like that would look like
this in advsys:
(container chest
(noun chest)
(adjective wooden heavy)
(property
initial-location treasury
capacity 5
description "There is a heavy wooden chest on the ground."
short-description "chest"))
If I wanted to have it specially handle requests, I could attach methods to
the end. For instance, say I wanted to have a special case if the user
tried to attack it...
(method (m-attack)
(die "You attack the chest which, unfortunately for you,
happened to be made of Sapient Pearwood. As your fist strikes the wood, a
giant gaping mouth opens and the chest sucks you into a dimension which is
strangely devoid of oxygen..."))
This little bit of code goes with the chest object, making the code very
object-oriented and simple to debug.
> Syntax
> put_in = 'put' (obj) 'in' (cont)
> Where cont Isa Container
> Else "You can not put anything inside the $2."
> Verb put_in
> Check obj In inventory
> Else "You don't have the" Say obj.
> Does
> Locate obj In cont.
> End Verb put_in.
Here's my "put something in something" code. It requires a few supporting
subroutines that i'm not going to include in this post (in-pocket,
in-location, container?, surface?, open?, find-load and putin). Anyway, I
hope this gives a flavor of what advsys is like. This routine doesn't use
the method facility, because I haven't needed to special case any "put"
actions. Note: you really have to be a LISP fan to like advsys code.
Fortunately, I overcame initial LISP-phobia and now I think it's dead sexy.
(action put
(verb put insert)
(direct-object)
(preposition in on)
(indirect-object)
(code
(setq %dobject (in-pocket $dobject))
(setq %iobject (in-location $iobject))
(if (or (container? %iobject)
(surface? %iobject))
(if (open? %iobject)
(if
(> (+ (find-load %iobject) (getp %dobject size))
(getp %iobject capacity))
(print "It won't fit.")
(progn
(putin %dobject %iobject)
(print "Done.")))
(inform "The " $iobject " is closed."))
(print "You can't put anything in or on that!"))))
--
Jon Drukman (God's personal DJ) uunet!sco!jondr jo...@sco.com
-------------------------------------------------------------------------------
Why kill time when you can kill yourself?
>(action put
... 19 lines of AdvSys code deleted ...
> (print "You can't put anything in or on that!"))))
I'm sorry if you felt attacked. That was certainly not my intension. I
didn't mean to say 'you can't do good things without Alan' either ;-).
My point was merely to indicate how much (little) work that *need* to
be done to do that particular thing in Alan. I also said that your
code was probably a lot more versatile (but larger).
Regards,
Thomas
right. i didn't feel attacked. i merely wanted to demonstrate how to do a
common operation in advsys. there are some people out there who would
rather program in a more detailed environment because they enjoy the greater
degree of control afforded them. i know i have tailored my advsys games
down to the lowest level and i wouldn't like to work in a system that didn't
allow that degree of control.
sorry if anyone's feathers got ruffled, it was simply for demonstration
purposes. i wasn't trying to sell anyone on anything...
--
Jon Drukman (God's personal DJ) uunet!sco!jondr jo...@sco.com
-------------------------------------------------------------------------------
You are pond scum with PhDs who murder bunnies and make them take the SATs!!