Curse of Enchantia

All the inane chatter goes in here. If you're curious about whether we will support a game, post HERE not in General Discussion :)

Moderator: ScummVM Team

Del
Posts: 38
Joined: Wed Apr 26, 2006 4:48 pm

Post by Del »

The Madventurer wrote:Any news about this RE effort?

I only found this on the RE wiki: http://rewiki.regengedanken.de/wiki/.SPR
I've been extremely busy over the summer so I haven't worked much on REing aside from what is documented here in the thread and on the wiki.

I'm looking at various RLE algorithms as it is likely that is what is used in the .BRD (Brad) and .SPR files. If I remember correctly I've named about 30-35% of the labels in the disassembly.

I also have notes on the overall structure of the executable, but in terms of completeness, I'm only about 10% into completely reverse engineering.
Ian Sabine
Posts: 6
Joined: Tue May 23, 2006 8:45 pm

Post by Ian Sabine »

I never used any specific RLE algorithms, but they are RLE. The first 2 halfwords should be an offset from the home position (usually bottom center), followed by the bounding width and height (which could be different for each frame of animation). They might even be bytes, can't remember.

OTOH here's what I think I used.
num = width * height
while (num > 0)
{
read byte -> count
if (count < 0)
{
read byte -> value
copy value into next -count pixels
num += count
}
else
{
copy count+1 pixels
num -= count+1
}
}

Also bear in mind that mode X was used, so there might be a factor of 4 used in places.
Del
Posts: 38
Joined: Wed Apr 26, 2006 4:48 pm

Post by Del »

When you say halfword, do you then mean byte? Or am I misremembering wordlength on the Intel processor, because they seem to start with two 16b values that denote width & height, then followed by two more 16b values that appear to be the offsets.

At the moment I'm writing some small tools for quickly extracting a specific sprite/etc's values so I can look them over without the clutter of having everything in a hex editor. I'll try to swap in the pseudocode and see what happens :)
Ian Sabine
Posts: 6
Joined: Tue May 23, 2006 8:45 pm

Post by Ian Sabine »

By halfword, I shoulda said 2 bytes :)
I'm just thinking in terms of a word being 4 bytes (32 bits).
timofonic
Posts: 254
Joined: Thu Jun 01, 2006 2:18 am

Post by timofonic »

Any news? Maybe this game shares engine with other Core Design adventure game, Universe...
Del
Posts: 38
Joined: Wed Apr 26, 2006 4:48 pm

Post by Del »

no news I'm afraid. I'm stuck at the moment so I've taken some time off. I had some hard drive troubles, so I'm unable to run IDA at the moment. I'll let you know when I'm back to working on CoE.

As far as I know, it's not an engine per se, as Ian Sabine said the whole thing is coded by hand in machine code. While the interfaces of Curse and Universe are similar, I doubt there are code similarities (perhaps some file formats are the same, but that is probably all.)
Ian Sabine
Posts: 6
Joined: Tue May 23, 2006 8:45 pm

Post by Ian Sabine »

You are correct, the entire game (Universe) was written from scratch. Probably the only code shared would be the RNC unpacker :)

Del, how's it going?
Del
Posts: 38
Joined: Wed Apr 26, 2006 4:48 pm

Post by Del »

Ian Sabine wrote:You are correct, the entire game (Universe) was written from scratch. Probably the only code shared would be the RNC unpacker :)

Del, how's it going?
Well I have a partially working sprite decoder going. It chokes a bit but the output sometimes looks right. Nothing to show yet, though. One thing I'm wondering about is whether the stuff that comes between the end of the RLE and the beginning of the next sprite is garbage or if it's used for anything.

Still making slight progress on commenting the disassembly, but I was just at Roskilde Festival so my brain is a bit mushy at the moment :D

It's all very baby steps as it's the first reverse engineering project I've worked on outside of a classroom environment.
Del
Posts: 38
Joined: Wed Apr 26, 2006 4:48 pm

Post by Del »

I've been contacted by another guy who's also working on reverse engineering Enchantia. He's made a lot more progress than me, but we're comparing notes at the moment.

Just a quick FYI for the persons still interested in what goes on here :)
User avatar
Raziel
ScummVM Porter
Posts: 1522
Joined: Tue Oct 25, 2005 8:27 am
Location: a dying planet

Post by Raziel »

Del wrote:I've been contacted by another guy who's also working on reverse engineering Enchantia. He's made a lot more progress than me, but we're comparing notes at the moment.

Just a quick FYI for the persons still interested in what goes on here :)
You could drag him in here, so he might get the same warm shower of acception you get .. err, well you know ;-)
timofonic
Posts: 254
Joined: Thu Jun 01, 2006 2:18 am

Post by timofonic »

Very nice news! I would like to see this game being supported in ScummVM in the future.

Just show some screenshots from the "COE Team", we get bored and need to see new stuff in the works ;)

This will be a very good snack until the definitive assimilation happens and adventure games conquer the world... CabalVM
Del
Posts: 38
Joined: Wed Apr 26, 2006 4:48 pm

Post by Del »

Oh he knows of the thread (found me through it). I'm sure he'll post something if he feels like it.

There's no new code at the moment, only a more thoroughly commented disassemble. But that's a huge step of the way to be sure.

Here's a screenshot ;)

Image

Once it's fully (or nearly so) commented, we can start writing an actual engine.
Del
Posts: 38
Joined: Wed Apr 26, 2006 4:48 pm

Post by Del »

Well I was bored so I've written a skeleton engine.

Doesn't do anything yet, I'm just trying to get a feel for how ScummVM does things, what the important classes are, etc. Also getting reacquainted with C++, as it's been years since I've done any work in that language.

By the way, the quux examples on the HOWTO-Engines page on the wiki are pretty outdated. It was quicker to just have another engine open in an editor window and go from there.
Retrogamer
Posts: 18
Joined: Sun Jan 27, 2008 5:48 pm
Location: Richmond, Virginia, United States

Post by Retrogamer »

Did Core only ever make 2 point-and-click adventure games? I know that by 1995 they had pretty much moved on to the 3d realm with Tomb Raider. There was a detective game that Core published called "The Big Red Adventure," but it was developed by Dynabyte. I'm just wondering because maybe one of those had some code in common with Curse or Universe.
Del
Posts: 38
Joined: Wed Apr 26, 2006 4:48 pm

Post by Del »

Those two (Enchantia & Universe) are the only Core-developed adventure games that I know of. And Ian Sabine said they don't share any code except perhaps RNC-compressed files, so I doubt there's anything to gather.
Post Reply