Author Topic: Original SCI syntax  (Read 143446 times)

0 Members and 1 Guest are viewing this topic.

Offline troflip

Re: Original SCI syntax
« Reply #105 on: May 22, 2015, 02:18:44 AM »
Yeah, it was quick to detect this in the decompiler. Out of over 1000 uses of rest, the function that uses it only refers to parameters below the rest index.

So this is pretty good evidence to support that &rest never took a parameter name in Sierra's source code. It just referred to all the remaining unnamed parameters that were passed to the function.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline lance.ewing

Re: Original SCI syntax
« Reply #106 on: May 22, 2015, 03:54:06 AM »
Yeah I agree from that result that it seems like it was the case.

Offline lance.ewing

Re: Original SCI syntax
« Reply #107 on: May 22, 2015, 07:43:58 PM »
This is a full example generated by the Space Quest 6 debug mode, showing the context of that (super init: &rest)

Code: [Select]
(instance sitDownGame of Feature
(properties
x 88
y 117
sightAngle 40
noun
)
(method (init)
(self setPolygon:
((Polygon new:)
type: PTotalAccess,
init: 27 123 42 135 132 135 139 129 150 126 151 123 151 109 137 100
90 100 59 108 41 108 26 116,
yourself:
)
)
(super init: &rest)
)
);sitDownGame

I've had a look over a number of other newer SCI games but can't see anything new on top of what we've already discussed in this thread.

Offline troflip

Re: Original SCI syntax
« Reply #108 on: May 22, 2015, 10:25:22 PM »
Yeah, doesn't look like anything new. The noun property has no value associated with it, but I assume that's because the .shm file is missing.



Regarding some of the decompiled scripts where we see evidence of bugs in Sierra's source code - specifically, assigning multiple values to a property like so:

Code: [Select]
(self:
    view(233 x 199)   // Clearly this was supposed to send 233 to view, and 199 to x
    y(86)
)

... I think this can give us some clues regarding Sierra's original syntax. From what we know, the proper code would have been:

Code: [Select]
(self view: 233,
      x: 190,
      y: 86
)

... and we know the following code would give the result we actually see in the script resource:

Code: [Select]
(self view: 233     // missing comma
      x 190,         // missing colon
      y: 86
)

.. but that requires two typos to be made, which I think is unlikely?

I wonder if the original code looked like this:

Code: [Select]
(self view: 233     // just a missing comma
      x: 190,
      y: 86
)

I dunno.. it seems that would be a pretty easy syntax error to detect. Maybe it was considered valid syntax to refer to a property on self like that?
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline MusicallyInspired

Re: Original SCI syntax
« Reply #109 on: May 23, 2015, 02:33:50 AM »
WOW does all this discussion really infuriate me all over again that CUC/Cendant Publishing or whoever bought out Sierra at the time simply and unceremoniously threw out all the source code for these games into a dumpster.
Brass Lantern Prop Competition

Offline lance.ewing

Re: Original SCI syntax
« Reply #110 on: May 23, 2015, 05:28:44 AM »
This is part of script 325 in PQ SWAT (I have been searching in vain for this as well...) - 40 lines out of roughly 4kloc according to the embedded line number info in the script.
So a short piece of code indeed. It seems quite plausible that it is from some kind of paper publication, and scanned in by whoever posted it in the first place - there are typos in the code that look like the errors OCR software would make (setloop instead of setLoop, setcel instead of setCel, etc.)
There are also arguments against that, however: I can see that the code is unfinished in places (compared to the version of the game that I have), indicating that the
game may have been a work in progress at the time this was leaked. This would make it less likely to be an official publication, right?

Lars, I was taking a look at script 325 in PQ SWAT this morning and I can see what you mean about the source being quite different (perhaps unfinished) when compared to the compiled version. It may still have been an official publication, but as you say, maybe it was just a work in progress at the time, or perhaps deliberately altered for publication. Are we sure there is no other hitNineShot in PQ SWAT? I haven't yet checked every Script, so not sure myself yet. - If it was published in a book/magazine (which for some reason my memory seems to recall that whoever found it stated was the case), then this is still one of those unsolved mysteries. It would be great to track down an actual image of the page that this appeared on. When I asked Brian about it a few years back, his memory was vague, but he thought it might have come from Dark Fiber. When I asked Stuart he thought I was talking about the code in the Official Book of King's Quest, which is obviously KQ4 AGI code (and we confirmed a few years back that no edition of that book contained SCI code), so it didn't ring any bells with him.

So it's still a mystery where the PQ SWAT code came from and one that would be great to track down.

Offline lance.ewing

Re: Original SCI syntax
« Reply #111 on: May 23, 2015, 05:56:16 AM »
... and we know the following code would give the result we actually see in the script resource:

Code: [Select]
(self view: 233     // missing comma
      x 190,         // missing colon
      y: 86
)

.. but that requires two typos to be made, which I think is unlikely?

I wonder if the original code looked like this:

Code: [Select]
(self view: 233     // just a missing comma
      x: 190,
      y: 86
)

Yeah, I see what you mean. It could have been either one of those scenarios that resulted in the compiled code you're seeing, but in the second example, the colon seems like an invalid character for inclusion in a value.

For me, I've always wondered why they needed to use the commas. What I've read about the smalltalk keyword message syntax, it doesn't make use of commas. So the above example could instead have been simply this:

Code: [Select]
(self view: 233
      x: 190
      y: 86
)

Even if they had multiple values for a parameter, the colon still seems to be enough to distinguish the selector name from the value. But from what we've seen in the Feature Writer generated source, and the PQ SWAT snippet, I guess we have to assume that for whatever reason, they needed the comma.

Could it be that the comma was mandatory but the colon was optional in their version of keyword messaging? e.g. maybe this would have been valid (because the comma is the main delimiter in their case):

Code: [Select]
(self view: 233,
      x 190,                     // Missing colon
      y: 86
)

Offline lance.ewing

Re: Original SCI syntax
« Reply #112 on: May 23, 2015, 02:25:59 PM »
That is the DOS interpreter for the floppy version. The reason that I ask is that there is a fatal bug in the MPC version. I didn't know if I could track it down or not. I am not sure if it exists in the floppy version or not.

By the way, if there are any files you need from any of the games I could supply almost anything for you. Just let me know.

Does anyone happen to have handy the files required to activate the debug mode in Freddy? The English version doesn't have them but supposedly versions for other languages do. I think its the 10 scr, hep & txt thats required and they'll work with the English version.

Offline Collector

Re: Original SCI syntax
« Reply #113 on: May 23, 2015, 04:38:47 PM »
I don't, but would love to get them as well. I can try asking in some of the Sierra Facebook groups.
KQII Remake Pic

Offline lance.ewing

Re: Original SCI syntax
« Reply #114 on: May 23, 2015, 05:20:17 PM »
I guess all we need to do is track down a non-English version. Not sure where we'd find that these days. Does GOG and the like have versions available other than English? I'd pay for it just to get the debug mode going. The decompiled source for the EditablePolygon looks quite interesting. It seems to generate pretty much the same as other Polygon Editors, but it looks like it could be a bit more polished. I can see Mark Wilden's name in there as one of the devs:

Code: [Select]
        (case 97
            localproc_18f1(" by^M\n^M\nMark Wilden^M\n^M\nOriginal program by Chad Bye " 1)
        )

The polygon editor in SQ6 seemed quite basic compared with what this Freddy Pharkas one seems to have. It looks to be quite polished, with menus:

Code: [Select]
    local46[25] = ("EDITING" 0 0 "About" 0 0 "Map" 0 0 "Create" 0 0 "Type" 0 0 "Undo" 0 0 "Help" 0 0 "eXit" 120 )
    local71[22] = ("CREATING" 0 0 "About" 0 0 "Map" 0 0 "Done" 0 0 "Undo" 0 0 "Help" 0 0 "eXit" 120 )

...and help information:

Code: [Select]
                    (case 104
                        (switch (state)
                            (case 0
                                localproc_18f1("           CREATING POLYGON^M\n^M\nClick to create each corner of the polygon, then choose Done from the menu to finish.  You can also press Esc or Ctrl-click to finish.^M\n^M\nTo UNDO a corner, choose Undo.^M\n^M\nTo change MAP displayed (visual or control), choose Map.^M\n^M\nTo EXIT the Polygon Editor, choose eXit or press Ctrl-S." 0)
                            )
                            (case 1
                                localproc_18f1("             EDITING POLYGON^M\n^M\nTo MOVE a corner, click on it and drag it to the new position.^M\nTo INSERT a new corner, Ctrl-click to create it, then drag it to the correct position.^M\nTo DELETE a corner, Shift-click on it.^M\nTo UNDO an action, choose Undo from the menu.^M\nTo CREATE a new polygon, choose Create.^M\nTo change a polygon's TYPE (Total, Near or Barred), choose Type.^M\nTo change MAP displayed (visual or control), choose Map.^M\nTo EXIT the Polygon Editor, choose eXit or press Ctrl-S.^M\n^M\nIn addition to using the mouse, you can use Space and BackSpace to select corners and Tab and BackTab to select polygons. " 0)
                            )
                        )
                    )

Offline Collector

Re: Original SCI syntax
« Reply #115 on: May 23, 2015, 05:32:29 PM »
Here.
KQII Remake Pic

Offline Collector

Re: Original SCI syntax
« Reply #116 on: May 23, 2015, 05:41:40 PM »
Just experimented with it. Bringing this up looks useful. Curious thing is that if you click the so what it places you close to the bug I was talking about.
KQII Remake Pic

Offline lance.ewing

Re: Original SCI syntax
« Reply #117 on: May 23, 2015, 05:55:23 PM »
Hey, thanks a lot for this. I'm going to start playing with it now.   :)

Offline lance.ewing

Re: Original SCI syntax
« Reply #118 on: May 23, 2015, 05:59:56 PM »
Oh, I wonder if we can get troflip to add these to his copy of Freddy Pharkas and generate a new decompilation?   ;D

I'd love to see what the source for this script looks like.

Offline troflip

Re: Original SCI syntax
« Reply #119 on: May 23, 2015, 06:10:04 PM »
Easy peasy, here you go...
Check out my website: http://icefallgames.com
Groundhog Day Competition


SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.048 seconds with 23 queries.