Author Topic: Debugging support (sort of)  (Read 4891 times)

0 Members and 1 Guest are viewing this topic.

Offline troflip

Debugging support (sort of)
« on: June 24, 2015, 01:28:48 AM »
The next iteration of SCI Companion, combined with the template game, will feature some extra debug functionality which I think will be pretty useful.

Through some file creation magic, you'll be able to start your game in "debug mode" which will enable the DebugPrint function. DebugPrint can be used just like FormatPrint:

Code: [Select]
DebugPrint("Switching to room %d" newRoomNumber)

So you can sprinkle these in your code when you're trying to track down a problem. This function will write to a file, which is read by SCI Companion, and displayed in the output window (which will now have tabs for Debug Output, Find Results and Compile Results). If the game is not started in debug mode, then DebugPrint just does nothing.

In addition, you will be able close the game (terminate the process) from within SCICompanion.

Not only that, but you'll also be able to "debug a room". Above the script editor will be a button that starts the game and takes you directly to the room for that script. Of course, this also requires support in the template game, and it requires that the room in question is functional without having to go through the title screen, etc...




Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Collector

Re: Debugging support (sort of)
« Reply #1 on: June 24, 2015, 02:01:18 AM »
This is a welcomed addition. Does the debug room automatically teleport ego to the selected room?
KQII Remake Pic

Offline troflip

Re: Debugging support (sort of)
« Reply #2 on: June 24, 2015, 02:32:41 AM »
Not sure quite what you mean... It just starts you in whatever room was specified, instead of the title screen room. If that room sets up the ego, it will be here.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Collector

Re: Debugging support (sort of)
« Reply #3 on: June 24, 2015, 02:47:30 AM »
More or less what I was asking. Most of the Sierra debug modes featured a teleport feature to go directly to the room to be checked, though it still started from the intro screen and you had to enter the desired room number, either after a "tp" command or a input box.
KQII Remake Pic

Offline troflip

Re: Debugging support (sort of)
« Reply #4 on: June 24, 2015, 02:51:44 AM »
Yup, it pretty much ends up just doing the same as that :-)
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Collector

Re: Debugging support (sort of)
« Reply #5 on: June 24, 2015, 11:21:08 AM »
What about adding inventory items and setting flags so you can test a room with the same conditions as if you had played through normally to that point.
KQII Remake Pic

Offline troflip

Re: Debugging support (sort of)
« Reply #6 on: June 24, 2015, 12:20:46 PM »
Yeah, I thought about that. That's a much more complex workflow than just "take me to this room". I suppose a simple way to do it would be to have a special script that gets run that does "debug setup" before transporting you the to room.
Check out my website: http://icefallgames.com
Groundhog Day Competition

Offline Collector

Re: Debugging support (sort of)
« Reply #7 on: June 24, 2015, 01:48:06 PM »
Plus you may want to be able to test a room under different circumstances, like behavior both with and without a given inventory item or flag set. Might be handy to have a way to track all relevant inventory items or flags for a given room. That would make it easier to remember what to set for testing. An XML to keep a record of flags and inventory items for each room?

Code: [Select]
<?xml version="1.0" encoding="utf-8"?>
<root>
  <rooms>
    <room number="1">
      <invItem></invItem>
      <flag></flag>
    </room>
    <room number="2">
      <invItem></invItem>
      <flag></flag>
    </room>
  </rooms>
</root>
KQII Remake Pic

Offline troflip

Re: Debugging support (sort of)
« Reply #8 on: June 24, 2015, 02:05:44 PM »
We already have a way of settings flags and getting items. Scripting!

I think I can just have a script with a procedure that takes the room number, and you can switch off of that to set up the needed state. Much more flexible (since there's no schema that limits what you can do), requires almost no work from me, and no more verbose than xml.
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.038 seconds with 23 queries.