-
Notifications
You must be signed in to change notification settings - Fork 56
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
Support bit perfect reading and writing LDB, LMT, and LMU #242
Conversation
Fix Terms: battle_start/miss/status/row/order/wait_on/wait_off are 2k3 only
Default it to -1. If it's present in db we read, we set it to some value and then it'll be written out. If it's not present, it'll stay -1 and then the default handler will not write it.
RPG::Terms 0x3 if empty string will be present in a 2k database but not a 2k3 database. This appears a one-off situation so it is hacked in for now..
214ca3a
to
332de99
Compare
Great. I will shoot this at my local game list and the rmarchiv.tk database (>1000 games) later. |
332de99
to
a5294f5
Compare
.flow would likely fail to convert cleanly as it has a 2k3 database but we detect it as 2k. I don't think there is anything we can do in situations like that. Regarding Makefile.am, is maintaining autotools support really still needed now that we have Cmake? |
As said, we currently use the autotools for the distribution archives and some packagers will also depend on them (i.e. macOS homebrew, some GNU/Linux distributions, platforms without cmake support). |
but what we will remove soon are the Visual Studio project files which are by far the worst to maintain with there XML bloat. |
a5294f5
to
22dcc27
Compare
@fmatthew5876 |
Not yet. I'll look into this later today. |
Okay then I maybe misunderstood what I'm supposed to test. |
Sorry I didn't answer that well. I've only tested LDB -> LDB. I haven't done xml yet. Which version of HH do you have? I tested it on the latest one in my github. |
Okay, what I did: Compiled liblcf on branch "ldb_enums2", then compiled the following program: #include <cstring>
#include <string>
#include "ldb_reader.h"
int main(int argc, char** argv)
{
std::string infile = argv[1];
std::string outfile = argv[2];
LDB_Reader::Load(infile, "1252");
LDB_Reader::Save(outfile, "1252");
return 0;
}
Then I convert via this tool and run "diff RPG_RT.ldb RPG_RT2.ldb"
Also tested it with your HH3 ldb |
My test driver is this: https://github.com/fmatthew5876/hh3-rm2k/blob/fixes-2.1/dev/autodb/main.C without the call to One difference I see is I'm passing EDIT: also I forgot to mention. The hh3 version I tested on is in the fixes-2.1 branch. Not master. |
okay it doesn't matter if I do LDB->XML->LDB or LDB->LDB, both give the same results. With your hh3 version I get "identity" but for anything else I fire at the converter the result differs. |
For my test data I get a perfect match for: For 2k: 2 out of 1110 Which is a good start imo |
RPG::Parameters was always getting reset to actor final level instead of engine final level (50, or 99). This patch resizes parameters to the engine final level, but only if they are smaller.
I found a bug in how we read With this fix I've tested:
@Ghabry That test setup is awesome. Could you run your test suite again and tell me a couple sample games that still fail? |
e8ddb15
to
c90f0c1
Compare
I've rebased this onto master. Also fixed the excel related differences. This one is a huge pain to rebase. Basically have to redo I verified rebased |
271ed25
to
260774b
Compare
3d86e72
to
28e7989
Compare
5361ab4
to
f7d2da8
Compare
codewise it looks fine to me but I will do a retest with LDB and also add LMT and LMU files. (maybe not all LMU files though because there are so many...) |
Going to bed now, therefore only dumping you the raw output of my improved test script: (omitted LSD as this is part of another PR) and havn't filtered the bogus games you already reported... For Maps I only used 0001 because I noticed that when the 1st map fails usually all other maps fail, too and using all maps far too long. |
I don't see any new regressions for LDB from your list. All the ones there have some corruption or have terms issues. Sweet Dreams (Demo) all the files (LDB,LMT,LMU) have 9 or 10 extra zero bytes at the end. I don't know what these are supposed to be for but liblcf doesn't write them back out. This is the only one failing LMT testing, so we can sign off on LMT being done. For LMU, are you sure your test is correct? I tested some of the failing games in your list and they came out clean, all LMU files. Do you load the database and the treemap into memory before loading and saving maps? I do that in my test as they can rely on those data structures to parse correctly. I'm using a hacked up version of the below test driver to do maps. The call to |
My C++ test program is a bit less sophisticated but I'm indeed not loading the LDB or LMT which means the version field is not initialized... my fault. Won't have access to my PC before the evening, then I rerun it. I wonder if it will fix the 2k games, too (and then I wonder why). I confirm that there are no new regressions which means I will remove all the non-fixable games from my test data. |
hm I messed something up, now I get for LMU
but for LDB
investigating... |
Found another flaw in my test code but fixing this requires going through all ZIPs again, but I had rates of 95% now, giving the real values when I finished fixing this. |
Otherwise this is written into all files manipulated with our tools. This change restores the bit perfect read/write achieved in EasyRPG#242
This series of changes supports bitperfect reading and writing of RPG_RT.ldb binary databases. It supports 2k and 2k3 mode.
Closes #234 and closes #229.
This one depends on all my other PR's.
I've tested it with the following:
Please if anyone has time. Checkout this branch, download some rm2k/rm2k3 games and test it against their databases. Let me know if any game doesn't come through perfectly.