Prices - BigInt
Posted: Tue Sep 13, 2016 7:35 pm
I ran into something today that may be of note. While importing in prices from EQ1 I started getting overflow errors. I starting looking into why and had some thoughts. I could be wrong though.
Lets say in EQemu 1,000,000 plat would be stored like this ....
plat gold silver copper
1000000 0 0 0
In Eq2Emu I am pretty sure it is stored like this, because you use an extra integer for gold, silver and copper
plat gold silver copper
1000000 00 00 00
So because of the need of the extra zeros, we get quite a large number
1,000,000,000,000
So if we are using an unsigned int I think the max is 4294967295, quite a few digits off. Looking at the items table I noticed the sell price is int(10) unsigned. I changed mine, but I have not tested any C++ goings on yet to see if there will be a problem when a BigInt transfers over to the actual game.
Lets say in EQemu 1,000,000 plat would be stored like this ....
plat gold silver copper
1000000 0 0 0
In Eq2Emu I am pretty sure it is stored like this, because you use an extra integer for gold, silver and copper
plat gold silver copper
1000000 00 00 00
So because of the need of the extra zeros, we get quite a large number
1,000,000,000,000
So if we are using an unsigned int I think the max is 4294967295, quite a few digits off. Looking at the items table I noticed the sell price is int(10) unsigned. I changed mine, but I have not tested any C++ goings on yet to see if there will be a problem when a BigInt transfers over to the actual game.