Page 1 of 2
Houses.dat Guide
PostPosted: 12 Feb 2009, 22:24
by kamfan
first, sorry for my bad english xD
This List contains all my knowledge, i've tested all that stuff ingame.
In Merchators object editor some of that isnt included.
one thing you should care of is that offset is decimal, use the hex workshop for it.
if you have any type of questions, feel free to ask or pm me.
Houses.dat - - - - - - - - - - - - - - - - - - - - - - -
Offset Buildings
00003508: Sawmill
00005196: Iron smithy
00006884: Weapon smithy
00008572: Coal mine
00010260: Iron mine
00011948: Gold mine
00013636: Fisher house
00015324: Bakery
00017012: Farm
00018700: Woodcutter house
00020388: Armor smithy
00022076: Store house
00023764: Stable
00025452: School
00027140: Quarry
00028828: Gold smithy
00030516: Swine farm
00032204: Watchtower
00033892: Town hall
00035580: Weapon workshop
00037268: Armor workshop
00038956: Barrack
00040644: Mill
00042332: Siege workshop
00044020: Butcher
00045708: Tannery
00049084: Inn
00050772: Winery
Optionen:
+ 10 = // How long they took for wood construction
+ 11 = // How long they took between the construction steps
+ 12 = // How long they took for stone construction
+ 18 = // The way the units enter and exit any building, X axis
+ 19 = // The way the units enter and exit any building, Y axis
+ 120 = // How much wood is needed
+ 121 = // How much stone is needed
+ 226 = // How long shall the unit work
-- 227 ~
+ 228 = // Waiting time between work
-- 229 ~
+ 230 = // Which ware the type unit has stored (Wares IDs)
-- 231 ~
-- 232 ~
-- 233 ~
+ 234 = // Which wares shut be produced (Wares IDs)
-- 235 ~
-- 236 ~
-- 237 ~
+ 238 = // Which amount should be produced
+ 239 = // How much life bar (1x Stone = 50, 1x wood = 50)
-- 240 ~
+ 241 = // The explor radius of the building
-- 242 ~
+ 243 = // Which unit is needed for the building (Unit IDs)
PostPosted: 13 Feb 2009, 13:08
by Nick
interesting!
I hope merchators will update his proggie. I like the "+ 226 = // How long shall the unit work " and "+ 11 = // How long they took between the construction steps "
I could rly use the working time of unit for the fisherman in my MOD
well done
PostPosted: 13 Feb 2009, 14:34
by Merchator
Okay, I am just updating my editor with those 2 values nick want to have added in. But those values somehow are strange. Seems like we are using different Offsets. So just give me some time to figure out the positions, won't last that long.
Maybe new editor will be finished this weekend!
"How long they took between the construction steps"...I need a word for this or 2. My english isn't good enough to figure out a good one. Any suggestions?
PostPosted: 13 Feb 2009, 15:29
by harold
Construction speed?
PostPosted: 14 Feb 2009, 09:21
by Merchator
Okay, finished so far. But somehow this "Costruction speed" value is 0 all the time, when I see it in my editor. I am using different offsets, so I had to use a calculator (yea, I am lazy) to figure out this value. However, it always says "Construction speed: 0". I'll check that in the future.
My 1st byte is the byte which tells you how much stone is needed. So I have to substract 109 bytes to get to the right one. Any mistakes?
(Its 10' am here in germany, and I'm still a little bit tired

)
Edit: 0 seems to be correct, so updated editor can be downloaded here:
Defines Editor V 0.6
Please upload it to another mirror, rapdishare says that you can just download it 10 times!
PostPosted: 14 Feb 2009, 11:20
by Krom
Each house info starts with indexes of wood and stone pics with their palettes. You should know that.
Here's my version of it:
- Code:
HouseDAT:array[1..HOUSE_COUNT] of packed record
 StonePic,WoodPic,WoodPal,StonePal:smallint;
 SupplyIn:array[1..4,1..5]of smallint;
 SupplyOut:array[1..4,1..5]of smallint;
 Anim:array[1..19] of record
  Step:array[1..30]of smallint;
  Count:smallint;
  MoveX,MoveY:integer;
 end;
 WoodPicSteps,StonePicSteps:word;
 a1:smallint;
 EntranceOffsetX,EntranceOffsetY:shortint;
 EntranceOffsetXpx,EntranceOffsetYpx:shortint;
 BuildArea:array[1..10,1..10]of shortint;
 WoodCost,StoneCost:byte;
 BuildSupply:array[1..12] of record MoveX,MoveY:integer; end;
 a5,SizeArea:smallint;
 SizeX,SizeY,sx2,sy2:shortint;
 WorkerWork,WorkerRest:smallint;
 ResInput,ResOutput:array[1..4]of shortint;
 ResProductionX:shortint;
 MaxHealth,Sight:smallint;
 OwnerType:shortint;
 Foot:array[1..36]of shortint;
end;[/quote]
shortint = 1byte signed
byte = 1byte unsigned
smallint = 2bytes signed
word = 2bytes unsigned
integer 4byte signed
a# values are unknown.
Foot values are unknown as well
I hope all other values names are self-explained. If anything - ask me.
PostPosted: 14 Feb 2009, 11:48
by Merchator
Yea, sure, but when we found out the values we didn't know that much. I tought the first information are the needed amount of wood and stone. I could change the offsets, but then I also had to change all the values. Okay, would be possible, but it is not necessary right now
Is this an extract of your KaM remake?
PostPosted: 14 Feb 2009, 12:38
by Krom
Yes, thats direct copy from my source code. I had to process houses.dat file, thus I had to make offset-correct structures.
PostPosted: 16 Feb 2009, 02:22
by Lewin
@Merchator: I think you should allow you editor to edit other values too.
The resource input/output could be interesting, and so could changing unit types, view radius, work/rest time, etc. (some of those you already have though, but I haven't downloaded your tool for a while)
Good work though!
Lewin.
PostPosted: 16 Feb 2009, 13:26
by Merchator
@ Lewin: Yeah, I easily could add some more functions, but all you listed are already content of my tool.
Im just missing "+10, "+12, "+18, "+19" (too lazy to type more

)
PostPosted: 16 Feb 2009, 15:40
by Nick
ok i uploaded it on my premium account. U can post link on other forums... dont care
http://rapidshare.com/files/198808370/DefEditor.exe
PostPosted: 16 Feb 2009, 16:25
by Merchator
Thanks very much for your effort, nick

I'll now change the links!
PostPosted: 16 Feb 2009, 17:53
by Krom
There should be one more value in Houses.dat, but I can't find it - house entrance offset in pixels. Look close on serf entering farm - he goes slightly to the left and when entering quary - to the right.
EDIT: Okay, found it it's right next to EntranceOffset. And it seems to be used same way for X and Y. Base X number is 20. Anything less is to the left (e.g. Stables 20px to left), anything more - to right (e.g. Tannery 8px to right). Y number seems to control how soon unit goes inside.
PostPosted: 11 May 2009, 21:27
by JBSnorro
Well I solved the rest of the puzzle....
Didn't even take over an hour XD
anyways, the value a1 Krom uses is always zero, so that's not unknown

although it's representation is....
the value a5 is the size of the area defined as the tiles beneath or nextto the building. This unfortunately doesn't apply to the barracks, but is does for every other building. So the barracks part may be a random variable, like the random Inhabitant-Work-AnimationLength of the storehouse(which is 184

).
Anyways, the a5 probably isn't of great importance, in contrary to the "footer":
It contains 12 signed bytes and 12 shorts(or smallint in Kroms definition). Each byte corresponds to a short.
The byte represents the index of the sound played when the textureindex contained by the short is displayed.
This beautifully explains why some of the textures in the RX files are identical. At one texture, the sound should be played, whilst not for the other identical texture.
So does this make the houses.dat officially 100 % decoded?
But I don't know everything, I don't know what the BuildSupply contains exactly, nor do I know what the two sizes (SizeX, SizeY, sx2, sy2) contain. Krom, could you please clarify?
PostPosted: 12 May 2009, 07:14
by Lewin
Oh man! And just when I had nearly finished MANUALLY setting the sound effects.

Still, this will be better because I could have made a few mistakes.
Is there a footer like this for units.dat? It would make sense, because units make sound effects too.
@Krom: Could you please implement the loading of this data? (file loading is your area...) I guess we will have to rethink our house sound effect system so it is based off the texture being displayed rather than hard coded values. I wonder if this includes pig/horse noises too?
Lewin.