Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#4145 closed defect (fixed)

COMI: Jerky camera movement

Reported by: eriktorbjorn Owned by: Kirben
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Monkey Island 3

Description

Latest ScummVM SVN snapshot English version of the game

I tried The Curse of Monkey Island in Wine briefly, and noticed that the camera movement in the original is a bit smoother than in ScummVM when it follows Guybrush around. In ScummVM, the speed of the movement changes noticeably, while in the original the speed looks more constant.

There is a change I can make to ScummVM that makes it look more like the original to me, and the change makes at least some sense. In ScummEngine_v7::setCameraFollows() there is this:

if (VAR(VAR_CAMERA_SPEED_X) < 8) VAR(VAR_CAMERA_SPEED_X) = 8;

if (VAR(VAR_CAMERA_SPEED_Y) < 8) VAR(VAR_CAMERA_SPEED_Y) = 8;

This makes the camera speed at *least* 8 (pixels?). If I change the "<" to ">", making the camera speed at *most* 8, it looks better to me. But is it correct?

Ticket imported from: #2580705. Ticket imported from: bugs/4145.

Attachments (3)

comi.s03 (78.9 KB ) - added by eriktorbjorn 16 years ago.
Savegame at the beginning of Part II of the game.
moveCamera_v8.txt (2.0 KB ) - added by cyxx 16 years ago.
comi.s65 (113.7 KB ) - added by eriktorbjorn 16 years ago.
Before going to Skull Island (based on old savegame)

Download all attachments as: .zip

Change History (15)

by eriktorbjorn, 16 years ago

Attachment: comi.s03 added

Savegame at the beginning of Part II of the game.

comment:1 by eriktorbjorn, 16 years ago

Incidentally, that particular camera logic has been there for at least seven years. It appears to have been added in revision 3532, "better full throttle support, a couple of MI2 fixes."

comment:2 by fingolfin, 16 years ago

I agree that this looks fishy, but maybe somebody (cyx?) can verify what the original did there... ?

comment:3 by fingolfin, 16 years ago

Owner: set to cyxx
Summary: CMI: Jerky camera movementCOMI: Jerky camera movement

by cyxx, 16 years ago

Attachment: moveCamera_v8.txt added

comment:4 by cyxx, 16 years ago

good catch ;) File Added: moveCamera_v8.txt

comment:5 by cyxx, 16 years ago

Owner: cyxx removed

comment:6 by eriktorbjorn, 16 years ago

I don't speak assembly but if "jle" means what I think it does, I guess my change is correct. Is it the same in V7 games? (As I wrote earlier, the code was originally added for "better full throttle support".)

comment:7 by Kirben, 16 years ago

Yes, your code changes are correct, judging by disassembled code of moveCamera function in FT, DIG and COMI.

I added your code changes to both branches of ScummVM SVN.

comment:8 by Kirben, 16 years ago

Owner: set to eriktorbjorn
Resolution: fixed
Status: newclosed

by eriktorbjorn, 16 years ago

Attachment: comi.s65 added

Before going to Skull Island (based on old savegame)

comment:9 by eriktorbjorn, 16 years ago

Owner: changed from eriktorbjorn to Kirben
Status: closednew

comment:10 by eriktorbjorn, 16 years ago

I just noticed that this leads to a problem with my old (late 2007/early 2008) CMI savegames, though. For whatever reason, at some point early in the game, the camera acceleration and threshold variables were all set to 0. I have no idea when this happened. I have a savegame before talking to the Voodoo Lady where they're ok, and a savegame afterwards where they're not, but I haven't been able to reproduce it.

When it does happen, though, the camera following the actor still works. But it seems manual camera movements do not. For instance, when going to Skull Island the camera just sits there, not moving, so you never arrive.

I'm not sure what we should do about this. I did notice there are at least two camera-related opcodes that we don't implement (see o8_cameraOps()), but that may be completely unrelated. File Added: comi.s65

comment:11 by Kirben, 16 years ago

I added code to correct x/y values for VAR_CAMERA_THRESHOLD and VAR_CAMERA_ACCEL variables, in older saved games.

I wonder how those variables actually ended up zeroed, since they are never altered by scripts or by engine code (after their initial settings).

Those variables should have been set correctly in COMI after revision 20906 (25th February 2006), and that saved game is marked as version 73 (well after that date).

comment:12 by Kirben, 16 years ago

Status: newclosed
Note: See TracTickets for help on using tickets.