Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRYO: New engine #892

Merged
merged 182 commits into from Feb 7, 2017
Merged

CRYO: New engine #892

merged 182 commits into from Feb 7, 2017

Conversation

@Retro-Junk
Copy link
Contributor

Retro-Junk commented Jan 25, 2017

This is the reconstruction of engine for Lost Eden adventure game, originally released by French company Cryo back in 1995.

Since support (or lack thereof) for this particular game was a frequent topic of ScummVM's forums, I decided to bite the bullet and see what can be done. Fortunately, the game itself turned out to be very simple and in under 2 months it become fully playable under ScummVM. That was done in April-May 2016. Since I never worked on ScummVM before, later this project turned into a slow burner, while Strangerke, me and sev slowly bent the code into better shape.

At the moment the engine is mostly complete, but still has a number of things to do. Mac version of the game is nearly-complete, while DOS version requires more debugging and testing. No support for console versions yet.
More information can be found in readme.txt and bugs.txt files. Here is the list of what is done and what not:

Engine status:
Mac: Should work just fine for the most part. Playable from start to end without any game-breaking bugs.
PC: Missing several minor features and has a number of glitches (described below.) Need to be tested. Requires pre-made external dat file (see devtools/create_cryo.)

Top priority things to fix/improve:
All: Game Save/Load system is very crude/non-portable and need to be rewritten.
All: No support for ingame restart feature.
All: Resources loading may be not very cross-platform safe and requires further checking.
All: Probably bug in character's idle animation, as they tend to close their eyes too often.
All: Various source code rough corners - non-descriptive names of certain members, obsolete/unused code, etc.
PC: No support for old HNM videos format. Those are used for Logo/Credits and several ingame movies.
PC: No promotional banner at the end of the demo version. It just silently crashes.
PC: Wrong cursor on the frescoes screens.
PC: Wrong backdrop on a valley map screen.
PC: Some sounds are ended prematurely or not played at all (like, flute's sound.)

Also, because Cryo released a number of other games that share parts of this engine, it may be worthy to reuse it for other projects. Dune is one of them.

@sev- sev- force-pushed the Retro-Junk:cryo branch from 4ad04c4 to 8f7c4fa Jan 25, 2017
sev- and others added 2 commits Jan 25, 2017
@criezy

This comment has been minimized.

Copy link
Member

criezy commented Jan 29, 2017

Great work!
I didn't look at the code in details, but at first glance it looks quite clean. And I didn't encounter any major issue playing with the GoG version (but I only played the first few minutes and stopped after speaking with the king).

debugC(1, kCryoDebugExample, "Example debug call");

// This test will show up if --debugflags=example or --debugflags=example2 or both of them and -d3 are specified on the commandline
debugC(3, kCryoDebugExample | kCryoDebugExample2, "Example debug call two");

This comment has been minimized.

Copy link
@bluegr

bluegr Feb 1, 2017

Member

These debug statements are meant to be placeholders, and look to be leftovers... they should be removed, eventually

int16 gMacintize = 0;
color_t black_palette[256];
color_t last_palette[256];

This comment has been minimized.

Copy link
@bluegr

bluegr Feb 1, 2017

Member

Seems like all these CLPalette_foo functions will be eventually moved into a CLPalette class... right?

};

struct color3_t {
uint16 r, g, b;

This comment has been minimized.

Copy link
@bluegr

bluegr Feb 1, 2017

Member

I don't get it... this game is using an indexed palette (256 colors), so these should be bytes, not 16-bit words. Same goes for the color_t struct below

This comment has been minimized.

Copy link
@wjp

wjp Feb 2, 2017

Member

While I agree it's a bit odd to use uint16 here, that's unrelated to the fact that it uses a 256 color palette. If the engine wants to use 16 bit for color components internally, why not. (Although it is presumably unnecessary.)

Changing it to uint8 will require careful changes to most of the palette handling code.

This comment has been minimized.

Copy link
@Retro-Junk

Retro-Junk Feb 3, 2017

Author Contributor

This is primarily due to the fact that the engine is based on Mac version of the game. On Mac color components are 16 bits and this engine follows the original code to ease the debugging. As the game itself uses only 8 bit colors it is surely possible to shrink that entries back to 8 bits. But since this will require a lot of modification to existing code that can easily break it, me and Strangerke decided not to do it at the moment.


void CLPalette_Send2Screen(struct color_t *palette, uint16 first, uint16 count) {
if (gMacintize) {
palette[0].r = palette[0].g = palette[0].b = 0xFFFF;

This comment has been minimized.

Copy link
@bluegr

bluegr Feb 1, 2017

Member

Again, this looks odd... shouldn't the r/g/b components be bytes, instead of 16-bit words?

}

void CLBlitter_CopyView2ViewSimpleSize(byte *src, int16 srcw, int16 srcp, int16 srch,
byte *dst, int16 dstw, int16 dstp, int16 dsth) {

This comment has been minimized.

Copy link
@bluegr

bluegr Feb 1, 2017

Member

Perhaps it would be cleaner to use Common::Rects here?

int16 srcpitch = view->_pitch;
int16 dstpitch = dest->_pitch;

// this is not quite correct?

This comment has been minimized.

Copy link
@bluegr

bluegr Feb 1, 2017

Member

Is that a TODO? If yes, please mark it as such


bool CryoEngine::isScanCodeDown(int16 scancode) {
return false;
}

This comment has been minimized.

Copy link
@bluegr

bluegr Feb 1, 2017

Member

Dead code?

///// CLFile
void CLFile_Write(Common::File &handle, void *buffer, int32 *size) {
assert(0);
}

This comment has been minimized.

Copy link
@bluegr

bluegr Feb 1, 2017

Member

Dead code?

}

void Sound::setLength(int length) {
}

This comment has been minimized.

Copy link
@bluegr

bluegr Feb 1, 2017

Member

Dead code?

void EdenGame::actionGetFullNest() {
if (_globals->_curObjectId != 0)
return;
_globals->_roomPtr->_bank = 282; //TODO: fix me

This comment has been minimized.

Copy link
@bluegr

bluegr Feb 1, 2017

Member

Why should this be fixed? (same for the others below)

_scrollPos = 0;
char obj = _curSpot2->_objectId - 14; //TODO
_globals->_prevLocation = target & 0xFF;
deplaval((target & 0xFF00) | obj); //TODO careful!

This comment has been minimized.

Copy link
@bluegr

bluegr Feb 1, 2017

Member

Again, I don't understand these TODOs... what needs to be done here, and why should we be careful?

@sev-

This comment has been minimized.

Copy link
Member

sev- commented Feb 7, 2017

Merging...

@sev- sev- merged commit b3784db into scummvm:master Feb 7, 2017
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.