Author Topic: Restoring EcoQuest 1's debug functionality  (Read 4316 times)

0 Members and 1 Guest are viewing this topic.

Offline lwc

Restoring EcoQuest 1's debug functionality
« on: September 15, 2023, 11:56:01 AM »
Sluicebox' archive has multiple versions of this game and none of them have files with the titles of debug.
But a content search reveals 3 files - Game (see from CD version), Main (see from CD version) and n804 (see from CD version).

Can you restore the debug like you did with this game's sequel?
This is even more challenging to hack than its sequel, as ScummVM put this specific game under the dreaded (only) Suspected of having a debug mode...

Since there are multiple versions please at least try it on the CD version as it's supposed to be the latest.
« Last Edit: September 15, 2023, 11:58:22 AM by lwc »



Offline doomlazer

Re: Restoring EcoQuest 1's debug functionality
« Reply #1 on: September 15, 2023, 05:30:07 PM »
It certainly can be done, but it requires writing the debug script from scratch or porting another game's debug script which is more work than it sounds like.

My schedule is changing, so I'd be happy to let someone else tackle this one. If not, I can probably work on it eventually. Just not sure when that will be.

Offline lwc

Re: Restoring EcoQuest 1's debug functionality
« Reply #2 on: September 15, 2023, 06:05:10 PM »
Is there any chance it's hidden in there somewhere (as suggested by the screenshot) without needing to redo it from scratch?

Offline doomlazer

Re: Restoring EcoQuest 1's debug functionality
« Reply #3 on: September 15, 2023, 07:23:18 PM »
No, it's not in there. The French, German and Spanish versions all suggest that the debugRm script was 800, but it doesn't exist in any of them. Those versions would actually pass events to it if did, but 0.scr will need to be modified for the English games.

FYI, the (SetDebug) kernel command triggers the interpreter debugger, which was restored in EQ2 by Kawa's SCI.EXE. That's completely separate from the 'debugRm' scripts.

Offline doomlazer

Re: Restoring EcoQuest 1's debug functionality
« Reply #4 on: September 15, 2023, 09:45:02 PM »
I decided to go ahead and port the debugger into EQ1CD. I didn't add a 'Where to?' pop-up because I personally feel they are useless unless you set other relevant variables for the location (like 'QA' in SQ3 does), but you can ALT-T immediately.
« Last Edit: September 15, 2023, 09:55:14 PM by doomlazer »

Offline lwc

Re: Restoring EcoQuest 1's debug functionality
« Reply #5 on: September 16, 2023, 05:14:40 AM »
Wow! So many questions:
  • How did you do it so quickly after you wrote it'll be time consuming? If you borrowed it from the sequel then note it misses the sequel's Alt+J, Alt+S and Alt+W (which I guess is how you managed to fit the Shift+/ help in one screen)
  • 0.scr is Main, and 800.scr (which also has 800.hep) is your brand new debugRm, but why did it also need 988.scr which is Ego?
  • Will this work in the other versions of the game other than the CD one?
  • Can you include the source code?
  • Now as soon as I start the game in ScummVM, if I try to look at the first room (400)'s computer screen it crashes the game with [VM] Trying to instantiate class 72 by instantiating script 0x3a0 (928) failed! - other actions in that room do work - can you check why and is it a general issue?
  • What do you mean about SQ3's QA? And are you sure it should be different from all other Sierra games that do have WhereTo? The benefit of WhereTo is not having to type a manual number.
« Last Edit: September 16, 2023, 05:16:36 AM by lwc »

Offline lskovlun

Re: Restoring EcoQuest 1's debug functionality
« Reply #6 on: September 16, 2023, 01:01:02 PM »
Now as soon as I start the game in ScummVM, if I try to look at the first room (400)'s computer screen it crashes the game with [VM] Trying to instantiate class 72 by instantiating script 0x3a0 (928) failed! - other actions in that room do work - can you check why and is it a general issue?[/li][/list]
There is a problem decompiling that script; closer investigation reveals that script 928 needs a class in another file (script 929 containing the class MouthSync) which is missing. As for why it worked before,  no idea.

Offline doomlazer

Re: Restoring EcoQuest 1's debug functionality
« Reply #7 on: September 16, 2023, 04:32:22 PM »
    Now as soon as I start the game in ScummVM, if I try to look at the first room (400)'s computer screen it crashes the game with [VM] Trying to instantiate class 72 by instantiating script 0x3a0 (928) failed! - other actions in that room do work - can you check why and is it a general issue?[/li][/list]
    There is a problem decompiling that script; closer investigation reveals that script 928 needs a class in another file (script 929 containing the class MouthSync) which is missing. As for why it worked before,  no idea.

    Who knows what happened, but I redid main from scratch and now it works.

    Wow! So many questions:
    1. How did you do it so quickly after you wrote it'll be time consuming? If you borrowed it from the sequel then note it misses the sequel's Alt+J, Alt+S and Alt+W (which I guess is how you managed to fit the Shift+/ help in one screen)

    It was time consuming, I spent several hours porting the script and it's not exactly the 'fun' kind of programming. It's pretty tedious work. Plus, there is everything that comes after - I've spent several more hours on the project this morning.

    I did start with the script 98 from EQ2. I removed ALT+J, S & W because they didn't work in EQ2 and they aren't really that useful.

    2. 0.scr is Main, and 800.scr (which also has 800.hep) is your brand new debugRm, but why did it also need 988.scr which is Ego?

    988.scr is required to prevent the movement code from swallowing the mouse event. It's exactly the same thing from EQ2.

    3. Will this work in the other versions of the game other than the CD one?

    No, 0.scr would not be compatible with either of the floppy versions. I'm guessing some work would likely need to be done on script 800 to make it compatible as well.

    4. Can you include the source code?

    I've added the source code, but rm360 and the debugRm scripts are in SCICompanion's decompile format, not sluicebox's. The reason why is because both the SCICompanion and Sluice's decompile will not recompile without errors out of the box. It was just easier for me to work in the SCICompanion version.

    Converting code between the two is another time consuming and very not-fun task, so I've provided a mix of the two in the SCR folder for now. Semantically the code is identical, just the names are different.

    5. Now as soon as I start the game in ScummVM, if I try to look at the first room (400)'s computer screen it crashes the game with [VM] Trying to instantiate class 72 by instantiating script 0x3a0 (928) failed! - other actions in that room do work - can you check why and is it a general issue?

    This should be resolved as mentioned above.


    6. What do you mean about SQ3's QA? And are you sure it should be different from all other Sierra games that do have WhereTo? The benefit of WhereTo is not having to type a manual number.

    I've added a 'Where to?' with a few rooms chosen at random.

    When you teleport to rooms later in the game you've skipped performing a lot of the actions normally required to get there, so it leads to inconsistent behaviors. Depending on what you're testing you might need to set certain flags and globals or your results aren't going to be the same when actually playing through the game.

    In SQ3 if you PUMP SHARK, then type QA in the first room (rm002), you get several locations to jump to, but look at what variables are set before teleporting to the ship's cockpit:

    Code: [Select]
    (1
    (= shipRepairLevel 4)
    ((inventory at: iReactor) moveTo: 14)
    ((inventory at: iWire) moveTo: 14)
    (= roomWithMotivator NULL)
    (= motivatorState motivatorINSHIP)
    (= sittingInCockpit TRUE)
    (= shipLocation shipSPACE)
    (= global207 1)
    (= global208 2)
    (= global206 3)
    (= score 134)
    (theGame changeScore: 1)
    (RedrawCast)
    (curRoom newRoom: 14)
    )

    Not only are you in the cockpit, but the game state has been set as though you've correctly completed the junkyard section of the game.

    The code above was taken from EO's SCI Decompile Archive because it's easier to understand. Compare to the same code in Sluicebox's repo:
    Code: [Select]
    (1
    (= global136 4)
    ((gInventory at: 3) moveTo: 14) ; Reactor
    ((gInventory at: 1) moveTo: 14) ; Wire
    (= global149 0)
    (= global135 4)
    (= global203 1)
    (= global210 1)
    (= global207 1)
    (= global208 2)
    (= global206 3)
    (= gScore 134)
    (gGame changeScore: 1)
    (RedrawCast)
    (gCurRoom newRoom: 14)
    )

    I point this out only to highlight that both resources are incredibly valuable. I refer to both on nearly every project for different reasons.

    But I digress. New version attached below.
    « Last Edit: September 16, 2023, 05:23:10 PM by doomlazer »

    Offline lwc

    Re: Restoring EcoQuest 1's debug functionality
    « Reply #8 on: September 16, 2023, 05:15:13 PM »
    "PUMP SHARK"?

    Anyway, wow again, you are very talented! Ever considered solving SCI issues for ScummVM? I think Sluicebox is about the only one doing it and there's a giant backlog...

    I confirm the computer's screen can be looked at again, so that's great and the WhereTo is a also great touch!
    What are the new files 360.scr and 360.hep that weren't there before?

    P.S.
    The readme file (and probably the sequel's too) uses the term "it's" instead of "its", in case you want to fix it (should be "Note: ScummVM uses its own internal debugger" instead of "Note: ScummVM uses it's own internal debugger").
    « Last Edit: September 16, 2023, 05:21:39 PM by lwc »

    Offline doomlazer

    Re: Restoring EcoQuest 1's debug functionality
    « Reply #9 on: September 16, 2023, 05:31:56 PM »
    PUMP SHARK is the phrase that activates debugging in SQ3. Maybe most people use BACKSTAGE PASS, but I always thought pump shark sounded cooler.

    Thank you for the complement, but the majority of the regulars here could have done this for EQ1 and EQ2 as well.

    360.scr is the INTRO script, which is where I decided to insert 'Where to?'. 360.hep was required because I added new strings for the location names. I could have put them in a text file, but it's two patch files either way.

    Lol, I do know the difference between It's vs. Its, but my brain chooses one at random if I'm not paying attention. I've updated the zip in my previous post.

    Offline Collector

    Re: Restoring EcoQuest 1's debug functionality
    « Reply #10 on: September 16, 2023, 09:40:10 PM »
    Preliminary Wiki entry: http://sciwiki.sierrahelp.com//index.php?title=SCI_Debug_Modes#EcoQuest_1_CD I have not uploaded the debug archive yet, waiting for a finalized version.

    Noticed on minor thing. With the EQ2 debug, if you restart from the game controls it opened the "Where to" dialog overlayed on top of the current PIC. With this one restarting from the controls it just dumps you to first room of the game without the "Where to". I did notice that the "Create Obstacle" does not crash with an out of heap error the way EQ2 did.
    KQII Remake Pic

    Offline doomlazer

    Re: Restoring EcoQuest 1's debug functionality
    « Reply #11 on: September 16, 2023, 11:20:56 PM »
    I noticed that Create Obstacle didn't crash in EQ1CD. I'll take a look at EQ2 this weekend to see if I can fix it.

    Interestingly enough Create Obstacle does crashes in EQ1 Floppy v1.000. I've ported everything to the SCI1 version with a few minor changes.

    I've also moved the 'where to?' from 360 into 803 so that it pops up again on restart. This has been updated in both the Floppy and CD version which are in the zip attached below.

    I've lost my copy of the SCI1.1 Discovery Series version 1.1. So if anyone has that and the FR, GR & SP games, please let me know. I might as well finish them all so I never need to deal with EQ again!

    Offline lwc

    Re: Restoring EcoQuest 1's debug functionality
    « Reply #12 on: September 17, 2023, 04:45:01 AM »
    Our of curiosity, how come your EQ1_Floppy_v1.000 folder has only scr files while the EQ1_CD folder also has hep files for the same files?

    Offline Kawa

    Re: Restoring EcoQuest 1's debug functionality
    « Reply #13 on: September 17, 2023, 05:09:59 AM »
    Could be one is late SCI 1.0 and the other is SCI 1.1.

    Offline lwc

    Re: Restoring EcoQuest 1's debug functionality
    « Reply #14 on: September 17, 2023, 05:22:56 AM »
    Does it mean SCI 1.0 had no hep files and stored texts in the actual scripts?


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

    Page created in 0.069 seconds with 23 queries.