-
Content Count
5 -
Joined
-
Last Visited
Community Reputation
0 Clean SlateAbout elFarto
-
Rank
Freshman
-
RegionTerrain Pack file
elFarto replied to Teirusu's topic in SimCity (2013) Modding - Open Discussion
I've already written viewers for the ed and f0 file types in SimCityPak. I hadn't noticed the ec one until now. Regards elFarto -
SimCityPak - Modding Tool
elFarto replied to oppie's topic in SimCity (2013) Modding - Open Discussion
It's still not complete. Saving changes you've made is still a bit messy, but hopefully it should work well enough for now. Regards elFarto- 627 Replies
-
- simcity 2013
- sc2013
-
(and 1 more)
Tagged with:
-
Binary Rules File Format
elFarto replied to elFarto's topic in SimCity (2013) Modding - Open Discussion
Updated first post with a bit more information. -
Hi Updated with new information about second header. I'm not sure if anyone else is trying or able to reverse engineer the binary rules file format, but I thought that I would create this thread to collect any information available. So, this is what I have so far: The file structure seems to be big endian (although some of the rules appear to have little endian ints in them). The initial header looks like this (in pseudo-C structs): struct header { int unknown1; //always 0x4 int unknown2; //always 0x2 int unknown3; //always 0xd char unknown4; //always 0x0 int ruleCount; struct rule rules[ruleCount]; } unknown 1, 2 and 3 might be version numbers, they seem to be the same in all the files. unknown 4 might actually be in a different place, but it's impossible to say. struct rule { int ruleName; char unknown1[32]; int startOffset; //? char unknown2[12]; int endOffset; //? char unknown3[92]; int extraCount; //not sure if this is an int, only ever 1 byte used char unknown4[8]; struct rule_extra unknown4[extraCount]; } ruleName is the FNV hash of the rule name (from the er2 files). startOffset and endOffset give the position in the final block of the actual compiled script, or they're -1 for some reason. many of the unknown values are 0 or 0xff struct rule_extra { char unknown[12]; } no idea what this is yet. After the rules it gets a little bit muddier: struct header2 { int unknown1tag; //always 4 int unknown1count; char unknown1[unknown1count * 0x5c]; int unknown2tag; //always 7 int unknown2count; char unknown2[unknown2count * 0x70]; int unknown3tag; //always 1 int unknown3count; char unknown3[???]; int unknown4tag; //always 0 int unknown4count; char unknown4[???]; int unknown5tag; //always 1 int unknown5unknown1; int unknown5unknown2; char unknown5[unknown5unknown2]; } This header is a variable length. I haven't found what causes it to vary. Because of this I haven't been able to figure out exactly where the compiled rules start. Finally found what was controlling those blocks. Each extra block is 112 bytes long. Shockingly, I was wrong about this. I've updated it with more unknowns, should be more accurate. Some of the packages have the plain text er2 files as-well as the binary version, which is a life saver as it gives us something to work from. Here's a snippet from the German DLC: unitRule MSDDEBrandenbergGate_CheckUnique global GlobalMission_MSDDEBrandenbergGate is 0 //0xaa3f71db end unitRule MSDDEBrandenbergGate_Start global GlobalMission_MSDDEBrandenbergGate out 1 successEvent uiEvent MSDDEBrandenbergGateStarted //0x9e184b4e successEvent telemetry SC_RULE_MISSION_STARTED -resource global GlobalMission_MSDDEBrandenbergGate end unitRule MSDDEBrandenbergGate_Destroy successEvent uiEvent MSDDEBrandenbergGateEnded //0xa0544e55 successEvent telemetry SC_RULE_MISSION_ENDED -resource global GlobalMission_MSDDEBrandenbergGate end I added the numbers at the end of the lines, these are just the FNV hash of the strings. Here is the binary form of it (there's a little extra beginning and end that are part of other rules): 00000B90 0000 0000 0100 0000 0000 0004 10DB 713F .............Ûq? 00000BA0 AA00 0000 00FF FFFF FF53 435F 5255 4C45 ª....ÿÿÿÿSC_RULE 00000BB0 5F4D 4953 5349 4F4E 5F53 5441 5254 4544 _MISSION_STARTED 00000BC0 00DB 713F AA00 0000 0001 0000 0084 0000 .Ûq?ª........... 00000BD0 004E 4B18 9EFF FFFF FF06 0001 00DB 713F .NK..ÿÿÿÿ....Ûq? 00000BE0 AA0C 0000 0053 435F 5255 4C45 5F4D 4953 ª....SC_RULE_MIS 00000BF0 5349 4F4E 5F45 4E44 4544 0000 0084 0000 SION_ENDED...... 00000C00 0055 4E54 A0FF FFFF FF06 0001 00DB 713F .UNT.ÿÿÿÿ....Ûq? 00000C10 AA48 0000 005F 5E8A 5B01 0000 0001 0000 ªH..._^.[....... I've marked the various hash values to make it slightly easier to read. Regards elFarto
-
SimCityPak - Modding Tool
elFarto replied to oppie's topic in SimCity (2013) Modding - Open Discussion
I think I've found the rules, in SimCity-Scripts_<numbers>.package. Look at the only unknown type file in that package. Looks like it could be a compressed/compiled form of the rules. Regards elFarto- 627 Replies
-
- simcity 2013
- sc2013
-
(and 1 more)
Tagged with:
