Opened 12 years ago

Closed 12 years ago

Last modified 6 months ago

#8612 closed patch

Kyra2: Intro fixes

Reported by: bluegr Owned by: vinterstum
Priority: normal Component: Engine: Kyra
Keywords: Cc:
Game: Kyrandia 2

Description

I was playing around with the intro of Kyrandia 2. As far as I see, the whole sequence is almost there but the author of the code seemed to have abandoned it. Since noone has updated it in a while, I figured it would be good to do some work on it. The good thing is that the intro is actually a collection of smaller sequences (stored in wsa files) which are displayed one after the other

I still haven't figured out the opcode of the intro parts, so the missing last part is done with a bit of a hack, right where the unloading takes place (that's why the last scene ends prematurely). The correct way to do it would be to render the last part in its corresponding opcode, which I don't know yet

There are a couple of parts which still need work, as the WSA player doesn't handle them correctly, or they are not drawn at the correct screen coordinates. These parts are:
hand1a.wsa, hand1b.wsa, hand1c.wsa which show up as garbage and cause the WSA player to crash, stated as a comment too.
point.wsa which is the last part (and was missing) and ends prematurely (because it's not rendered when its corresponding opcode is called).

It seems that seq_waitForChatsToFinish should wait till the last scene is finished, but unfortunately this is not the case...

I also don't understand how the sequence control parameter works and I can't find any information regarding it. If anyone has information, it would be great

Anyway, this is just some premature work to whoever might be interested (lordhoto?). I can't find information regarding the format (perhaps I haven't looked thoroughly?) so I can't progress without disassembly or some further understanding on how WSA files work

Currently, the TODOs to make the intro fully working are:
- render over1.wsa properly (in its correct coordinates, the animation also seems to show some unexpected black mask around the frame, probably a badly drawn alpha channel?)
- render hand1a.wsa, hand1b.wsa and hand1c.wsa properly
- render point.wsa in its associated opcode

Ticket imported from: #1669536. Ticket imported from: patches/717.

Attachments (3)

kyra2_intro.diff (1.5 KB) - added by bluegr 12 years ago.
Kyra 2 intro fixes
kyra2_intro2.diff (9.0 KB) - added by bluegr 12 years ago.
Improved fixes to the intro, now all of it is shown but with glitches
kyra2_intro3.diff (11.7 KB) - added by bluegr 12 years ago.

Download all attachments as: .zip

Change History (16)

Changed 12 years ago by bluegr

Attachment: kyra2_intro.diff added

Kyra 2 intro fixes

comment:1 Changed 12 years ago by vinterstum

Hiya!

The intro isn't abandoned, just put on hold for a little while :) (What kyra2 stuff I've had time for lately has been REing of the main game, but it's not terribly much).

A few things:

The sequences aren't stored in the WSA files, they're hardcoded into the standalone intro executable (which is why they have to be completely reimplemented).

The sequence control parameter is basically a list of what frames to display, and for how long. Used to go back and forth in a wsa, for example.

What would be very handy is figure out what the problem with the hand1x files is (I have no idea about that one), and figure out the correct "mix" of parameters for the over1.wsa file (wsa files can rendered offscreen, or to an existing buffer, for example, as well as using XOR to decode one frame from another using some delta information, and the flags for these things are probably a bit different in kyra2, or extended).

In short there's some subtle differences between the wsa format of kyra1 and kyra2, which aren't known yet.

The patch you submitted doesn't really add much, but if you figure out the above issues and submit a patch for that, LordHoto will be your personal slave for a week!

Disclaimer: He probabably won't. We'd be very grateful though :).

comment:2 Changed 12 years ago by vinterstum

Oh, and another TODO is fading out parts of the screen to greyscale when the images are overlayed, in the kyrandia overview scene.

comment:3 Changed 12 years ago by bluegr

And another TODO: Implement the "slide in" animation when a closeup is rendered, currently, closeups are drawn without any such animation

Changed 12 years ago by bluegr

Attachment: kyra2_intro2.diff added

Improved fixes to the intro, now all of it is shown but with glitches

comment:4 Changed 12 years ago by bluegr

Here's a second attempt
Compared to the SVN this fix will show almost all the intro. The first part (overview) is still not rendered properly. I still don't understand how delta information is stored :(

Here's a breakdown of all the parts:

overview: the bit that shows Kyrandia disappearing. I still don't understand how delta information is stored, so I haven't worked on the disappearing islands animation :( The disappearing forest closeup seems to take too long to switch, so the music is not synced with the last scene (the disappearing dragon head). I've added a function that makes the scene greyscale (fadeToGrey in screen.cpp), but this is still buggy, and it crashes ScummVM (that's why it's commented out). A more correct and elegant solution would be to change only some of the colors in the palette, not the whole palette, as the closeups are still in color. Also note that the RGB values are from 0-63, not 0-255 (thanks lordhoto). Also, the "slide in" animation when a closeup appears needs to be implemented (although it's not that critical)

library: seems to be working fine (this was in the code already). Note that sometimes, the subtitles are not displayed at all form some point in this part onwards (perhaps a seq_waitForChatsToFinish issue?)

hand: the 3 handx videos seem to be parts of the scene where the hand is pointing at the diagram and the Darm and the dragon are watching it. One part seems to be the moving dragon head, another the moving head of Darm and the third the hand itself (although this is pure speculation). Since these parts crash the player, I've commented them out so that the next part of the introduction can be viewed. The scene is still rendered, but it's still. I've figured out how the control parameters work (thanks vinterstum) so I've added more repetitions for the applause screen (hand2.wsa) and more for the parts where the hand is pointing at the drawing (hand3.wsa and hand4.wsa). I've also put some missing subtitles in these parts. For the final part, I've added the missing scene where the hand is pointing at Zanthia (point.wsa). The intro works fine up to that point

zanfaun: this is the scene with Zanthia and Faun outside Zanthia's house. The scene is displayed correctly and the music plays fine, however there's a part in the wsa file which is repeated (zanthia and faun entering the house), wo there must be some control parameters for this movie to stop the repetition. The bad thing about this scene is that it's a movie of the game itself, not part of the intro, so the dialogs are displayed in a different manner and are stored elsewhere. In that scene, there's speech in the CD version but no speech in the floppy one

So to sum up, here are the TODOs:
- render over1.wsa and over2.wsa properly (fix the incorrect disappearing island animations - probably a delta mask issue)
- render hand1a.wsa, hand1b.wsa and hand1c.wsa properly (all parts of the same scene)
- correctly implement screen fading to greyscale in the kyrandia overview scene
- implement the "slide in" animation of the closeups
- add control parameters for the last scene (zanthia and faun) so that only the needed part is shown
- read the resource files for the animation dialogues in the last scene (zanthia and faun)
- fix the disappearing subtitles in some of the intro scenes
- sync some of the scenes to the music, decrease the pause when some screens change

The changes I've made can be seen in kyra2_intro2.diff - with these changes, all the scenes in the intro play, albeit with the glitches reported above
File Added: kyra2_intro2.diff

Changed 12 years ago by bluegr

Attachment: kyra2_intro3.diff added

comment:5 Changed 12 years ago by bluegr

And here's another version with more functionality implemented

I haven't figured out how to mask out the black pixels of the over1 and over2 animationsbut it looks like more than 1 memcpy operations will be needed in copyRegion().

I've implemented the part in the intro where the screen turns grey and the animation of the last scene should display correctly (but thre is still no dialogue and no speech in that scene). I've also fixed some disappearing subtitles and music sync issues.

Also, it's now not possible to skip the animation of the main menu (which makes it more consistent with the original interpreter)

TODOs:
- render over1.wsa and over2.wsa properly (fix the incorrect disappearing
island animations - probably a delta mask issue)
- render hand1a.wsa, hand1b.wsa and hand1c.wsa properly (all parts of the
same scene)
- implement the "slide in" animation of the closeups
- read the resource files for the animation dialogues in the last scene
(zanthia and faun)

File Added: kyra2_intro3.diff

comment:6 Changed 12 years ago by bluegr

One more TODO:
- implement the "fade out" screen effect when the closeups appear in the library scene

This is harder than the first screen's "fade to grey" effect, as both the closeups and the library scenes have a very similar palette, so the library images have to be redrawn with different colors. Not sure how fast this is going to be in devices like mobile phones.

Moreover, the dialogs for the last scene (Zanthia and Faun) are hard-coded, so they can be displayed, but they still have to be read from the original files (so that the dialogs for the non-English versions are shown correctly), plus the voice overs from the CD version have to be played as well for that scene

comment:7 Changed 12 years ago by fingolfin

Owner: set to lordhoto

comment:8 Changed 12 years ago by lordhoto

Owner: changed from lordhoto to vinterstum

comment:9 Changed 12 years ago by fingolfin

What is the status of this item?

comment:10 Changed 12 years ago by vinterstum

You know, I actually forgot about this one.

Looks like nice work, I'll check out the latest version.

comment:11 Changed 12 years ago by vinterstum

Patch applied. Thanks thebluegr, and sorry for the delay :).

comment:12 Changed 12 years ago by vinterstum

Status: newclosed

comment:13 Changed 6 months ago by digitall

Component: Engine: Kyra
Game: Kyrandia 2
Note: See TracTickets for help on using tickets.