Opened 14 years ago

Closed 14 years ago

Last modified 12 months ago

#8470 closed patch

KYRA: Room information and sprite fixes

Reported by: vinterstum Owned by: lordhoto
Priority: normal Component: Engine: Kyra
Keywords: Cc:
Game:

Description

Adds the full tables of room IDs and room names.
Nifty addition: Hitting the arrow keys will take you to
the room that lies in that direction, if there is one
(not counting special exits).

Also fixes a couple of sprite anim related issues that
popped up in a couple of rooms.

Ticket imported from: #1324980. Ticket imported from: patches/575.

Attachments (1)

kyra_spritefixes_v3.patch (14.4 KB ) - added by vinterstum 14 years ago.
Kyra sprite fixes v3

Download all attachments as: .zip

Change History (14)

comment:1 by lordhoto, 14 years ago

Some things:

comment:2 by lordhoto, 14 years ago

Some things:
- First of all it only works with the CD version
(just crashes with (german) floppy)
- Some animations are still played wrong
- room list seems to be strange sometimes (maybe double
used pictures but different usage in game?)
- also I think you shouldn't delete the Item list entry in
the struct Room

But nice work, but pls fix these things first.

comment:3 by vinterstum, 14 years ago

Hm, it works with the english floppy version. Are some of
the room names different in the German one?

And yes, I know some animations are still wrong. Most likely
they're the ones controlled by the .emc scripts, so not much
I can do with those yet.

There's tons of rooms in the game that use the same graphics
:). Hence why a lot of the rooms share IDs (they aren't
really IDs, actually indexes in the string of room names).
In particular, the forest rooms and the cave rooms are
repeated a lot. Some times the background image is flipped
horizontally, but it's read from the same file.

The reason I deleted the Item list entry, is that the Rooms
list is now hardcoded. If each entry were to also to contain
the 48 bytes used for object data, and the 48 bytes used for
those unknown pointers, that's a lot of wasted space with
240 entries (as those values are all empty at game start).
It would be a lot better to keep those values in a seperate
struct, and dynamically allocate memory for them at startup.
This is one instance where how the original designers did
it, is just plain wrong ;).

comment:4 by lordhoto, 14 years ago

K problem with german floppy is that the main screen has a
different name.

Go to the silver atlar it is drawn incorrect (maybe only
with cd version).

But the cave rooms are always drawn with 4 'doors' so I
assume some sprites are drawn over them by the scripts then?

comment:5 by lordhoto, 14 years ago

K problem with german floppy is that the main screen has a
different name.

Go to the silver atlar it is drawn incorrect (maybe only
with cd version).

But the cave rooms are always drawn with 4 'doors' so I
assume some sprites are drawn over them by the scripts then?

comment:6 by cyxx, 14 years ago

A possible problem I see is the fact that sprite coordinates
are actually *signed* int16. So, it would be nice to add
some clipping to Screen::copyRegion() and cast the return
values of READ_LE_UINT16() accordingly. That way, you should
be able to get rid of your "dirty fix" in Sprite::drawSprites().

Also, feel free to rename the ".id" field of the Room
structure to something more descriptive.

Concerning the "wasted place", the developers did probably
like this to simplify the code ; ie. no need to allocate a
new table, nor to check for memory allocation error.

comment:7 by lordhoto, 14 years ago

Owner: set to lordhoto

comment:8 by vinterstum, 14 years ago

Ok, v2 of the patch uploaded.

Included some more sprite fixes (the altar animation works
correctly now, as well as others. Also, animations that are
supposed to only run once properly do so).

Added an optional 'flags' parameter to Screen::CopyRegion(),
to allow horizontal flipping and and clipping (wasn't sure
whether to make the clipping an always-on feature, feel free
to change it).

And the 'id' field is renamed ;) (to nameIndex).

And yes, I realize hardcoding the entire table makes the
code slightly simpler. IMHO, that's not worth increasing the
executable size by 18k per table though. Having one
hardcoded table and one dynamic table with shared indexes
isn't that big of a hassle. Alternatively, the whole table
could be dynamically allocated, which would allow us to pack
the hardcoded bits beforehand.

by vinterstum, 14 years ago

Attachment: kyra_spritefixes_v3.patch added

Kyra sprite fixes v3

comment:9 by vinterstum, 14 years ago

v3, cut out the room table stuff as it's not relevant
anymore. Patch now only contains the sprite fixes and the
clipping code.

comment:10 by lordhoto, 14 years ago

Thanks for the patch.
One small things has been corrected (see cvs logs for that).

comment:11 by lordhoto, 14 years ago

Status: newclosed

comment:12 by lordhoto, 14 years ago

Thanks for the patch.
One small things has been corrected (see cvs logs for that).

comment:13 by digitall, 12 months ago

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