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

LILLIPUT: Merge of Lilliput Engine #1142

Merged
merged 233 commits into from Mar 28, 2018
Merged

LILLIPUT: Merge of Lilliput Engine #1142

merged 233 commits into from Mar 28, 2018

Conversation

Joefish
Copy link
Contributor

@Joefish Joefish commented Mar 18, 2018

This PR adds support for 'The Adventures of Robin Hood' by Millenium Interactive.
The game is in a playable state but input handling / engine structure needs some more love
as it is still quite laggy. Also audio is not working yet.
Despite those shortcomings, its core, the scripting engine seems to be completely reversed
and implemented. Also during my play testing I haven't had any issues except those
aforementioned. I must add that I haven't played it through as I'm not that familiar with the
game yet (and the controls are quite frustrating) so there may be problems I am not aware of.
@Strangerke may be able to correct me and go into more details.

Tested on Linux 4.15.7-1-ARCH
Playtest video (7a978b6)

Looking forward to your suggestions :)

Copy link
Member

@sev- sev- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid engine, just a few comments. Great work. Is practically ready for the merge.

if (_numCharactersToDisplay <= 1)
return;

for (int var4 = _numCharactersToDisplay - 1; var4 > 0; var4--) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not use the standard qsort() here?

}

if (25 - _scriptHandler->_heroismLevel != 0) {
// sub16064(23, 25 - _scriptHandler->_byte15FFA);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a todo? and the same call above.

int var2 = _currScript->readUint16LE();
int var3 = _currScript->readUint16LE();

byte* mapPtr = getMapPtr(var1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

formatting

}

void RobinScript::OC_setByte18823() {
debugC(1, kDebugS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a noop. Should be x = CLIP(x, 0, 56). Check other cases too.

kCodeEntered = 6
};

enum KValueType {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be kValueType

@Joefish
Copy link
Contributor Author

Joefish commented Mar 19, 2018

Thanks for your comments @sev- I will look into it.

@Joefish Joefish changed the title ROBIN: Merge of Engine for 'The Adventures of Robin Hood' LILLIPUT: Merge of Lilliput Engine Mar 19, 2018
void LilliputScript::decodePackedText(char *buf) {
debugC(2, kDebugScript, "decodePackedText(buf)");

// All the languages use the English dictionnary
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

@bonki
Copy link
Member

bonki commented Mar 19, 2018

Are savegames not supported yet?

if (val == 0xFFF6) // end of script
return;

bool hasIf = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hasIf is unused - is this intentional?

case 0xF8: {
int index = curWord & 0xFF;
assert((index >= 0) && (index < 40));
str = Common::String::format("_vm->_rulesBuffer12Pos3[%d]", index);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a break is missing here. If this fallthrough really is intentional it should be marked as such with // fall through.

@dreammaster
Copy link
Member

Nice work on updating the history. Just a minor overlook.. the header file defines should ideally be updated as well from names like ROBIN_CONSOLE_H to use LILLIPUT_ instead

}

/**
* This is the namespace of the Robin engine.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Robin/Lilliput/

@i30817
Copy link
Contributor

i30817 commented Mar 20, 2018

These two games (ROME AD&92 and Robin) are great candidates for wider resolutions - maybe including a saner viewport than a oblique square too - and better pathfinding. Wouldn't say no to be able to queue up at least one action during pause mode (to talk/look/steal/murder running characters). Can't wait.

pattern += "-??.SAV";

filenames = saveFileMan->listSavefiles(pattern);
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Common::sort(saveList.begin(), saveList.end(), SaveStateDescriptorSlotComparator()); can now be used so replace hope with certainty.

Common::SaveFileManager *saveFileMan = g_system->getSavefileManager();
Common::StringArray filenames;
Common::String pattern = target;
pattern += "-??.SAV";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this has been written, # has been added to match specifically numbers.

_lastKeyPressed = event;
int nextIndex = (_keyboard_nextIndex + 1) % 8;
if (_keyboard_oldIndex != nextIndex) {
_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the seed to a fixed value will make the random source always return the same sequence.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDIT: If someone else is wondering, this regards line 2847. For some reason the preview points to the wrong piece of code.

This ensures that the save files are sorted numerically instead of
'hoping' for it.
@Joefish
Copy link
Contributor Author

Joefish commented Mar 20, 2018

Thanks for the feedback everyone!

@i30817 This would be something we can take a look at once the base is adequarely stable, but definitely worth exploring later.
@bonki It seems save game support was partially implemented (or maybe even working at one point in the past) but right now it does not.
@dreammaster Actually I had it written down on my TODO list but somehow slippeed my mind.. Fixed it already though :)

@dreammaster
Copy link
Member

Another minor thing.. is there any particular reason a "_shouldQuit" variable is being set up and used in lilliput.cpp? It would seem easier not to bother with it, and simply use the base engine shouldQuit() method instead

@sev-
Copy link
Member

sev- commented Mar 28, 2018

It is time to merge it and continue work in-tree.

@sev- sev- merged commit 74ce6af into scummvm:master Mar 28, 2018
@rsn8887
Copy link
Contributor

rsn8887 commented Mar 28, 2018

This has some narrowing conversions from int to char, and causes PSP2 build to fail:
http://buildbot.scummvm.org/builders/master-psp2/builds/2354/steps/compile/logs/stdio/text

Can this be fixed by someone who knows the engine, changing those char to uint8 or some such? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants