pdxiv/sk2sadat

ERROR: unable to find room "_ROOM0" in action on line 1716

Opened this issue · 4 comments

pdxiv commented

sk2sadat fails to compile some ScottKit-decompiled game files that contain a reference to an undefined "_ROOM0" which sk2sadat can't resolve. This has been encountered in decompiled game files as follows:
adv04.sck
adv05.sck
adv06.sck
adv13.sck
quest1.sck
r.sck

pdxiv commented

Maybe _ROOM0 appears when an action refers to an undefined room. If so, ScottKit should perhaps simply not generate actions that reference an invalid room, or die with an error message. Needs to be further investigated.

pdxiv commented

The way forward, to preserve compatibility, appears to be to implicitly create an inaccessible dummy room for every encountered room id which matches the regexp pattern /^(_ROOM\d+)$/.

From the ScottKit documentation:
Tolerate out-of-range room-numbers as the locations of items, and also compile such room-names using special names of the form _ROOMnumber. (This is not necessary when dealing with well-formed games, but Buckaroo Banzai is not well-formed.)

pdxiv commented

In some of these games, "phantom rooms" are simply part of "useless" actions with no commands. These actions should probably be removed anyway (and produce a warning when encountered). This is the case with the following game files:

  • adv04.sck
  • adv06.sck
  • adv13.sck
  • quest1.sck
    This leaves adv05.sck (The Count) and r.sck with unexplained references to "phantom rooms". In adv05.sck, the "phantom room" is simply used as an intermediate step when going to sleep, and it's not actually a room that the player will find itself in, so it has no impact on the game mechanics. In r.sck there doesn't seem to be a way of reaching the phantom room, but comments indicate that it's the "death room". This probably has no impact on actual gameplay. Unclear if this is a bug in the game code, or if ScottKit somehow decompiled this complex game incorrectly.
pdxiv commented

The compiler should probably allow for the possibility to use "undefined rooms" using the /_ROOM\d+/ convention. What game interpreters do with that, shouldn't be a concern for the compiler.