Difference between revisions of "SAGA/TODO"

From ScummVM :: Wiki
Jump to navigation Jump to search
m (Renamed a category)
(Update on the problematic objects in IHNM)
Line 23: Line 23:
== IHNM ToDos ==
== IHNM ToDos ==


=== Major issues ===
 
* ['''Important'''] Properly handle objects that have more than 1 frame. Refer to the [[SAGA/TODO#Sprite_bugs|sprite bugs]] section below
=== Sprite bugs ===
['''Important''']
 
 
These bugs occur because currently ScummVM doesn't handle properly objects that have more than 1 frame. In all the problematic cases, Actor::getSpriteParams throws an invalid frameNumber warning about the problematic object. Most of these objects are doors.
 
 
There are two main lists of sprites (_inventorySprites and _mainSprites), plus a list of objects, containing information on all the objects used. In the case of the problematic objects that have more than 1 frame, the object information itself remains the same, therefore we're not interested in the object information entry. I've checked the object flags, but saw no difference (they're 0). Perhaps the interactbits part is different? The incorrect sprite ID requested are always bigger than the largest ID in the _mainSprites list, so perhaps the correct approach would be to load the object's sprite list (using the sprite's resource ID) and append it to the end of the _mainSprites list, in a manner similar to what is done with actors (using loadActorSpriteList()) inside getSpriteParams().
 
Also, it seems that the original game does a slightly different calculation of frame IDs:
cseg01:0001446D                mov    edx, mainSprites
cseg01:00014473                xor    ebx, ebx
cseg01:00014475                mov    ecx, [eax+GameObject.figID]
cseg01:00014478                mov    bx, [edx+xSpriteSet.count]
cseg01:0001447B                cmp    ebx, ecx
cseg01:0001447D                jle    short loc_1448B
cseg01:0001447F                mov    eax, ecx
cseg01:00014481                '''mov    eax, [edx+eax*4+2]'''
cseg01:00014485                '''add    eax, edx'''
 
 
Initially, I thought of adding something like this to Actor::getSpriteParams (after line 1787 in actor.cpp, inside the if case):
  if (spriteList->spriteCount <= frameNumber) {
    _vm->_sprite->loadList(frameNumber, _vm->_sprite->_mainSprites);
    return true;
  }
 
The sprite list is loaded, but it looks to be incorrect, cause then an ScummVM stops in Sprite::decodeRLEBuffer with the following error:
 
'''Sprite::decodeRLEBuffer outLength > _decodeBufLen!'''
 
 
Known locations where this bug manifests:
* Chapter 1 (Gorrister): The hatch inside the zeppelin is not drawn correctly
* Chapter 1 (Gorrister): Repeatedly looking at the cages in the zeppelin's engine room while a caged animal is shown causes ScummVM to crash. During the animal torture animation, Actor::getSpriteParams keeps throwing warnings
* Chapter 1 (Gorrister): When flushing the toilet, the door is moved to a weird spot (looks like a line above the toilet stall)
* Chapter 1 (Gorrister): Actor::getSpriteParams keeps throwing warnings when walking to the upper floor, in the scene with the balloons and the stitching/opening
* Chapter 2 (Ellen): When pushing/using any monitor, after the cutscene the monitor doesn't show anything on its screen
* Chapter 2 (Ellen): The animation shown when the sarcophagus opens and closes is wrong. This occurs in the IHNM demo as well
* Chapter 4 (Nimdok): When pushing the vent in the patient recovery room, the vent sprite is not updated (but the vent opens normally)
* Chapter 5 (Ted): ['''Important'''] It's not possible to interact with the maid's door, as the closed door is not drawn at all. Therefore, it's not possible to tell Surgat to unlock it




Line 42: Line 82:
*** ''The nightfall animation in Benny's chapter is not handled correctly yet, due to the missing sfScriptFade function. Currently, there's a workaround that doesn't show it at all''
*** ''The nightfall animation in Benny's chapter is not handled correctly yet, due to the missing sfScriptFade function. Currently, there's a workaround that doesn't show it at all''
** sf92 (used in the demo, it's null in the full version). It is called when entering the non-interactive part of the demo through the special options screen of the IHNM demo
** sf92 (used in the demo, it's null in the full version). It is called when entering the non-interactive part of the demo through the special options screen of the IHNM demo
=== Sprite bugs ===
These bugs occur because currently ScummVM doesn't handle properly objects that have more than 1 frame. In all the problematic cases, Actor::getSpriteParams throws an invalid frameNumber warning about the problematic object. Most of these objects are doors
* Chapter 1 (Gorrister): The hatch inside the zeppelin is not drawn correctly
* Chapter 1 (Gorrister): Repeatedly looking at the cages in the zeppelin's engine room while a caged animal is shown causes ScummVM to crash. During the animal torture animation, Actor::getSpriteParams keeps throwing warnings
* Chapter 1 (Gorrister): When flushing the toilet, the door is moved to a weird spot (looks like a line above the toilet stall)
* Chapter 1 (Gorrister): Actor::getSpriteParams keeps throwing warnings when walking to the upper floor, in the scene with the balloons and the stitching/opening
* Chapter 2 (Ellen): When pushing/using any monitor, after the cutscene the monitor doesn't show anything on its screen
* Chapter 2 (Ellen): The animation shown when the sarcophagus opens and closes is wrong. This occurs in the IHNM demo as well
* Chapter 4 (Nimdok): When pushing the vent in the patient recovery room, the vent sprite is not updated (but the vent opens normally)
* Chapter 5 (Ted): ['''Important'''] It's not possible to interact with the maid's door, as the closed door is not drawn at all. Therefore, it's not possible to tell Surgat to unlock it




=== Pathfinding bugs ===
=== Pathfinding bugs ===
* Chapter 2 (Ellen): When trying to interact with the monitor on the right in the monitors room, Ellen enters the next room instead. This seems to be caused because the monitor object is problematic (could this be related to the sprite bugs above?)
* Chapter 2 (Ellen): When trying to interact with the monitor on the right in the monitors room, Ellen enters the next room instead. This seems to be caused because the monitor object is problematic (could this be related to the sprite bugs above?). The character interacts correctly with the monitor in the IHNM demo, but there the monitor has a corresponding hitzone, which does not exist in the full version





Revision as of 15:23, 12 August 2007

Status

ITE

  • ITE is completable
  • The Amiga version is not supported yet
  • Demo versions:
    • The newer demo versions of the game are supported
    • The older Windows and Mac demos are not supported yet, the game crashes when exiting the first screen
    • The original DOS demo is not supported yet, as it is based on very early version of engine, so many structures are different. Most of the resources have been mapped but they're still untested. The actors and objects list needs to be moved to our code. They've been found but not processed yet


IHNM

  • The demo has two parts, an interactive and a non-interactive one. It's playable and probably completable
    • The door of the sarcophagus that Ellen enters in the non-interactive part is not rendered at all (it's an object with multiple frames, which is currently problematic). Same bug exists in the interactive part, in the sarcophagus with the mummy. Refer to the sprite bugs section below


  • The full game is working, but there is an issue that causes problems with objects with multiple sprites, preventing it from being completable. Refer to the sprite bugs section below. Status:
    • Chapters 1-4 (Gorrister, Ellen, Benny and Nimdok) are completable with full points but there are some occasional glitches
    • Chapter 5 (Ted): Not completable, it's impossible to interact with the maid's door (the closed door is not drawn), therefore it's not possible to tell Surgat to unlock it and move further
    • Chapter 6 (Endgame): Not possible to test yet


IHNM ToDos

Sprite bugs

[Important]


These bugs occur because currently ScummVM doesn't handle properly objects that have more than 1 frame. In all the problematic cases, Actor::getSpriteParams throws an invalid frameNumber warning about the problematic object. Most of these objects are doors.


There are two main lists of sprites (_inventorySprites and _mainSprites), plus a list of objects, containing information on all the objects used. In the case of the problematic objects that have more than 1 frame, the object information itself remains the same, therefore we're not interested in the object information entry. I've checked the object flags, but saw no difference (they're 0). Perhaps the interactbits part is different? The incorrect sprite ID requested are always bigger than the largest ID in the _mainSprites list, so perhaps the correct approach would be to load the object's sprite list (using the sprite's resource ID) and append it to the end of the _mainSprites list, in a manner similar to what is done with actors (using loadActorSpriteList()) inside getSpriteParams().

Also, it seems that the original game does a slightly different calculation of frame IDs:

cseg01:0001446D                 mov     edx, mainSprites
cseg01:00014473                 xor     ebx, ebx
cseg01:00014475                 mov     ecx, [eax+GameObject.figID]
cseg01:00014478                 mov     bx, [edx+xSpriteSet.count]
cseg01:0001447B                 cmp     ebx, ecx
cseg01:0001447D                 jle     short loc_1448B
cseg01:0001447F                 mov     eax, ecx
cseg01:00014481                 mov     eax, [edx+eax*4+2]
cseg01:00014485                 add     eax, edx


Initially, I thought of adding something like this to Actor::getSpriteParams (after line 1787 in actor.cpp, inside the if case):

 if (spriteList->spriteCount <= frameNumber) {
   _vm->_sprite->loadList(frameNumber, _vm->_sprite->_mainSprites);
   return true;
 }

The sprite list is loaded, but it looks to be incorrect, cause then an ScummVM stops in Sprite::decodeRLEBuffer with the following error:

Sprite::decodeRLEBuffer outLength > _decodeBufLen!


Known locations where this bug manifests:

  • Chapter 1 (Gorrister): The hatch inside the zeppelin is not drawn correctly
  • Chapter 1 (Gorrister): Repeatedly looking at the cages in the zeppelin's engine room while a caged animal is shown causes ScummVM to crash. During the animal torture animation, Actor::getSpriteParams keeps throwing warnings
  • Chapter 1 (Gorrister): When flushing the toilet, the door is moved to a weird spot (looks like a line above the toilet stall)
  • Chapter 1 (Gorrister): Actor::getSpriteParams keeps throwing warnings when walking to the upper floor, in the scene with the balloons and the stitching/opening
  • Chapter 2 (Ellen): When pushing/using any monitor, after the cutscene the monitor doesn't show anything on its screen
  • Chapter 2 (Ellen): The animation shown when the sarcophagus opens and closes is wrong. This occurs in the IHNM demo as well
  • Chapter 4 (Nimdok): When pushing the vent in the patient recovery room, the vent sprite is not updated (but the vent opens normally)
  • Chapter 5 (Ted): [Important] It's not possible to interact with the maid's door, as the closed door is not drawn at all. Therefore, it's not possible to tell Surgat to unlock it


General

  • When the spiritual barometer changes, the character's portrait changes to "happy" or "sad", but the background color is updated only after moving to another screen
  • Chapter 1 (Gorrister): sfPlaceActor throws a "Wrong frameOffset 0x0" warning when using the knife to scare the mice away in the kitchen
  • Finish up the save/load dialogs:
    • Buttons in confirmation dialogs don't have borders like in the original
    • Input line in save game description doesn't have borders like in the original (it does, but its color is wrong)
    • Some colors are wrong
    • The save game scrollbar is wrong


Opcodes

  • Implement several missing functions:
    • sfScriptFade is not properly implemented, probably a new event type needs to be added (kEventPalFade)
      • The nightfall animation in Benny's chapter is not handled correctly yet, due to the missing sfScriptFade function. Currently, there's a workaround that doesn't show it at all
    • sf92 (used in the demo, it's null in the full version). It is called when entering the non-interactive part of the demo through the special options screen of the IHNM demo


Pathfinding bugs

  • Chapter 2 (Ellen): When trying to interact with the monitor on the right in the monitors room, Ellen enters the next room instead. This seems to be caused because the monitor object is problematic (could this be related to the sprite bugs above?). The character interacts correctly with the monitor in the IHNM demo, but there the monitor has a corresponding hitzone, which does not exist in the full version


ITE ToDos

General

  • There's a slight pause (about a second or less) when a digital music track loops, when using compressed music. This pause does not exist when the music tracks are not compressed


Opcodes

  • We need to find out where following script functions are called:
    • SF_cycleColors -- all implementation bits sit in palanim.cpp
    • sfPlayVoice -- used in ITE CD


Original engine bugs

  • Actors are drawn (some pixels above status bar) at Chota's falling. - Original engine draws its too - so it is not our bug
  • There is a missing sound sample in the intro of some ITE versions: "The humans also knew the Secret of Life, and they used it to give us the Four Great Gifts:". The missing sound sample is played correctly with the file P2_A.iaf, found in Wyrmkeep's update 2


Long-term ToDos for the SAGA engine

Bugs/misfeatures

  • handleConverseUpdate scrolls converse too quickly
  • handleCommandUpdate scrolls inventory too quickly


Optimizations

  • Make actor animation Event-driven. See FIXME in actor.cpp. Maybe it should be INTERVAL_EVENT
  • Inspect Font module - free memory, GameFontIds <-> FONT_ID
  • In many places RSC_LoadResource() is called but memory is not freed afterwards, i.e. there is a huge leak
  • Optimize screen output. Now we blit whole screen for each frame. Use "dirty rectangles" instead
  • Remove use of floating point, especially doubles.
  • Rewrite the IHNM intro credit part (ihnm_introproc.cpp), so that it uses LoadCutawayList, like the original. There's some commented out test code currently that gets the cutaway IDs via LoadCutawayList, but the cutaway playing mechanism for the introduction needs to be rewritten


MIDI related

  • Sometimes, incorrect music data is parsed to the MIDI parser, leading to a crash. This is occuring frequently in ITE, and rarely in IHNM. Perhaps it's related to some unhandled meta events. The crash always happens at sound/midiparser_xmidi.cpp in MidiParser_XMIDI::readVLQ2 at line 58. Refer to the bug report here
  • When using the original XMIDI music resources, some songs play at the wrong speed. The worst example I've heard of this is the "Elk Fanfare" during the intro. It could be the meta events we don't handle, but at least the tempo event doesn't seem to make any difference. Maybe something in the data header instead...?