Community

General and Everything Else => The Games and other Sierra Adventure stuff => Topic started by: OmerMor on August 30, 2016, 05:20:21 PM

Title: "Sierra Gets Creative" by Jimmy Maher
Post by: OmerMor on August 30, 2016, 05:20:21 PM
Another fine piece by Jimmy Maher:
http://www.filfre.net/2016/08/sierra-gets-creative/ (http://www.filfre.net/2016/08/sierra-gets-creative/)

This time it even covers our beloved SCI engine, as well as the introduction of the MT-32 to Sierra's games.
Long, but very interesting.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Kawa on August 30, 2016, 05:57:12 PM
Long, but very interesting.
That's what she said.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: troflip on August 30, 2016, 09:22:06 PM
It's fascinating how well they did back then, even with all the relative incompetence/inexperience (some poor business decisions, poor attention to QA, Roberta not very good at game design).
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lskovlun on September 20, 2016, 02:29:56 AM
I wonder where he got the AGI code sample, because as far as I know AGI doesn't look like this:
Code: [Select]
IF HAS-GOAT 0 AND OBJHIT-EDGE 14 AND EDGE-OBJ-HIT 1 AND GOAT-GONE 0 AND SHOW-CARROT 0 THEN ASSIGN GOAT-ROOM 11, ERASE 10unless there were multiple iterations of that language?
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: OmerMor on September 20, 2016, 03:20:55 AM
Here are some real AGI source examples:
Code: [Select]
if (could.buy.toy.horse)
   {
   animate.obj( a.toy.horse);   [   middle
   position( a.toy.horse, 40, 108);
   set.view( a.toy.horse, v.pg.toy.horse);
   draw( a.toy.horse);
   }
------------------
if (next.frame)
   {
   reset( next.frame);
   if (could.buy.swing && !has( i.swing))
      {stop.update( a.swing);}
   if (could.buy.spaceship.ladder && !has( i.spaceship.ladder))
      {stop.update( a.spaceship.ladder);}
   if (could.buy.rings && !has( i.rings))
      {stop.update( a.rings);}
   if (could.buy.toy.horse && !has( i.toy.horse))
      {stop.update( a.toy.horse);}
   if (could.buy.tetherball.pole && !has( i.tetherball.pole))
      {stop.update( a.tetherball.pole);}
   if (could.buy.parallel.bars && !has( i.parallel.bars))
      {stop.update( a.parallel.bars);}
   }
------------------
[ Skulls-a-poppin'

   random( 0, 4, cell);
   loop = 0;
   view = 245;

   if (cell < 2)
      {
      random(1, 140, x);
      random(90, 110, y);
      add.to.pic.f(view, loop, cell, x, y, priority, box);
      }
------------------
if ((said( talk, man) ||
   said( ask, biker))) {
   if ( nearPerson) {
      print( 15);      [ "The man in black says, \"We don't
      }
   else {
      print( 13);
      }
   }
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on September 20, 2016, 01:18:47 PM
Toy horses and bikers? I am failing to think of an official game with toy horses and bikers.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: OmerMor on September 20, 2016, 03:28:50 PM
Toy horses and bikers? I am failing to think of an official game with toy horses and bikers.

O ye, of little faith...
It's from Donald Duck's Playground and Police Quest 1 of course!  8)
(Skulls-a-poppin' is from King's Quest 3)
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lskovlun on September 20, 2016, 08:12:11 PM
Well, the snippet is supposedly from KQ1, and it being the very first AGI game in existence I could well understand ithe language looking a bit... primitive. But still...

Looking further into it, the source is an article in Compute! That article calls the language Game Adaptation Language at this point. AGI is not mentioned at all, the protagonist's name is Sir "Grahame" and so on. So this is very early indeed.

http://www.atarimagazines.com/compute/issue57/kings_quest.html

But that raises another question - because we know that KQ1/AGI was published in several versions (including non-booter, AGIv2 ones). So did they have to change code/rewrite for this, or was this syntax always accepted?
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: OmerMor on September 21, 2016, 03:46:57 AM
It's also possible that the article "simplified" the code snippet to make it more concise and readable.

It's not far fetched to believe they transformed this:

Code: [Select]
if (!has(goat) && obj.hit.edge == 14 && !goat.gone && !show.carrot)
   {
   goat.room = 11;
   erase(10);
   }

.. into this:

Code: [Select]
IF HAS-GOAT 0 AND OBJHIT-EDGE 14 AND EDGE-OBJ-HIT 1 AND GOAT-GONE 0 AND SHOW-CARROT 0 THEN ASSIGN GOAT-ROOM 11, ERASE 10
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on September 21, 2016, 02:06:51 PM
Well, the snippet is supposedly from KQ1, and it being the very first AGI game in existence I could well understand ithe language looking a bit... primitive. But still...

Looking further into it, the source is an article in Compute! That article calls the language Game Adaptation Language at this point. AGI is not mentioned at all, the protagonist's name is Sir "Grahame" and so on. So this is very early indeed.

http://www.atarimagazines.com/compute/issue57/kings_quest.html

But that raises another question - because we know that KQ1/AGI was published in several versions (including non-booter, AGIv2 ones). So did they have to change code/rewrite for this, or was this syntax always accepted?

That article is a great find. I've never heard of the Game Adaptation Language. Maybe it was an early version used in AGIv1. I had the old AGIv1 bootable versions of KQ1 & KQ2 at one point, long since gone, but I did spend some time at one stage looking over the disk sectors in a hex editor.

I'm guessing they changed the language syntax for AGIv2.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: OmerMor on September 21, 2016, 04:04:23 PM
Another possibility: perhaps GAL was a carryover from the PreAGI (http://wiki.scummvm.org/index.php/AGI#PreAGI) games?
Do we know anything about the development of these games?
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on September 21, 2016, 06:11:21 PM
Just how many pre-AGI languages or engines did Sierra have besides ADL? The Hi-Res Adventures used ADL, but what did the others use?
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: NewRisingSun on October 13, 2016, 01:17:26 AM
I feel it needs to be pointed out that contrary to most (even Sierra's) reports, the original self-booting version of King's Quest 1 was not an AGI game, at all. I have used IDA on its executable to produce a source file that can be reassembled with changes, and it's absolutely nothing like AGI. King's Quest 2 was the first AGI game, and even in its 128K self-booting versions is very much like AGI. King's Quest 1 was explicitly ported to AGI in 1986 with the release of its 256K version 1.0U. "Explicitly ported" referring to the fact that the 256K version says "New version" on the title screen.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on October 13, 2016, 01:36:44 AM
Interesting. Thanks for the info. Any idea about the engine or was it a one shot custom engine?
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: OmerMor on October 13, 2016, 05:56:16 AM
That's very interesting!
I'd love to hear more about this interim engine.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on October 13, 2016, 01:43:44 PM
I remember reading something about how Sierra was having trouble with the development of KQ and IBM had to help.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: NewRisingSun on October 13, 2016, 02:11:17 PM
I suppose it's a good idea then for me to start commenting and annotating the IDA-produced disassembly I already have. (You might think that a non-annotated disassembly is trivial to produce, but if you have ever tried to recompile/reassemble a disassembly after making changes to it, you know that it's not trivial at all. Because if you fail to assign just one hexadecimal number as a reference to the data segment, or assign it to the wrong segment, or assign a number that is not a reference as if it were a reference, your recompiled executable will be useless.)
Doing so will allow me to study the engine more closely, and compare it both to AGI and to the two Hi-Res Adventure PC ports (Adventure in Serenia and Ulysses and the Golden Fleece). Unless Omer suddenly finds an original source code, that is... ;)

So far, I have only disassembled the "PCjr" disk of the Sierra On-Line release, which seems to be identical to the Radio Shack release in that it runs both on PCjr and Tandy 1000, the only difference to the Radio Shack release being that the latter says "Licensed to Tandy Corp.". I also have the August 1984 PC-CGA release as an original disk and the only IBM release for PCjr ("release" refererring to what's on the disk; I'm aware that there were two kinds of keyboard overlays) as well as the Radio Shack release as disk images. There is an earlier PC release that can be identified in the boot sector saying "BOOT v1.1" rather than "BOOT v1.2", and has "King's Quest" printed in gray rather than in yellow/orange at the side of the box. I don't have that version, so unless someone provides it to me, my annotated source will only cover the differences between the versions I have. One difference I already know of is that the Sierra On-Line PCjr disk, upon "restarting" a game, resets all variables by hand, while the PC-CGA version loads a "startup" saved game from the diskette instead.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on October 14, 2016, 11:11:36 AM
I personally would love to look over such a disassembly. Although I did at one point have a pre AGI 2 bootable KQ1 disk, I have no idea what the exact version was and I didn't go as far as looking at the code. In those days I tended to look at the data. I have recollections of seeing AGI like data but that may have been the KQ2 disk.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lskovlun on October 14, 2016, 12:31:15 PM
Also remember that dissimilarity of code does not mean it isn't AGI. Could be PreAGI. ScummVM supports PreAGI through the AGI engine which suggests some shared characteristics, but PreAGI looks somewhat hardcoded and I'm not sure KQ1 Booter is. I have no experience with the ScummVM AGI engine myself.

EDIT: I don't think anyone has tried running KQ1 Booter on it. Were the other PreAGI games booters? It seems to me they must have been.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on October 14, 2016, 01:06:18 PM
Pretty sure that Mickey's Space Adventure and Winnie the Pooh in the Hundred Acre Wood were booters. I don't have the others, so I cannot say about those.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: NewRisingSun on October 14, 2016, 01:30:50 PM
Mickey's Space Adventure and Winnie the Pooh in the Hundred Acre Wood are not booters, at least not originally. If you wanted the disks to boot, you would have to transfer DOS onto the floppy disks yourself, which the previous owner of your copy may well have done. Troll's Tale could self-boot but also run from DOS, although there is no means of exiting the game. Self-booting King's Quest has a MAIN.EXE file but does not run under DOS because it assumes to be loaded at a fixed memory location.
Quote from: lskovlun
ScummVM supports PreAGI through the AGI engine which suggests some shared characteristics,
Might be due to oddball modularization choices. Would not be the first time. I certainly will not assume any similarity just because the ScummVM people choose to call it "Pre-AGI".

I have disassemblies of Mickey's Space Adventure and Winnie the Pooh in the Hundred Acre Wood right here, and the only characteristic that vaguely resembles AGI is some code for drawing a picture using vector commands, and the Tandy 3-voice sound routine in the case of Winnie, which is functionally identical and uses the same music files as AGI version 1.x.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on October 14, 2016, 02:25:29 PM
The similarity in picture and sound formats could well be why the data looked AGI-like to me. I was quite familiar with both of those formats at the time. I suppose it was an evolution. KQ1 probably wasn't completely new in all areas.

Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: NewRisingSun on October 14, 2016, 02:35:51 PM
Okay, but given that the "I" in "AGI" stands for "interpreter", I would have expected that the minimum standard for anything to be considered substantially similar to it would be to also have a virtual machine with a similar set of opcodes or at least a similar architecture, not just a few library routines. Otherwise Stellar 7 and Silpheed would be similar to King's Quest IV, since the music routines are almost the same. :)
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on October 14, 2016, 03:40:55 PM
Yeah, you're right. AGI is the whole package, all four resource types. So if the LOGIC equivalent is quite different, then it isn't really AGI. And besides, "AGI" is probably more strongly associated with the language and associated command opcodes than with the rest.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Kawa on October 14, 2016, 05:06:25 PM
Kinda reminds me of how SCUMM is usually taken to mean the entire engine as a whole.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on October 15, 2016, 09:54:41 AM
Yeah, it's certainly like that. SCUMM was even more of an evolution over time. What we typically call AGI was relatively consistent compared with SCUMM. I wrote an AGI interpreter called MEKA that I never quite completed due to Stuart George's Yggdrasil/Sarien interpreter advancing more quickly. It was more of a proof of concept in any case. But it could run pretty much all the AGI v2 and AGI v3 games with differing levels of stability and differing numbers of bugs.

But I didn't spend much time looking at what I thought of as AGI v1, so even classifying a pre AGI v2 game into v1, v0, pre-AGI or something else isn't my knowledge area. My focus and knowledge was pretty much all on the AGI v2 and v3 games. This discussion above though has awoken my interest in pre AGI v2 Sierra games. I'm actually quite interested now in investigating the evolution of their games through the TrollVM supported games, to the original KQ1, and the AGI v1 KQ2 and BC and see how things changed over that period.

So I'm definitely keen to see what you produce NewRisingSun! Would love to see the commented disassembly.

As a side focus, I've always been interested in AGI games on the Apple II platform, but I've never taken the time to have a look at how they work. My particular interest in the Apple II AGI games isn't because I had an Apple II, because I didn't, but instead because it is a 6502 machine.

It would appear that I've been distracted from my current effort to port KQ1 to a 13K Javascript game. Oh well. It seems there's no such thing as a finished hobby project in my world.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: NewRisingSun on October 15, 2016, 10:12:09 AM
I'm being slowed down by the original KQ1's nonstandard way of setting up stack frames (for passing parameters to functions and for local variables) that makes it difficult to see what's going on. So don't expect anything this or next month.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on October 15, 2016, 12:59:05 PM
Yeah, I can imagine. I've tried using IDA in the past and struggled.

Sounds like its going to be a Christmas present then.   ;D
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: NewRisingSun on October 15, 2016, 02:08:23 PM
Just so you know what I mean by non-standard stack frames: The standard calling convention in all major programming languages for calling a procedure like this:
Code: [Select]
void someProc(1234, 5678)is something like this:
Code: [Select]
caller:
    (... caller doing something)
    MOV AX, 5678
    PUSH AX
    MOV AX, 1234
    PUSH AX
    CALL someProc
    ADD SP, 4
    (... caller doing something else)
someProc:
    PUSH BP
    MOV BP, SP
    MOV AX, [BP+4] ; get arg 1
    MOV DX, [BP+6] ; get arg 2
    (... someProc doing something with the args)
    POP BP
    RET
The Pascal and C calling conventions differ in whether the arguments are pushed onto the stack from left to right, or from right to left, and whether the caller cleans up the stack (as I did with ADD SP, 4) or the callee as part of the RET instruction. King's Quest 1 however does something like this:
Code: [Select]
caller:
    (... caller doing something)
    PUSH BP
    MOV BP, SP
    MOV AX, 5678
    PUSH AX
    MOV AX, 1234
    PUSH AX
    CALL someProc
    MOV SP, BP
    POP BP
    (... caller doing something else)
someProc:
    MOV AX, [BP-2]
    MOV DX, [BP-4]
    (... someProc doing something with the args)
    RET
In other words, the caller sets up the stack frame, rather than the callee. I have never seen any compiler using such a strange calling convention. Obviously, IDA gets confused by this, thinking that BP-4 is a local variable of someProc (which it would be in any normal calling convention), and it makes my head spin as well. Add to that such niceties as one procedure being placed in the middle of another, unrelated, procedure for no apparent reason, with the "outer" procedure JMPing around the "inner" procedure, and you will understand why I cannot go on for longer than 30 minutes at a time. :)
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lskovlun on October 15, 2016, 05:39:22 PM
Wikipedia has an article on "Avis Durgan" which states:
Quote
"Avis Durgan" is the ASCII-string on which an exclusive OR operation (XOR) was performed in the text of the vintage Sierra Entertainment AGI adventure games to keep the gamers from snooping for clues in these games' resource files. In earlier versions of AGI games that booted directly from diskette, the "Avis Durgan" string was also used to encrypt sections of code as a copy-protection scheme.
NewRisingSun, are you seeing these encrypted code blocks in your investigations?
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on October 15, 2016, 05:53:27 PM
I've currently got the Apple II King's Quest disks open in a hex editor and there seems to have been no attempt to hide anything in this case. Despite the fact that the Apple II version was apparently written/ported by Jeff Stephenson, not even the text has been XORed with Avis Durgan.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: NewRisingSun on October 15, 2016, 06:00:45 PM
There's no "Avis Durgan" in the 128K version of KQ1. All text is in the clear on the disk. I have also never seen "Avis Durgan" being used in a copy-protection scheme. Sierra did use encryption as part of three of its copy protection schemes on the PC, but I have never seen "Avis Durgan" as a decryption key for code. So I would dispute that (unsourced) claim from Wikipedia.

There are five different on-disk copy protection schemes on Sierra's PC releases:Only the code of methods 1., 2. and 5. involves any encryption, and all use more complex keys and schemes than "Avis Durgan". The string does appear in the code of the two Hi-Res Adventures for the PC, but not as part of any copy-protection code.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on October 15, 2016, 09:13:42 PM
Found this on Ken Williams' site:

Quote
I don't recall AGI being developed as part of the Kings Quest 1 IBM project, but suspect you are right. We wanted to take a major jump forward, and the language we were using for the adventure games was too confining. It had almost no "procedural code" capability. AGI added variables, looping, branching and animation, and the simulated 3-D effect. My recollection is that most of the code was written by Jeff Stephenson. I don't think any of the code in AGI is mine. I was involved, but more on the design than the coding side.

-Ken W

http://www.sierragamers.com/Forum/bbs/Topic.7567.530202
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on October 18, 2016, 12:52:38 PM
It was certainly a long time ago for these guys, about 33 years ago in the case of the original KQ1. They struggle to remember it now. When I think about 1983, I certainly can't remember anything, but I was only 8.

I'm certainly interested in exporing the possibility that the original KQ1 wasn't really AGI as such. If Ken can't remember it, then there is the possibility that it wasn't developed for KQ1.

I'm continuing my investigations in to the Apple II versions of KQ1 and KQ2, and from only having had a fairly quick skim over the disk sectors of both games, I can tell you that the data in KQ2 looks like an AGI game, e.g. I can recognise the structure of the LOGIC format, which is probably the key one. I'm going to continue that investigation to hopefully confirm the format of the other resources, e.g. I might see if I can rip out a PICTURE and load it in to PICEDIT.  :)   But we're not really expecting KQ2 to be anything other than an AGI game I guess, in fact it clearly says on the title screen of the Apple II version "Adventure Game Interpreter v1.10".

Interesting. Just spotted the text "Avis Durgan" in one of the disk sectors of KQ1. Well I guess something must be encoded with Avis Durgan, but it isn't the room messages, object list, or word list. I can see all of those in plain text. What I don't recognise is anything other than that plain text. Yes, I can see the plain text room messages for the LOGIC resources, and in most cases the text exactly matches the AGI DOS version of KQ1, and they're even in the same order a lot of the time. But the LOGIC format itself looks quite different. I'm going to spend some time over the next couple of weeks trying to work it out. - The thought just occurred to be that perhaps it's the core data of the resources that is encoded. My eyes are wandering back up to the earlier post where something like this was suggested. If not that, then maybe the interpreter code. Something is encoded with Avis Durgan, otherwise why is it there.

Eventually I'll get on to disassembling the 6502 code for each game. Will need to learn a bit about the Apple II architecture in the process though. Seems like it was quite powerful for the day. Steve Wozniak was amazing really. I know 6502 quite well, but nothing else at all about the Apple II hardware.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lskovlun on October 18, 2016, 01:45:47 PM
Code: [Select]
caller:
    (... caller doing something)
    PUSH BP
    MOV BP, SP
    MOV AX, 5678
    PUSH AX
    MOV AX, 1234
    PUSH AX
    CALL someProc
    MOV SP, BP
    POP BP
    (... caller doing something else)
someProc:
    MOV AX, [BP-2]
    MOV DX, [BP-4]
    (... someProc doing something with the args)
    RET
What that looks like to me, is a routine coded in assembly being wrapped to make it callable from a HLL. There are a few examples of it in SCI as well.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: OmerMor on October 19, 2016, 09:27:21 AM
Regarding the whole AGI/AGDS/GAL/KQ1 history reconstruction:

In 2005, someone added the following paragraph to the AGI wikipedia article:
Quote from: https://en.wikipedia.org/w/index.php?title=Adventure_Game_Interpreter&diff=prev&oldid=12807912
The original King's Quest engine and language (named Game Assembly Language or *.gal by its designer, Arthur Abraham) was developed by Sierra to to showcase the technology of the PCjr.
AGI, originally developed by IBM, was donated to Sierra when it was unable to finish the project due to the dismissal of its main designer.

Interesting...

So who was this Arthur Abraham?

Mobygames has a rather empty developer page (http://www.mobygames.com/developer/sheet/view/developerId,311747/) for him, and he's only credited in Apple II and Mac versions, under "Original Version":
(http://www.mobygames.com/images/shots/l/42949-king-s-quest-apple-ii-screenshot-title-screen.gif)
(http://www.mobygames.com/images/shots/l/586808-king-s-quest-macintosh-screenshot-title-screen.png)

I found other variations of this story:
Quote from: http://www.listal.com/list/powered-by-agi
The first King's Quest game originally used a language named Game Assembly Language, or *.gal, by its designer, Arthur Abraham, but when he left, Sierra was unable to complete the game. Since King's Quest was intended to showcase the technology of the IBM PCjr, IBM "donated" its product, AGI, to Sierra to allow development of King's Quest to continue

Quote from: http://www.mauriciogiraldo.com/vgline/es/node/393
In 1983, IBM commissioned Sierra On-Line to develop a game that would showcase the technical capabilities of the IBM PCjr, a home computer which IBM planned to release the following year. To meet the challenge, game designer Roberta Williams scripted a game that was to become King's Quest: Quest for the Crown, and lead developer Arthur Abraham developed a custom programming language called Game Assembly Language. After Sierra dismissed Abraham, IBM contributed to the development of King's Quest's game engine in order to help ensure the project's success.

I also found the following tweet from Laine Nooney (who's researching Sierra's history):
Quote from: https://twitter.com/Sierra_OffLine/status/713473117537050629
Desperately trying to get to the bottom of the Arthur Abraham-*.gal-language/IBM-invented-AGI internet rumor. #sierraonline

This is Jimmy Maher's take on this GAL language:
Quote from: http://www.filfre.net/2013/07/the-unmaking-and-remaking-of-sierra-on-line/
What with Ken having a company to run, the heavy lifting of turning the proposal into a game engine largely fell to Jeff Stephenson. Just like the Hi-Res Adventure engine, this one was designed to be reusable and extendible from the start. It was initially known as the Game Adaptation Language, or GAL. Ken, however, loathed the cutsiness of that acronym, and it was eventually renamed to the Adventure Game Interpreter, or AGI.

Any ideas what we can make of this mess?
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on October 19, 2016, 10:15:34 AM
Wow! Some amazing research work there Omer! As a consequence of my comment regarding Al Lowe's memory on the other thread, it is not surprising that Al can't remember GAL. He couldn't remember AGDS until shown some of the evidence. I might send him some of what you've found and see if it triggers any memories.

I was talking to Jeff Stephenson a few years back, via the scummvm forums private messaging system, but that was about SCI and the naming of that language. He said he was struggling to remember things about SCI, so I'd imagine that AGI, GAL and AGDS might be even more of a struggle. Might be worth following up on though. I'm sure he would remember something like the rumours you've mentioned above. Jeff appears to have been the primary developer of AGI for most of its life.

IBM inventing AGI would be a bomb shell if that is true. Would definitely be worthwhile tracking down Arthur Abraham to see what his account of that story is.

I found Charles Tingley on LinkedIn by the way. Looks like Jeff Stephenson and a lot of the other ex-Sierra employees are on LinkedIn as well. There is an Arthur Abraham working in IT in the San Francisco area that might be a match. Charles Tingley was obviously involved with KQ1, so he might have a story as well. And the MacNeills, if anyone has their contact details.

https://www.linkedin.com/in/chuck-tingley-7314b713  (Definitely the right Charles Tingley)
https://www.linkedin.com/in/arthur-abraham-197779b  (a possible candidate for Arthur Abraham)
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on October 19, 2016, 11:56:37 AM
The MacNeills should not be that hard to contact. They still sell Gold Rush! on their site.

http://www.softwarefarm.com/

If you have trouble with that Marco Sowa from Sunlight Games was in contact with them when preparing the original Gold Rush! for re-release.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: NewRisingSun on October 20, 2016, 01:55:41 PM
What is strange is that no PC version ever mentions Arthur Abraham.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on October 20, 2016, 02:28:23 PM
That is strange actually, because what I've learnt over the past day is that Arthur probably was the one that created AGI.

I put a few questions to Jeff Stephenson overnight. Jeff denies that he himself had anything to do with creating the original AGI engine (as he was working on a different project at the time), but instead confirms that it was Arthur Abraham and Charles (Chuck) Tingley. He believes that Arthur worked on the language part of the engine and Charles on the graphics part of the engine (although he implies that he can't be 100% certain of his memory). Arthur did indeed leave the project before the original version of KQ shipped, and so Charles apparently finished off the bits that needed finishing. He can't specifically remember the events around Arthur leaving but doesn't believe that it had any major impact on the KQ project (as some sites would have us believe). And he said that there were never two different systems and that King's Quest was only ever built on AGI. He doesn't rule out the possibility that it may have been known by another name early on. He doesn't specifically remember it being called GAL however,  but said that if it was called that in the early stages, then it was almost certainly another name for the same thing, i.e. AGI.  I'll post a fuller version of what I've learnt later on...

I for one place a lot of weight on the Donald Trivette article from 1985. It was published shortly after KQ1 came out and shortly before KQ2 was released. He mentions talking directly to Sierra, so they presumably told him that the name of the language was GAL. Trivette went on to write books about the King's Quest series, which often included photos of their internal editors and code snippets that Sierra had shared with him. So I believe it is very likely that it was originally called GAL; it's just that most of them can't remember it any more.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lskovlun on October 20, 2016, 02:38:59 PM
That is strange actually, because what I've learnt over the past day is that Arthur probably was the one that created AGI.
I've read somewhere (Jimmy Maher's site?) that Ken Williams had a policy of only crediting people who were still employed when the project shipped/was done. Perhaps they simply managed to sneak a credit in on the less scrutinized ports.
EDIT: Less platform-centricity.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: NewRisingSun on October 20, 2016, 03:20:05 PM
From what I can make out from KQ1's disassembly so far, is that the virtual machine has 67 opcodes, and ADD is 20 (dec), while SUB is 21 (dec).
Code: [Select]
KQ1CODE:2FCE op20_add:                               ; ...
KQ1CODE:2FCE                 mov     si, [bp+VM_PC]
KQ1CODE:2FD1                 inc     [bp+VM_PC]
KQ1CODE:2FD4                 mov     al, VM_acc
KQ1CODE:2FD7                 xor     ah, ah
KQ1CODE:2FD9                 mov     bl, [si]
KQ1CODE:2FDB                 xor     bh, bh
KQ1CODE:2FDD                 add     ax, bx
KQ1CODE:2FDF                 mov     VM_acc, al
KQ1CODE:2FE2                 jmp     getNextOpcode
KQ1CODE:2FE5 ; ---------------------------------------------------------------------------
KQ1CODE:2FE5
KQ1CODE:2FE5 op21_sub:                               ; ...
KQ1CODE:2FE5                 mov     si, [bp+VM_PC]
KQ1CODE:2FE8                 inc     [bp+VM_PC]
KQ1CODE:2FEB                 mov     al, VM_acc
KQ1CODE:2FEE                 xor     ah, ah
KQ1CODE:2FF0                 mov     bl, [si]
KQ1CODE:2FF2                 xor     bh, bh
KQ1CODE:2FF4                 sub     ax, bx
KQ1CODE:2FF6                 mov     VM_acc, al
KQ1CODE:2FF9                 jmp     getNextOpcode
Most of the other commands seem to manipulate on-screen objects. And yes, the goat is indeed object number 14 and starts in room 10: :)
Code: [Select]
KQ1DATA:16D6 ; Item: ObjNum, name, room, ?, ?, ?, ?
KQ1DATA:16D6 objInfo         SObj <0, offset sItemUnnamed, 0, 0, 0, 91h, 87h> ; ...
KQ1DATA:16DE                 SObj <0, offset sItemUnnamed, 0, 0, 0, 41h, 53h>
KQ1DATA:16E6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Eh, 2Bh>
KQ1DATA:16EE                 SObj <0, offset sItemUnnamed, 0, 0, 0, 78h, 9Ch>
KQ1DATA:16F6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 58h, 2Bh>
KQ1DATA:16FE                 SObj <0, offset sItemUnnamed, 0, 0, 0, 50h, 50h>
KQ1DATA:1706                 SObj <0, offset sItemUnnamed, 0, 0, 0, 12h, 5Ch>
KQ1DATA:170E                 SObj <0, offset sItemUnnamed, 0, 0, 0, 2Ch, 2Bh>
KQ1DATA:1716                 SObj <0, offset sItemUnnamed, 2, 0, 0, 67h, 77h>
KQ1DATA:171E                 SObj <0, offset sItemUnnamed, 3, 0, 0, 71h, 7Ch>
KQ1DATA:1726                 SObj <0, offset sItemDagger, 3, 0, 0, 0, 0>
KQ1DATA:172E                 SObj <0, offset sItemPouch, 6, 0, 0, 0, 0>
KQ1DATA:1736                 SObj <0, offset sItemDiamonds, 6, 0, 0, 0, 0>
KQ1DATA:173E                 SObj <0, offset sItemGoat, 10, 0, 0, 4Bh, 69h>
KQ1DATA:1746                 SObj <0, offset sItemUnnamed, 11, 0, 0, 11h, 98h>
KQ1DATA:174E                 SObj <0, offset sItemBucket, 12, 0, 0, 26h, 78h>
KQ1DATA:1756                 SObj <0, offset sItemUnnamed, 12, 0, 0, 0, 0>
KQ1DATA:175E                 SObj <0, offset sItemUnnamed, 12, 0, 0, 0, 0>
KQ1DATA:1766                 SObj <0, offset sItemCarrot, 15, 0, 0, 0, 0>
KQ1DATA:176E                 SObj <0, offset sItemUnnamed, 19, 0, 0, 64h, 5Dh>
KQ1DATA:1776                 SObj <0, offset sItemClover, 24, 0, 0, 3Dh, 7Bh>
KQ1DATA:177E                 SObj <0, offset sItemUnnamed, 25, 0, 0, 21h, 35h>
KQ1DATA:1786                 SObj <0, offset sItemUnnamed, 28, 0, 0, 2Dh, 80h>
KQ1DATA:178E                 SObj <0, offset sItemWalnut, 30, 0, 0, 0, 0>
KQ1DATA:1796                 SObj <0, offset sItemBowl, 31, 0, 0, 7Eh, 8Ah>
KQ1DATA:179E                 SObj <0, offset sItemPebbles, 34, 0, 0, 50h, 68h>
KQ1DATA:17A6                 SObj <0, offset sItemUnnamed, 40, 0, 0, 1Eh, 6Ch>
KQ1DATA:17AE                 SObj <0, offset sItemGoldKey, 40, 0, 0, 1Eh, 6Ch>
KQ1DATA:17B6                 SObj <0, offset sItemBeans, 40, 0, 0, 1Eh, 6Ch>
KQ1DATA:17BE                 SObj <0, offset sItemUnnamed, 47, 0, 0, 54h, 50h>
KQ1DATA:17C6                 SObj <0, offset sItemUnnamed, 51, 0, 0, 2Ch, 98h>
KQ1DATA:17CE                 SObj <0, offset sItemUnnamed, 48, 0, 0, 7Ch, 6Eh>
KQ1DATA:17D6                 SObj <0, offset sItemUnnamed, 51, 0, 0, 28h, 78h>
KQ1DATA:17DE                 SObj <0, offset sItemMirror, 51, 0, 0, 26h, 6Ch>
KQ1DATA:17E6                 SObj <0, offset sItemUnnamed, 57, 0, 0, 3, 7Dh>
KQ1DATA:17EE                 SObj <0, offset sItemUnnamed, 65, 0, 0, 55h, 52h>
KQ1DATA:17F6                 SObj <0, offset sItemChest, 57, 0, 0, 47h, 57h>
KQ1DATA:17FE                 SObj <0, offset sItemSling, 62, 0, 0, 4Bh, 4Bh>
KQ1DATA:1806                 SObj <0, offset sItemEgg, 63, 0, 0, 47h, 50h>
KQ1DATA:180E                 SObj <0, offset sItemUnnamed, 65, 0, 0, 21h, 4Ch>
KQ1DATA:1816                 SObj <0, offset sItemCheese, 65, 0, 0, 76h, 8Ch>
KQ1DATA:181E                 SObj <0, offset sItemNote, 65, 0, 0, 76h, 8Ch>
KQ1DATA:1826                 SObj <0, offset sItemUnnamed, 0, 0, 0, 31h, 0A3h>
KQ1DATA:182E                 SObj <0, offset sItemUnnamed, 75, 0, 0, 0, 0>
KQ1DATA:1836                 SObj <0, offset sItemUnnamed, 75, 0, 0, 3Eh, 82h>
KQ1DATA:183E                 SObj <0, offset sItemUnnamed, 75, 0, 0, 19h, 76h>
KQ1DATA:1846                 SObj <0, offset sItemUnnamed, 79, 0, 0, 84h, 84h>
KQ1DATA:184E                 SObj <0, offset sItemSceptre, 77, 0, 0, 75h, 6Ah>
KQ1DATA:1856                 SObj <0, offset sItemShield, 77, 0, 0, 83h, 80h>
KQ1DATA:185E                 SObj <0, offset sItemFiddle, 79, 0, 0, 80h, 9Ah>
KQ1DATA:1866                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:186E                 SObj <0, offset sItemUnnamed, 53, 0, 0, 20h, 58h>
KQ1DATA:1876                 SObj <0, offset sItemUnnamed, 77, 0, 0, 1Eh, 58h>
KQ1DATA:187E                 SObj <0, offset sItemUnnamed, 79, 0, 0, 7Fh, 60h>
KQ1DATA:1886                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:188E                 SObj <0, offset sItemRing, 18, 0, 0, 4Bh, 4Bh>
KQ1DATA:1896                 SObj <0, offset sItemUnnamed, 79, 0, 0, 2Dh, 74h>
KQ1DATA:189E                 SObj <0, offset sItemUnnamed, 79, 0, 0, 5Ch, 73h>
KQ1DATA:18A6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:18AE                 SObj <0, offset sItemUnnamed, 51, 0, 0, 4Bh, 4Bh>
KQ1DATA:18B6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 28h, 78h>
KQ1DATA:18BE                 SObj <0, offset sItemUnnamed, 50, 0, 0, 4Bh, 4Bh>
KQ1DATA:18C6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 8Eh, 80h>
KQ1DATA:18CE                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4, 45h>
KQ1DATA:18D6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 61h, 0A0h>
KQ1DATA:18DE                 SObj <0, offset sItemUnnamed, 0, 0, 0, 55h, 52h>
KQ1DATA:18E6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:18EE                 SObj <0, offset sItemUnnamed, 0, 0, 0, 20h, 58h>
KQ1DATA:18F6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:18FE                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:1906                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:190E                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:1916                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:191E                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:1926                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:192E                 SObj <0, offset sItemUnnamed, 0, 0, 0, 50h, 64h>
KQ1DATA:1936                 SObj <0, offset sItemUnnamed, 0, 0, 0, 55h, 52h>
KQ1DATA:193E                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Fh, 88h>
KQ1DATA:1946                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Fh, 88h>
KQ1DATA:194E                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Fh, 88h>
KQ1DATA:1956                 SObj <0, offset sItemUnnamed, 0, 0, 0, 7Fh, 60h>
KQ1DATA:195E                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:1966                 SObj <0, offset sItemUnnamed, 0, 0, 0, 44h, 6Ch>
KQ1DATA:196E                 SObj <0, offset sItemMushroom, 0, 0, 0, 54h, 50h>
KQ1DATA:1976                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:197E                 SObj <0, offset sItemGoldWalnut, 30, 0, 0, 4Bh, 4Bh>
KQ1DATA:1986                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:198E                 SObj <0, offset sItemUnnamed, 65, 0, 0, 21h, 4Ch>
KQ1DATA:1996                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:199E                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:19A6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:19AE                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:19B6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:19BE                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:19C6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:19CE                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:19D6                 SObj <0, offset sItemUnnamed, 1, 0, 0, 5, 12h>
KQ1DATA:19DE                 SObj <0, offset sItemUnnamed, 0, 0, 0, 4Bh, 4Bh>
KQ1DATA:19E6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 54h, 77h>
KQ1DATA:19EE                 SObj <0, offset wItemWater, 0, 0, 0, 54h, 5Bh>
KQ1DATA:19F6                 SObj <0, offset sItemUnnamed, 0, 0, 0, 0, 0>
KQ1DATA:19FE                 SObj <0, offset sItemUnnamed, 0, 0, 0, 0, 0>
KQ1DATA:1A06                 SObj <0, offset sItemUnnamed, 0, 0, 0, 0, 0>
KQ1DATA:1A0E                 SObj <0, offset sItemUnnamed, 0, 0, 0, 0, 0>
KQ1DATA:1A16                 SObj <0, offset sItemUnnamed, 0, 0, 0, 0, 0>
KQ1DATA:1A1E                 SObj <0, offset sItemUnnamed, 0, 0, 0, 0, 0>
KQ1DATA:1A26                 SObj <0, offset sItemUnnamed, 0, 0, 0, 46h, 0A5h>
KQ1DATA:1A2E                 SObj <0, offset sItemUnnamed, 0, 0, 0, 0, 0>
KQ1DATA:1A36                 SObj <0, offset sItemUnnamed, 0, 0, 0, 0, 0>
KQ1DATA:1A3E                 SObj <0, offset sItemUnnamed, 0, 0, 0, 0, 0>
KQ1DATA:1A46                 db    0
KQ1DATA:1A47                 db 0FFh


Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: NewRisingSun on October 20, 2016, 03:54:48 PM
Quote from: lskovlun
What that looks like to me, is a routine coded in assembly being wrapped to make it callable from a HLL.
That's what I thought too, but consider the following:
Code: [Select]
KQ1CODE:2F95 op19:                                   ; ...
KQ1CODE:2F95                 mov     si, [bp+VM_PC]
KQ1CODE:2F98                 inc     [bp+VM_PC]
KQ1CODE:2F9B                 mov     al, [si]
KQ1CODE:2F9D                 xor     ah, ah
KQ1CODE:2F9F                 push    ax
KQ1CODE:2FA0                 call    obj2ani
KQ1CODE:2FA3                 mov     sp, bp
(...)
KQ1CODE:3718 obj2ani         proc near               ; ...
KQ1CODE:3718                 push    bp              ; STACKFRAME_CREATE, 2
KQ1CODE:3719                 sub     sp, 2
KQ1CODE:371C                 mov     bp, sp
KQ1CODE:371E                 mov     cl, 3
KQ1CODE:3720                 mov     ax, [bp+6]
KQ1CODE:3723                 shl     ax, cl          ; multiply by 8, the size of an SObj struct
KQ1CODE:3725                 mov     si, ax
KQ1CODE:3727                 mov     al, byte ptr objInfo.aniNum[si]
KQ1CODE:372B                 xor     ah, ah
KQ1CODE:372D                 mov     VM_currentAniNum, al
KQ1CODE:3730                 mov     bx, size SAni
KQ1CODE:3733                 imul    bx
KQ1CODE:3735                 add     ax, offset bAnis
KQ1CODE:3738                 mov     VM_currentAniPtr, ax
KQ1CODE:373B                 add     sp, 2           ; STACKFRAME_LEAVE, 2
KQ1CODE:373E                 pop     bp
KQ1CODE:373F                 ret
KQ1CODE:373F obj2ani         endp
Why the hell does obj2ani first subtract 2 from SP if it doesn't use any local variables? Without that, it could access the argument with BP+4 instead of BP+6. The whole code is full of such red herrings.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: OmerMor on October 20, 2016, 04:14:11 PM
That is strange actually, because what I've learnt over the past day is that Arthur probably was the one that created AGI.

I put a few questions to Jeff Stephenson overnight. Jeff denies that he himself had anything to do with creating the original AGI engine (as he was working on a different project at the time), but instead confirms that it was Arthur Abraham and Charles (Chuck) Tingley. He believes that Arthur worked on the language part of the engine and Charles on the graphics part of the engine (although he implies that he can't be 100% certain of his memory). Arthur did indeed leave the project before the original version of KQ shipped, and so Charles apparently finished off the bits that needed finishing. He can't specifically remember the events around Arthur leaving but doesn't believe that it had any major impact on the KQ project (as some sites would have us believe). And he said that there were never two different systems and that King's Quest was only ever built on AGI. He doesn't rule out the possibility that it may have been known by another name early on. He doesn't specifically remember it being called GAL however,  but said that if it was called that in the early stages, then it was almost certainly another name for the same thing, i.e. AGI.  I'll post a fuller version of what I've learnt later on...

I for one place a lot of weight on the Donald Trivette article from 1985. It was published shortly after KQ1 came out and shortly before KQ2 was released. He mentions talking directly to Sierra, so they presumably told him that the name of the language was GAL. Trivette went on to write books about the King's Quest series, which often included photos of their internal editors and code snippets that Sierra had shared with him. So I believe it is very likely that it was originally called GAL; it's just that most of them can't remember it any more.

Fascinating stuff!
This thread is getting better and better!  :D
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lskovlun on October 21, 2016, 06:03:54 AM
Why the hell does obj2ani first subtract 2 from SP if it doesn't use any local variables? Without that, it could access the argument with BP+4 instead of BP+6. The whole code is full of such red herrings.
That's just an unused local variable. Compilers back then weren't so clever. And clock-cycle wise, only the subtraction counts, apart from that it doesn't matter. From what I've seen there is no oddness here, only a mixture of C and ASM, and the necessary machinations to support that.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lskovlun on October 21, 2016, 06:12:42 AM
And he said that there were never two different systems and that King's Quest was only ever built on AGI. He doesn't rule out the possibility that it may have been known by another name early on.
But that does mean we still have an unanswered question. How did the code snippet in that Donald Trivette article end up looking like that? I mean it certainly isn't the classic AGI syntax.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on October 21, 2016, 08:23:14 AM
Not sure how it ended up looking like that, but I guess we have to assume that they sent the code snippet to him. It would be difficult to relate over the phone. The article mentions that he called Sierra, but I'd imagine that there was some follow up to that call and that Sierra provided him with the rather technical detail that that article contains.

Such a format might be easier to compile in to AGI bytecode. As you hinted at earlier, it appears to be a primitive syntax for essentially the same thing. Let's take a look at what was in the article:

Quote
IF HAS-GOAT 0 AND OBJHIT-EDGE 14 AND EDGEOBJ-HIT 1 AND GOAT-GONE 0 AND SHOWCARROT 0 THEN ASSIGN GOAT-ROOM 11, ERASE 14.

This can be written in the more familiar AGI syntax as follows:

Code: [Select]
if (!isset(has.goat) && (obj.hit.edge == 14) && (edge.obj.hit == 1) && !isset(goat.gone) && !isset(showcarrot)) {
  goat.room = 11;
  erase(14);   
}

The following from the AGI.DOC file:

Quote
obj.hit.edge
 If non-zero, indicates that an object (other than ego) hit the edge of
 the picture. The value of the var is the number of the object.

edge.obj.hit
 When non-zero, indicates the edge of the screen that the object hit.
    top 1
    right 2
    bottom 3
    left 4

Object 14 is the goat. Not certain that the edge constant values are in alignment. On a first read of this logic, it would seem to be the bit of code that handles the goat walking from room 10 in to room 11. It seems to be Donald's assessment as well. But if that is the case (which it probably is), then the edge being tested should be the right edge and not the top edge.

I've found the equivalent code in the AGIv2 PC version using AGI Studio:

Code: [Select]
  if (v5 == 2) {
    erase(o13);
    reset(f20);
    v111 = 11;
  }

This would appear to confirm that the edge should indeed by right (i.e. 2). v5 is edge.obj.hit. The code obviously isn't exactly the same. The additional checks in the if are instead handled further up. Obviously the clearing of f20 isn't in the magazine version. So either that really wasn't there, or they gave him an example that wasn't actually complete (or perhaps had a bug in it).
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: NewRisingSun on October 22, 2016, 11:28:17 AM
I have now stepped through KQ1's virtual machine enough to gain a basic understanding of how it works, and what the logic file format is like.

There are only two directories: rooms, and views. The directory is in absolute sector number 10, which in most disk images is at file offset 0x1400. The room directory is in the first 512 bytes, the view directory in the second 512 bytes. Each entry is of double-word size, containing the absolute start sector number, the number of sectors, and the starting offset into the start sector number. A room begins with the logic resource, directly followed by the picture resource. Resources have no headers, unlike AGI, where they start with 0x12 0x34 volume sizeLo sizeHi.

The first four words of the logic resource contain the four lengths, in bytes, of the four blocks of a logic resource. The game finds the picture resource simply by adding those four values together, thus seeking past the logic resource. The four blocks are:The test command blocks contain only a sequence of test commands (and, in the case of 3., parser word tokens), each followed by an offset into the Action subroutine block that is executed if the test evaluates positively. There seem to be only three test commands: equaln, not equaln, and posn. From what I have seen, there are only vars, no flags.

The string block has no pointers, only zero-terminated strings. Their offsets into the string block are hard-coded as parameters of the action commands themselves, instead of using message numbers.

There is no separate directory for sound resources. Room numbers 90 and up only contain sound resources, four in each room. The four words that in a normal room resource would contain the length of the four logic blocks here contain the length of each of the four sound resources that make up the "room" resource.

I suppose it's a matter of definition whether to call this thing AGI or not. The action and test commands do not match their respective AGI opcode numbers at all. For example, the functional equivalent to new.room is command 0x04, and new.room.f is command 0x37. Given all these differences, I'm more inclined to keep calling KQ1's language GAL, even as it is tempting to see the similarities.  Maybe if the logic format of the AGI version 1 interpreter were fully known (http://sciprogramming.com/community/index.php?topic=1687), one would see more of a continuity between GAL and AGI version 2.

Knowing the structure of the logic resource as well as the length of all opcodes, but lacking knowledge of the meaning of the variables and some of the opcodes, where the disassembly is too obtuse, the next step for me will be to write a small decompiler of the logic resources. That will allow me to compare the output to AGIv2 KQ1.
Quote from: lskovlun
What that looks like to me, is a routine coded in assembly being wrapped to make it callable from a HLL.
No, that's not what it is. Wrapping an assembly routine to be HLL-callable would look something like this:
Code: [Select]
CLoadRoom proto c, roomNumber: word

CLoadRoom proc near
push bp
mov bp, sp
mov ax, [bp+4]
call AsmLoadRoom
pop bp
ret
CLoadRoom endp

AsmLoadRoom proc near
; call with: AX=new room number
shl ax, 1
shl ax, 1
mov bx, ax
mov ax, [roomDirectory+bx]
(...)
ret
AsmLoadRoom endp
What we have in KQ1 instead is the calling procedure establishing a stack frame, and all the BP references of the callee being relative to the stack frame that the caller has set up. That's extremely unusual.

It's also somewhat unusual to reserve room for local variables using "SUB SP, xx" before the "MOV BP, SP". It makes each argument's relative offset a function of the number of local variables. Normal compilers, including the one used to compile both AGI v1 and v2, subtract from SP after "MOV BP, SP". That way, arguments can be identified by BP+x, while locals are BP-x. That is the standard behavior, so standard that Intel turned into its own machine language instruction (ENTER) on their 1982's 80286 processor.
Quote from: lskovlun
From what I've seen there is no oddness here, only a mixture of C and ASM,
I suggest you look at my first example more closely. The caller function does not start with the PUSH BP; that occurs right in the middle of it.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on October 23, 2016, 04:03:33 PM
Well, the snippet is supposedly from KQ1, and it being the very first AGI game in existence I could well understand ithe language looking a bit... primitive. But still...

Looking further into it, the source is an article in Compute! That article calls the language Game Adaptation Language at this point. AGI is not mentioned at all, the protagonist's name is Sir "Grahame" and so on. So this is very early indeed.

http://www.atarimagazines.com/compute/issue57/kings_quest.html

But that raises another question - because we know that KQ1/AGI was published in several versions (including non-booter, AGIv2 ones). So did they have to change code/rewrite for this, or was this syntax always accepted?

I sent an email to Donald B. Trivette, the author of the February 1985 article on King's Quest linked to above. Today he replied with some answers.

He can't remember a lot of the specific details, but this is basically a summary of what he told me:

He liked the game, called and talked to the three principals at Sierra, those being Ken Williams, Roberta Williams and John Williams. He didn't speak to any of the technical staff. So all of that technical information about how the priority bands, controls lines, save areas, and logic scripts work would have come from one of these three people. The only communication he had with Sierra to get this information was over the phone, so it is amazing actually that he managed to capture such detail. He must have been quite specific with his questioning and I guess kept asking questions until he understood how it worked. This was, after all, the purpose of his phone call to them, i.e. to understand how such a game had been created.

It is interesting that he claims to have never heard of Jeff Stephenson.

Donald believes that he wrote the article all in the space of 4 to 5 days. There was no long lead time. He would write an article and submit it before the due date. It would then get published the next month. I'm guessing the Compute! magazine needed time after the "due date" to properly prepare the magazine as well. As I've noted previously, his reference to the scheduled Tandy 1000 release in January 1985 suggests that he wrote those words before January 1985. But it would seem that he didn't write the article much before that. I think our best guess would therefore be in December 1984, which is when King's Quest was really moving up the charts.

My final question to Donald was regarding the Game Adaptation Language. His answer was "I called it what ever Ken Williams called it, which must have been Game Adaptation Language".

So there we have it. He is pretty sure they told him that name.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on October 24, 2016, 04:24:41 PM
He liked the game, called and talked to the three principals at Sierra, those being Ken Williams, Roberta Williams and John Williams. He didn't speak to any of the technical staff.

I sent an email to John Williams yesterday about the above and received a reply back today. He has quite an amazing memory actually. The questions that others are a bit vague on, he seems to recall quite a bit of the details.

I think we might have to bring Jeff Stephenson back in to the mix for AGI. John claims that Jeff has always been modest, and that he remembers Jeff having his fingers in everything that was part of the IBM development back then. I think HomeWord was an IBM related project, which Jeff certainly states that he was busy working on back in 1983, but Jeff doesn't give himself much credit for King's Quest, since I guess he wasn't part of the core team.

The picture I'm getting from talking to various people is that the King's Quest project was a team effort. Ken Williams had quite a guiding hand on the King's Quest project. People basically did what Ken wanted done, and Ken himself was very hands on with that project. We can understand why, because this project for IBM really needed to be a success. But John wouldn't call Ken the architect, since in John's words there were many pieces to that project and a lot of people deserve the credit. Certainly John wouldn't give Abraham and Tingley sole credit for the engine. Tingley, for example, was a good programmer and a key coder on the project, but he wasn't the architect either; he was just one of the team. Everyone felt free to toss ideas around and comment on everything. 

Neither Abraham nor Tingley left Sierra on good circumstances apparently..

I'm not sure where that leaves us really with regards to who originally wrote the AGI engine. It seems that we should give the team the credit.

Regarding the name Game Adaptation Language and the article that Donald B. Trivette published in February 1985, here is what John has to say:

"I remember Don Trivette and spoke to him many times. I know he spoke with Ken and got technical information and in fact we packaged that article in with some of our games for a while. The "first" meaning of AGI was "advanced graphics interpreter."   Moving games from system to system wasn't the big goal of the creation for the toolset.  It was really designed so that artists and musicians could be part of the development process - something that really wasn't possible at the time.   It was actually changed to "Game Adaption Language" at some point when we started using it to port games from machine to machine but at first it was really a workflow tool so that our artists could share work, do testing, etc. in the same system the programmers were working in. "

In response to this, I asked if he recalls Game Adaptation Language being renamed to Adventure Game Interpreter. He says that he does remember it being renamed to that at some point, and then went on to say that they were quite sloppy with their marketing back then, for which he takes full responsibility since he ran the marketing.  He says they were all basically a bunch of kids back then.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lskovlun on August 15, 2017, 06:38:03 AM
Throwback to this thread:
https://twitter.com/Sierra_OffLine/status/897116277508116481

"the original coder" of what must be GAL in prison for kiddie porn?
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on August 15, 2017, 09:22:18 AM
Who is she referring to?
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lskovlun on August 15, 2017, 04:34:01 PM
Who is she referring to?
Arthur Abraham, apparently:
https://twitter.com/Sierra_OffLine/status/897476400889901056
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on August 16, 2017, 08:41:43 AM
I have never heard of him before.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: lance.ewing on August 16, 2017, 02:18:22 PM
He's been mentioned several times earlier in this thread.

Edit: I realised after posting the above that you've probably chosen to forget him. I've been doing the same over the past year after learning from Laine where he was and why. Part of the reason I didn't mention it here.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on August 16, 2017, 07:28:29 PM
I guess I should have been more clear that my remark was meant to be snarky.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: MusicallyInspired on August 17, 2017, 12:46:45 AM
We need SCI-themed emotes here. :P
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Kawa on August 17, 2017, 08:14:07 AM
We need SCI-themed emotes here. :P
I dunno about SCI-themed, but I can get you Larry.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: OmerMor on August 17, 2017, 02:07:27 PM
Who is she referring to?
Arthur Abraham, apparently:
https://twitter.com/Sierra_OffLine/status/897476400889901056

Laine wants to reply to this thread but can't register an account:
https://twitter.com/Sierra_OffLine/status/897946344186408961 (https://twitter.com/Sierra_OffLine/status/897946344186408961)

Can someone here help her?
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Kawa on August 17, 2017, 02:30:53 PM
I don't see any non-red accounts in the queue, OmerMor.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on August 17, 2017, 06:45:46 PM
I only see one, but it does not look like it could be her. Did she try to register?
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Kawa on August 18, 2017, 05:36:07 AM
Back on a proper computer, I see nine redflags and one that cleantalk.org would likewise flag.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on August 18, 2017, 08:05:46 AM
Yeah, the one non red flag came from a Russian IP.
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: OmerMor on August 18, 2017, 10:41:30 AM
I only see one, but it does not look like it could be her. Did she try to register?

Can you chat with her directly (via twitter) or do you want me to do it?
Title: Re: "Sierra Gets Creative" by Jimmy Maher
Post by: Collector on August 18, 2017, 08:23:12 PM
I had set to follow her on Twitter some time ago, but almost never bother with Twitter. I gave her a prod. If she does not respond you can try.