It’s moving… again… almost!

It’s been some time but now the executePlayerInput from Operation Stealth is completely reverse engineered. Here’s proof:

Full graph of Operation Stealth’s executePlayerInput-function in IDA (2916×2994 image i.e. LARGE!)

I tried a semi-quick hack to put it into ScummVM and it did seem to help with my previous problem of borking the player input handling with my incomplete fix in r33872 (See a forum post about the problem or my previous blog post for more info). Feels good getting things done ? Now just to clean it up a bit and see that I didn’t break anything else with it… and yes, also committing it ?

Summer’s end

Hi! Google Summer of Code 2008 just ended and I thought that it’d be good to make a new blog entry about where I got during the last days of GSoC and talk a bit about the overall experience.

Status update

The problem I was having with player movement last time really was just that, the player movement routine (executePlayerInput) was incomplete. Once I reverse engineered Operation Stealth’s version of it and modified ScummVM’s current implementation (r33872) of that function a bit I got the swimming working and I could get to the girl and free her:

Memory corruption hunting

Hi! I’ve been fixing lots of things in Operation Stealth. I started using Valgrind because the Cine engine corrupted memory and I didn’t know where to start fixing it. I’ve now got Valgrind running ScummVM under Ubuntu 8.04 which I’m running in VirtualBox. A virtual machine (VirtualBox) running a virtual machine (Valgrind), yay! One could think that it’d be dead slow, but actually it runs ok.

So I recommend trying out Valgrind if you’ve got memory corruption problems with a program you’re developing even if you don’t run Linux natively, it can be used through a virtual machine like VirtualBox, QEMU or VMWare. I already got some memory corruption problems fixed with Valgrind’s help.

Got through the first arcade sequence

Hi! Got through the first arcade sequence in Operation Stealth and back onto dry land :-). But it wasn’t very easy, as there were problems to overcome:

  • First arcade sequence was practically impossible to complete (Oxygen forced to maximum by a hack in r33667 for now so it’s possible to complete it)
  • Player teleported to a wrong location when getting out of the water after the first arcade sequence (Fixed by fixing checkCollision function’s boundary checking in r33668)
  • Player got completely stuck after getting out of the water after the first arcade sequence (Introduced a hack in r33673 to nudge the player off his position by one pixel to get him free)

Got to the first arcade sequence

Hi! Played the 256 color PC version of Operation Stealth under ScummVM to the first arcade sequence. Found lots of bugs but only one that was a showstopper (Crash when leaving the airport) and another one that may be a showstopper (Moving in the first arcade sequence is so hard that it may be practically impossible to complete it). Fixed the former bug already but not the latter one. Here’s a list of the bugs I found:

The big stretch begins!

Hi! Aaaaalright, got a couple of mostly annoying, but quite useful to fix to ease the playing, bugs fixed:

  • Object selection bug in Operation Stealth (Fixed in r33620 in trunk)
  • Text prompt updating regression (Fixed in r33637 in trunk, backported to branch-0-12-0 in r33638)

So, savegames and the interface in Operation Stealth are working good enough now to start the game completion run. So, Operation Stealth, here I come! Wish me luck ?

Operation Stealth savegame loading works!

Hi! Got Operation Stealth’s savegame loading to work just now. HURRAH! I’m so enormously relieved that I just might explode or something ;-). Yay! Really really good!

The problem was that the animation data table entries were loaded using a different and less complete code when loading a savegame than when running the game and loading the entries using script opcodes like loadAbs, loadAnim etc. So what I did was I made it so that the savegame loading routine uses the exact same functions that are used by the resource loading related script opcodes (The changes I made are r33529 and r33530).

Yay! Next up: Fixing the mouse cursor pointing problem in Operation Stealth (If you point at an object on-screen it’s recognized a bit to the right of its correct location. I think the problem most likely is in getObjectUnderCursor and/or executePlayerInput functions).

Getting systematic

Hi! These past few days have been pretty nerve wrecking. I’d eagerly want to get on with the reverse engineering but getting savegames working in Operation Stealth is 1) essential, 2) broken at the moment, 3) not looking like the straightforwardest code to fix (Or more like not knowing what to fix exactly). Not really knowing how to swiftly and proficiently squash the bug but still knowing that I got to fix it before going forward with other stuff is infernal for motivation.

Operation Stealth savegames bugging

Hi! Alright, now I’ve got a format for saving and loading Operation Stealth savegames. But the problem is that whilst saving seems to work and loading too, after I load an Operation Stealth savegame the game crashes in the main loop in processSeqList… something to do with all the animated stuff as I tried removing the call to processSeqList from the main loop and suddenly there were no characters on-screen at all ? but at least it didn’t crash then.

So to get this bug smashed next… ROAR!

Savegame format coming together

Hi, this savegame format thing has been getting on my nerves quite a bit. Last night I thought what the hell, I’ll get this done and just hacked together code to get forward (1, 2, 3). Recently I reverse engineered Operation Stealth’s PC version’s savegame loading routine and using that information I wrote documentation of the format to ScummVM’s wiki.