Author Topic: Understanding later SCI code... SQ4  (Read 17011 times)

0 Members and 1 Guest are viewing this topic.

Offline MusicallyInspired

Re: Understanding later SCI code... SQ4
« Reply #15 on: May 09, 2015, 10:33:44 AM »
:)
Brass Lantern Prop Competition

Offline Cloudee1

Re: Understanding later SCI code... SQ4
« Reply #16 on: May 09, 2015, 01:13:29 PM »
Ok, so I now have this issue resolved and another official motion class added to my game.

global37  should actually point to gCastMotionCue, so changing the cycledone method at the end of the MCyc class to use the correct global variable
Code: [Select]
   
  (method (cycleDone)
        = completed 1
        = value 0
        (if (caller)
           = gCastMotionCue 1 // = global37 1
        )(else
            (self:motionCue())
        )
    ) // end method

Ship now successfully crosses the screen... On to discover the next issue.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline MusicallyInspired

Re: Understanding later SCI code... SQ4
« Reply #17 on: May 09, 2015, 01:57:02 PM »
Fantastic work, Cloudee. At this rate you can recreate SQ4 in SCI0! I'm sure Scott Murphy would appreciate that lol.
Brass Lantern Prop Competition

Offline troflip

Re: Understanding later SCI code... SQ4
« Reply #18 on: May 09, 2015, 02:12:59 PM »
Ok, so I now have this issue resolved and another official motion class added to my game.

Great job!

To clean it up, you might want to use the hex equivalent for the 32768 instead, so it looks more like a "flag": $8000. I guess this is a signal that marks the end of the list of cels/points.

And the two 65436 in the array should be -100, so it's clear it's just moving it off screen.

One the problems with decompiling is trying to guess whether a number is signed or not. When I encounter a 65535, it's almost certain this was a -1 in the original source code, so I special-case that.

The unsigned range (32768, 65535) corresponds to the signed range (-32768, -1)

What do you think the M stands for? MultiCycle? MultiCel?
« Last Edit: May 09, 2015, 02:33:45 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Collector

Re: Understanding later SCI code... SQ4
« Reply #19 on: May 09, 2015, 02:18:04 PM »
Fantastic work, Cloudee. At this rate you can recreate SQ4 in SCI0! I'm sure Scott Murphy would appreciate that lol.
Then you could re-add the parser that they wanted for the game.
KQII Remake Pic

Offline MusicallyInspired

Re: Understanding later SCI code... SQ4
« Reply #20 on: May 09, 2015, 07:34:11 PM »
That was what I was referring to. ;)
Brass Lantern Prop Competition

Offline Cloudee1

Re: Understanding later SCI code... SQ4
« Reply #21 on: May 09, 2015, 08:15:20 PM »
Great job!

To clean it up, you might want to use the hex equivalent for the 32768 instead, so it looks more like a "flag": $8000. I guess this is a signal that marks the end of the list of cels/points.

And the two 65436 in the array should be -100, so it's clear it's just moving it off screen.

One the problems with decompiling is trying to guess whether a number is signed or not. When I encounter a 65535, it's almost certain this was a -1 in the original source code, so I special-case that.

The unsigned range (32768, 65535) corresponds to the signed range (-32768, -1)

What do you think the M stands for? MultiCycle? MultiCel?
I was thinking Manual. As it requires that you place the posn points and cels via the array manually.

... ultimately my goal is to try and get the sci0 templates as close to what the sci1 template might be... that and I also like the idea of some added functionality right now. I have a couple of projects that are way to far along to even think about starting over with... and it just so happens that one of them does include sq4 in sci0... sq5 for that matter too. But this is a very long term project.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline MusicallyInspired

Re: Understanding later SCI code... SQ4
« Reply #22 on: May 09, 2015, 09:00:23 PM »
and it just so happens that one of them does include sq4 in sci0...

Nice! Don't forget that the backgrounds and sprites already exist in 16 colours in the EGA version. The VIEWs are even in SCI0 format and work in SCI0 games (tried it already) and the backgrounds can just be imported with Companion's current Pic importer tool.
Brass Lantern Prop Competition

Offline Cloudee1

Re: Understanding later SCI code... SQ4
« Reply #23 on: May 09, 2015, 09:14:09 PM »
Nice! Don't forget that the backgrounds and sprites already exist in 16 colours in the EGA version. The VIEWs are even in SCI0 format and work in SCI0 games (tried it already) and the backgrounds can just be imported with Companion's current Pic importer tool.

I may have to see if I can't track down a copy of that, because just getting the intro going I am not overly excited about the pics and views that are coming out. I was thinking that I was going to have to sit down and redraw them all... which is something I am loathe to do. That is the reason that Voodoo Girl has stalled, I have a number of rooms that I want to redraw but not the desire.
« Last Edit: May 09, 2015, 09:17:54 PM by Cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline MusicallyInspired

Re: Understanding later SCI code... SQ4
« Reply #24 on: May 09, 2015, 09:25:49 PM »
The only annoying part would be recreating the priority and control screens. Actually, no that would be easy. You can just export the priority and control screens in SCI Viewer as BMPs and import those with Companion's import tool. It'll draw everything in the visual field but you'd just need to go in and replace the visual palette selectors as priority or control. That would be a welcome feature to the new SCI Companion, however (importing priority and control masks).
Brass Lantern Prop Competition

Offline Cloudee1

Re: Understanding later SCI code... SQ4
« Reply #25 on: May 10, 2015, 02:30:34 AM »
fyi, the new version of SCI Companion I have on github has midi import support for sounds, and you can add cue points and the loop point (I don't think the old version of SCI Companion had this, did it? I forget). It's only SCI0 though. The sound format changed in SCI1 and I haven't written support for that yet. And Lars mentioned the way cue points worked has changed throughout SCI, so that's not fun :-(.

I don't know if you can do it, but a time line would come in really handy as well as the ability to right click the timeline for inserting cues. I have no idea how many ticks are in a second so adding cues has become a total guessing game. Right now everything works, but absolutely nothing is timed out correctly lol.

Also by the way, playing a midi sound with cue points via the interpreter while simultaneously playing an mp3 via sciaudio works like a charm. Especially since you can set cue points with different values all over the place means that the one sound file can cover a whole lot of distance.
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline Cloudee1

Re: Understanding later SCI code... SQ4
« Reply #26 on: May 10, 2015, 02:42:46 PM »
So this stupid procedure has me scratching my head.

Code: [Select]
(procedure public (proc999_1 param1 param2)
    = param1 (- param1 (* param2 (/ param1 param2)))
 ...

Unless I am mistaken, doesn't that ultimately breakdown into
 param1  = param1- param1
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition

Offline MusicallyInspired

Re: Understanding later SCI code... SQ4
« Reply #27 on: May 10, 2015, 02:57:24 PM »
Lol yeah it does. No matter what you put in for values for param1 or param2 it all results in a zero doesn't it?
Brass Lantern Prop Competition

Offline troflip

Re: Understanding later SCI code... SQ4
« Reply #28 on: May 10, 2015, 03:09:46 PM »
It looks like it calculates the remainder. If param1 is 7 and param2 is 3, the result should be 1.

It's basically the same functionality as the % operator. I think Lars mentioned that the mod opcode changed behavior over different SCI versions in regards to how it treats negative numbers. Maybe this procedure is a replacement "fix" for the mod opcode when negative numbers are used.
« Last Edit: May 10, 2015, 03:16:02 PM by troflip »
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Cloudee1

Re: Understanding later SCI code... SQ4
« Reply #29 on: May 10, 2015, 11:18:16 PM »
Sir. I disagree  ???
It looks like it calculates the remainder. If param1 is 7 and param2 is 3, the result should be 1.

= param1 (- param1 (* param2 (/ param1 param2)))
= param1 (- 7 (* 3 (/ 7 3)))
param1 = 7- (3(7/3))
param1 = 7 - 7
param1 = 0

I don't see any combination that will ever get us anything but 0 for a resulting param1, except for maybe an initial 0 value, but wouldn't it just be easier to check for that specifically and then just reset param1 to 0 without bothering with the operators.
« Last Edit: May 10, 2015, 11:21:05 PM by Cloudee1 »
Halloween Competition Brass Lantern Prop Competition Groundhog Day Competition


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

Page created in 0.053 seconds with 19 queries.