Page 1 of 1

Oddball entries in the BCA files

Posted: Sun Oct 05, 2008 1:12 am
by coruscate
Hopefully this can be FAQed later.

So... I'm going to update this later and make a list out of it, but many values in the BCA files I just don't get how to enter.

For instance start date and end date, the ones that appear for the building proper and even for the individual shipment categories since they seem to be on the same "scheme". They are a two cell entry for each (start, stop) but the entries don't add up to normal numbers. What convention is used for dates then? For instance I want an 1800 beginning time on my vineyard and a later date (I'll have to check local history) for the start date on the lavendar farm.

Re: Oddball entries in the BCA files

Posted: Sun Oct 05, 2008 1:53 am
by coruscate
Here's my list...

...and by the way, I get what most mean, I just don't know what convention to enter for the number.

Start cell - stop cell
34-37 - Base price
38-39 - Start year

51-54 the production entries, I assume that's just coding it into a normal number because every entry I've seen has a 01 02 or 03 in just the first cell. The rest seem unused.

59-62 - Straight forward for simple stuff, but the farms seem to employ a special number system here.

63-66 - Just a note, I discovered {Demand Only} seems to be required when it does not produce.

87-88 - start date
89-90 - Stop date

251-254 Upgrade price

Everything from 325-344 what is that?

370-371 Is port or is warehouse, respectively, single cell. I would assume we can't mess with these until stepping up to Gwiss level at least...

Re: Oddball entries in the BCA files

Posted: Sun Oct 05, 2008 7:20 am
by nedfumpkin
Float refers to floating point and you can do your conversions here:

http://babbage.cs.qc.edu/IEEE-754/Decimal.html
http://babbage.cs.qc.edu/IEEE-754/32bit.html

The way it works is you have to reverse the numbers... so if you see 00 00 00 3F you then put 3F000000 and you will get 0.5


A 2 short for years is calculated using the scientific calendar... again, reverse the numbers so that 08 07 is 708 hex, or 1830 decimal.

Re: Oddball entries in the BCA files

Posted: Sun Oct 05, 2008 10:11 pm
by coruscate
nedfumpkin wrote:Float refers to floating point and you can do your conversions here:

http://babbage.cs.qc.edu/IEEE-754/Decimal.html
http://babbage.cs.qc.edu/IEEE-754/32bit.html
Although I can learn I'm not a programmer by profession so I might (and do in this case) need a little extra explanation...
nedfumpkin wrote:The way it works is you have to reverse the numbers... so if you see 00 00 00 3F you then put 3F000000 and you will get 0.5
That I get.I can get this far as getting a four pairs hex digit.

http://babbage.cs.qc.edu/IEEE-754/Decimal.html

But this...
nedfumpkin wrote:A 2 short for years is calculated using the scientific calendar... again, reverse the numbers so that 08 07 is 708 hex, or 1830 decimal.
I don't get. Sure I get the reversal, but on your link, which page which field? I can barely use those links. I can use one to re-translate the four pairs of hex digits back.

But coming up with a two cell hex code? Clueless.

Re: Oddball entries in the BCA files

Posted: Mon Oct 06, 2008 12:22 am
by coruscate
Summary of something I figured out:
42-45 are the cargo transformations a year limit. This does not effect straight output, but any input->output.

For instance when you take in logs and make lumber. This number is the maximum number of transformation loads, no matter how many of whatever it takes to make however many of however many load.

In the "B" or "blue space" below all that is where you set up howmany loads you get and what not. 59-62 in this case, would be how many loads are generated by the amount of input. (how many lumber are made by logs)

127-130 lists how many of the base material are needed.

So if I have...

2 maximum transformations a year
And a formula that makes one half a lumber for a log, the building will consume four logs a year. and produce 2 additional lumber.

Re: Oddball entries in the BCA files

Posted: Mon Oct 06, 2008 1:14 pm
by coruscate
Here's something I don't get, Starting price.

Vineyard (defaulted rubber price): 400D0300 - 2.8025969e-40
Casino (dept. store): F0490200 - 2.1019477e-40

http://babbage.cs.qc.edu/IEEE-754/32bit.html

And I did reverse the order of the pairs (ie. 00030D40)

Re: Oddball entries in the BCA files

Posted: Wed Oct 08, 2008 1:57 pm
by bombardiere
coruscate wrote:
nedfumpkin wrote:A 2 short for years is calculated using the scientific calendar... again, reverse the numbers so that 08 07 is 708 hex, or 1830 decimal.
I don't get. Sure I get the reversal, but on your link, which page which field? I can barely use those links. I can use one to re-translate the four pairs of hex digits back.

But coming up with a two cell hex code? Clueless.
For this you need a calculator. For example one provided with MS Windows is good enough. You enter the year as decimals (dec) and press hex. And you got the hex numbers. 1800 = 708. Just add zero front of 7 and reverse the pair. 08 07

WHy Poptop chosed to hex with dates, but "floats" with other values, I do not know.

Sadly I do not understand your last question.

Re: Oddball entries in the BCA files

Posted: Wed Oct 08, 2008 2:18 pm
by coruscate
Oh it wasn't a question but part of my explanation, Ned's helped me figure it out and I have it working now, after hours of @_@

Re: Oddball entries in the BCA files

Posted: Sun Mar 21, 2010 12:35 pm
by BobTheBull
OK, I don't get. I figured out on my own about reversing the order of the bytes for years, base price, etc. But 3f000000h is 1,056,964,608d on my calculator. Where do you get .5?

Re: Oddball entries in the BCA files

Posted: Sun Mar 21, 2010 12:56 pm
by nedfumpkin
It's because 3f is 0.5 in floating point. These are four digit fields for cargo in the bca...

0.5 = 00 00 00 3F
1.0 = 00 00 80 3F
2.0 = 00 00 00 40
3.0 = 00 00 40 40
4.0 = 00 00 80 40
5.0 = 00 00 A0 40

Re: Oddball entries in the BCA files

Posted: Sun Mar 21, 2010 1:24 pm
by Itsa Timmy
If you are using tiny hexer, the status window and value editor do all the conversions on the fly. Highlighted is the loco top speed.
tinyhexer.JPG

Re: Oddball entries in the BCA files

Posted: Sun Mar 21, 2010 2:14 pm
by Stoker
Thanks Timmy, I use TinyHexer and didn't know about those features that is real handy. I generally use the "caveman method" of finding the # I desire in a .bca (My modding efforts are pretty much limited to buildings) and copying it , although I have used the converters linked to in an above link to get a # I couldn't find in an existing hex file.

P.S. How are your Blender projects going? Have you figured out how to reskin an altered model in .3ds and successfully convert that to .3dp?

Re: Oddball entries in the BCA files

Posted: Sun Mar 21, 2010 5:24 pm
by BobTheBull
Oh yeah, it's floating point but you have to reverse the bytes, duh! It wasn't until I reread the remark about why they used floating point for cargo quantities while using integer for years, base price and such. No it doesn't make sense. But I should have figured it out. My brain must still be out to lunch from the Saint's winning the Super Bowl.

Re: Oddball entries in the BCA files

Posted: Sun Mar 21, 2010 6:11 pm
by BobTheBull
And to that end, we have the following to add:
3f000000h in floating point is indeed .5, or 1 x 10-1 (10 to the -1 power). 3f800000 is 1. But remember RT3 reverses the BYTES, so you have 00 00 00 3f and 00 00 80 3f. If you don't understand this do some research on the Internet and you will find explanations and calculators for floating point. To save some trouble, here are the values, in RT3 form for .5-8 in .5 increments:

.5 - 00 00 00 3F 4.5 - 00 00 90 40
1.0 - 00 00 80 3F 5.0 - 00 00 A0 40
1.5 - 00 00 C0 3F 5.5 - 00 00 B0 40
2.0 - 00 00 00 40 6.0 - 00 00 C0 40
2.5 - 00 00 20 40 6.5 - 00 00 D0 40
3.0 - 00 00 40 40 7.0 - 00 00 E0 40
3.5 - 00 00 60 40 7.5 - 00 00 E0 40
4.0 - 00 00 80 40 8.0 - 00 00 00 41

I stopped at 8 because I have tried 8 and I don't think you want to go any higher. You can get any fractional value you want; just find a floating point calculator on the internet, plug in the decimal value you want and convert it to floating point hex.

I am currently doing some testing and research, and when I am finished, should be in a couple of days, I am going to write up a, hopefully, more clear explanation of the locations and functions of the bca file. For instance, I am tracking changes in profit as well as gross production and consumption, something which a lot of people leave out.

OK. I tried to separate the columns above with spaces but that didn't work; will try it another way. I haven't found anyway to insert a tab here.

Re: Oddball entries in the BCA files

Posted: Tue Mar 23, 2010 12:30 am
by Itsa Timmy
Stoker wrote:P.S. How are your Blender projects going? Have you figured out how to reskin an altered model in .3ds and successfully convert that to .3dp?
Ok, I haven't had much time as of late, I an currently trying to build a simple bethgon coal car and texture it from scratch so I can learn blender a little bit and better understand the .3ds format. While the .3dp format lists a triangle worth of points then the corresponding texture file coordinates, I believe the .3ds format lists all the points, then goes and lists all the coordinates. I just need to figure out how they all match up. The .3ds format seems to be well docmuneted here and here and it uses identifiers. Just remember that things are reversed so 0x4120 = 2041. Unfortunatly I don't fully understand the .3dp format yet despite all my time with it.