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
Conversation
There was a problem hiding this 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.
engines/robin/robin.cpp
Outdated
if (_numCharactersToDisplay <= 1) | ||
return; | ||
|
||
for (int var4 = _numCharactersToDisplay - 1; var4 > 0; var4--) { |
There was a problem hiding this comment.
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?
engines/robin/robin.cpp
Outdated
} | ||
|
||
if (25 - _scriptHandler->_heroismLevel != 0) { | ||
// sub16064(23, 25 - _scriptHandler->_byte15FFA); |
There was a problem hiding this comment.
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.
engines/robin/script.cpp
Outdated
int var2 = _currScript->readUint16LE(); | ||
int var3 = _currScript->readUint16LE(); | ||
|
||
byte* mapPtr = getMapPtr(var1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting
engines/robin/script.cpp
Outdated
} | ||
|
||
void RobinScript::OC_setByte18823() { | ||
debugC(1, kDebugS |
There was a problem hiding this comment.
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.
engines/robin/script.h
Outdated
kCodeEntered = 6 | ||
}; | ||
|
||
enum KValueType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be kValueType
Thanks for your comments @sev- I will look into it. |
engines/lilliput/script.cpp
Outdated
void LilliputScript::decodePackedText(char *buf) { | ||
debugC(2, kDebugScript, "decodePackedText(buf)"); | ||
|
||
// All the languages use the English dictionnary |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
Are savegames not supported yet? |
engines/lilliput/script.cpp
Outdated
if (val == 0xFFF6) // end of script | ||
return; | ||
|
||
bool hasIf = false; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
.
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 |
…r termination check
engines/lilliput/lilliput.h
Outdated
} | ||
|
||
/** | ||
* This is the namespace of the Robin engine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Robin/Lilliput/
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. |
engines/lilliput/detection.cpp
Outdated
pattern += "-??.SAV"; | ||
|
||
filenames = saveFileMan->listSavefiles(pattern); | ||
sort(filenames.begin(), filenames.end()); // Sort (hopefully ensuring we are sorted numerically..) |
There was a problem hiding this comment.
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.
engines/lilliput/detection.cpp
Outdated
Common::SaveFileManager *saveFileMan = g_system->getSavefileManager(); | ||
Common::StringArray filenames; | ||
Common::String pattern = target; | ||
pattern += "-??.SAV"; |
There was a problem hiding this comment.
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.
engines/lilliput/lilliput.cpp
Outdated
_lastKeyPressed = event; | ||
int nextIndex = (_keyboard_nextIndex + 1) % 8; | ||
if (_keyboard_oldIndex != nextIndex) { | ||
_ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
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 |
It is time to merge it and continue work in-tree. |
This has some narrowing conversions from int to char, and causes PSP2 build to fail: Can this be fixed by someone who knows the engine, changing those char to uint8 or some such? Thanks! |
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 :)