Ticket #9170: bugfixlog.txt

File bugfixlog.txt, 3.7 KB (added by SF/toneman1138, 14 years ago)

log of process of fixing bug

Line 
1Bug fix progress log:
2 -Checked out the ScummVM svn trunk, compiled it and it's tools.
3 -Had trouble getting ScummVM developer tools compiling in Windows;
4 took this as a sign that I should finally switch to Ubuntu, which will likely
5 facilitate swifter development in the future anyway :-)
6 -Chose bug 2823309: Guybrush's walking animation continues in place as he talks when examining
7 a few different objects throughout CoMI using the 'e' keyboard shortcut for examining.
8 -Spent some time skimming through the ScummVM code base
9 (with particular attention to the scumm engine files)
10 to get a feel for how things fit together.
11 -Emulated the bug in all three places listed in the bug report.
12 -It was telling that the bug ocurred with only a few different objects.
13 I discovered (after some nostalgic messing around in CoMI) that when
14 examining most objects, Guybrush walks to a certain point, THEN proceeds
15 to make witty observations. His behaviour with the three objects that cause
16 the bug, however, is different. The "clock tower" and "distant beach" objects
17 are both clearly visible to Guybrush from anywhere in the rooms they occupy,
18 and there are so many Tiki lamps that are treated as the same object outside of
19 the Goodsoup Hotel, it wouldn't make sense for Guybrush to walk to a certain point
20 to examine them. Thus, the designers likely made these items an exception to the
21 general rule by not giving Guybrush a walk-to point when he examines them. Since
22 the cases seem to be exceptions to normal procedures, decided coding workarounds
23 for those three specific objects would be the best course of action.
24 -Used the "-u" option to dump scripts. Spent some time familiarizing myself with the way ScummVM interprets scumm bytecode.
25 -Found the clocktower observation dialogue in script 204.
26 -Made attempts to hack workarounds to the clock problem at the top of "o6_startScript()" whenever script 204 is started:
27 -called "stopActorMoving()" on Guybrush's Actor object. This failed to fix the problem.
28 -used "getRealPos()" and "startWalkActor(guybrush x position, guybrush y position, 0)"
29 in an attempt to manually create a "go to" point at Guybrush's current position before
30 script 204 runs since the glitch does not occur for objects with "go to" points. This
31 also failed to fix the problem, but Guybrush did face away from the screen while walking
32 in place this time as in accordance with the third argument of "startWalkActor",
33 which told me I was accessing the right "Actor" object.
34 -Decided that since the glitch does not ocurr when using the verb coin, perhaps emulating the actor
35 behavior triggered by bringing up the "verb coin" whenever script 204 is started would be a good fix.
36 -in looking through scripts dumped upon first use of the "verb coin" during gameplay, saw a call
37 to "actorOps.setActorStanding()". In looking through "actorOps" in "script_v8.cpp",
38 saw that a call to "startAnimActor(actor->_standFrame)" was made in case 0x80-SO_ACTOR_STOP.
39 -Augmented previous attempt with the "stopActorMoving()" call by adding "guybrush->startAnimActor(guybrush->_standFrame)"
40 call. It works! Guybrush's animation is manually set to standing at the start of script 204, then he starts talking.
41 -Began trying to pinpoint the scripts triggered by examining the other objects.
42 -Found the scripts and fixed their bugs in similar fashion!
43 (Also used printf to figure out what "vm.slot[_currentScript].number" and room numbers were supposed to be for
44 each buggy object, since I believe certain scripts control the observation of many different object throughout the game).
45