SC4 Devotion Forum Archives

SimCity 4 General Discussion and Tutorials => SimCity 4 General Discussion => Topic started by: GoaSkin on November 13, 2007, 08:54:05 AM

Title: analyzing unknown exemplar properties
Post by: GoaSkin on November 13, 2007, 08:54:05 AM
Die modding tools know the descriptions and syntax of the most exemplar properties. The description is taken from the ingred.ini file that comes with the sc4 plugin manager, but Maxis uses exemplar properties that are still unknown in some exemplars in simcity1.dat. Beside, there may be many others that are never used.

I can find out a bit of unknown exemplar properties by analizing the binary. There, I can read out the name of the classes and it's functions that ask for a specific exemplar property ID and what data type they have. Then, we may solve what they do. If you give me the IDs of unknown properties, the places where to find them and the parameters, I may analyze.

Beside, some exemplars use parameters with IDs in continuation but with breaks. The unused ones may be usable for something.
Title: Re: analyzing unknown exemplar properties
Post by: jplumbley on November 13, 2007, 09:11:41 AM
Ohhh... I am at work and cannot access ST, but I remember seeing a thread about unknown properties at ST... I cannot for the life of me remember where.  Wouanagaine would know though, and I think Karybdis may have information about the IIDs of unknown properties.  I know modthesims had something on this aswell.  I hope that helps you find something.
Title: Re: analyzing unknown exemplar properties
Post by: jeronij on November 13, 2007, 02:39:45 PM
Do you mean totally unknown properties, or partially known too?. I'd really be interested in understanding some of the floraparameters properties... actually they are not unknown, because they have a name, but how they work is a mistery for most of us... .could you investigate this way as well ?¿
Title: Re: analyzing unknown exemplar properties
Post by: RippleJet on November 13, 2007, 03:23:12 PM
Karybdis listed all unknown exemplar properties here: http://www.sims2wiki.info/wiki.php?title=EXMPUnknowns
There are still 27 of them... ::)
Title: Re: analyzing unknown exemplar properties
Post by: GoaSkin on November 13, 2007, 03:50:53 PM
I may analyze what is still unknown and look if there is anything that is totally unused because I managed it to convert the binary into rudimentary C++ code (the assembler instructions in C-gramatics; function calls replaced by the function names). To find something out I have to search for specific HEX-IDs or to analyze in specific functions what exemplar properties they may read.
Title: Re: analyzing unknown exemplar properties
Post by: jeronij on November 14, 2007, 02:11:07 AM
Ok, not sure if I understand what can be done or not, but just in case....  ::)  ;)

Property Name                       P.ID             P. Type   Reps
kSC4FloraParametersProperty   0x083DC35B   Float32    14

Can we know more about those 14 reps ?¿
Title: Re: analyzing unknown exemplar properties
Post by: wouanagaine on November 14, 2007, 02:18:11 AM
Quote from: GoaSkin on November 13, 2007, 03:50:53 PM
I may analyze what is still unknown and look if there is anything that is totally unused because I managed it to convert the binary into rudimentary C++ code (the assembler instructions in C-gramatics; function calls replaced by the function names). To find something out I have to search for specific HEX-IDs or to analyze in specific functions what exemplar properties they may read.
Sounds very interested GoaSkin !!! May I ask what did you use to make an asm2cpp ?
Title: Re: analyzing unknown exemplar properties
Post by: GoaSkin on November 14, 2007, 04:38:16 AM
Nothing special. Some scripts that call some UNIX- and OSX-specific debugging functions like otool. If you have an encrypted version of the game executable, the output is a mess but not all versions of the OSX executable use binary encryption.
Title: Re: analyzing unknown exemplar properties
Post by: GoaSkin on October 24, 2008, 11:35:25 AM
There are Exemplar properties using in Simcity1.DAT that are never used in the binary...
For example 0xCA480831 (park manager exemplar) isn't recognized on C++ side.

Also there are a few exemplar properties that are never used in any exemplar but are supported by the program

For generic exemplars, it is easy to find out the property keys that are supported but unused. For example:


cSC4ParkManager::ReadTuningParams()


is the function that collects the information from the park manager exemplar. Anytime, the TGI of the exemplar is copied into register ebp - the first thing in the function.


movl            $0x6534284a,0xffffffd4(%ebp)
movl            $0x67cd5fa1,0xffffffd8(%ebp)
movl            $0x8a4805bc,0xffffffdc(%ebp)


In the following, there is a number of read value and do something with it instructions. Mostly, another function is called with the property as parameter. The function name sometime gives a hint for what the parameter is. Now I will show a sniplet that reads the exemplar property content in another register and calls the next functions (with other some game data values moved into other registers before...


movl            $0xca480830,0x04(%esp,1)
movl            %ebx,(%esp,1)
calll           cSCPropertyHelp::GetPropertyValue(cISCPropertyHolder const*, unsigned long, SC4Percentage&)


until here, the function calls a function that reads out the value itself. It is an exemplar handling function. With the result as parameter, the function that should make something with it is called later...


calll           cSC4ResponseCurve::SetResponseCurveData(cISCProperty const*)


And by the way... the unknown property in the parks manager isn't requested by this functions. It isn't unknown. It is useless.
Title: Re: analyzing unknown exemplar properties
Post by: RippleJet on October 24, 2008, 12:59:12 PM
Would you be able to find any information for the property CA9B4CA8 ? ::)

That's the first property appearing on the Wiki list of unknowns and is
a property that appears in the building exemplars for the medical clinic and hospital.
In both cases the property has a rep count of 0 and a UInt32 value of 0x00000001.

Would be interesting to know whether it's useless, unknown or... :)
Title: Re: analyzing unknown exemplar properties
Post by: GoaSkin on October 24, 2008, 05:06:34 PM
Hello,

do you have received my message (and the file) at ST?

The value does not appear in simcity4.exe. I also searched for EA9B4CA8 (because there are other values beginning with EA... so it might be a mistake) but it also does not appear.

The building exemplar properties are handled by various functions. Some of them are requested in many functions. CA9B4CA8 seems to do nothing (no search result for that value).

For the other unknown properties:

a8eaa060 - unused
a8eaa061 - unused
a8eaa062 - unused
a8eaa063 - unused
a8eaa064 - unused
a8eaa065 - unused
a8eaa066 - unused
a8eaa067 - unused

0b579c20 - used in cSC4ModelBackgroundLoader::ReadTunableValues()
0b579c2a - used in cSC4ModelBackgroundLoader::ReadTunableValues()
0b579c2b - used in cSC4ModelBackgroundLoader::ReadTunableValues()

all the values (and many other properties+game data are calculated together with large algorithms. Finally the function calls cSC4ResponseCurve::SetResponseCurveData(cISCProperty const*).

482CB451 - unused
482CB452 - unused
482CB453 - unused
482CB454 - unused

bridge simulator uses properties 482CB450 and 482CB45A-F.

6c0700c4 - used in cSC4AutomataManager::ReadTuningParameters()
EC06e7cf - used in cSC4AutomataManager::ReadTuningParameters()
EC0700C0 - used in cSC4AutomataManager::ReadTuningParameters()

This functions needs a little bit of time to analyze. More than 7000 lines of code.

6a8a09d2 - used in cSC4Demolition::ReadProperties()
6a8a09d3 - used in cSC4Demolition::ReadProperties()
6a8a09d4 - used in cSC4Demolition::ReadProperties()
6a8a09d5 - used in cSC4Demolition::ReadProperties()

Function does not call any other function. Itself is called by cSC4Demolition::Init() cSC4Demolition::DoMessage(cIGZMessage2*).

c973c9a9 - unused



Title: Re: analyzing unknown exemplar properties
Post by: RippleJet on October 24, 2008, 05:47:33 PM
Quote from: GoaSkin on October 24, 2008, 05:06:34 PM
do you have received my message (and the file) at ST?

Just read it, about an hour before you posted your question here. :D
And I've sent you another PM in return over here! :)


Quote from: GoaSkin on October 24, 2008, 05:06:34 PM
The value does not appear in simcity4.exe. I also searched for EA9B4CA8 (because there are other values beginning with EA... so it might be a mistake) but it also does not appear.

The building exemplar properties are handled by various functions. Some of them are requested in many functions. CA9B4CA8 seems to do nothing (no search result for that value).

As expected, but nevertheless valuable information for PIM-X! :thumbsup:
At least now we know we don't need to keep that Unknown property lingering around anymore!


Quote from: GoaSkin on October 24, 2008, 05:06:34 PM
a8eaa060 - unused
a8eaa061 - unused
a8eaa062 - unused
a8eaa063 - unused
a8eaa064 - unused
a8eaa065 - unused
a8eaa066 - unused
a8eaa067 - unused

Good to know!
a8eaa063 obviously holds a year in SimCity_1.dat; 1960.
But since the property 28ebbc35 (Year Available) in the ordinances themselves doesn't work either, it's obvious they left all that uncoded.

Would you be able to find anything about 28ebbc35 and 28ebbc36?
Title: Re: analyzing unknown exemplar properties
Post by: GoaSkin on October 25, 2008, 07:54:23 AM
used in: cSC4OrdinanceSimple::FromData(cGZPersistResourceKey const&), calculations dones with properties up to 28ebbc3c. Function itself seems to be unused (no other functions call it).




Title: Re: analyzing unknown exemplar properties
Post by: RippleJet on October 29, 2008, 01:34:43 PM
Quote from: GoaSkin on October 25, 2008, 07:54:23 AM
Function itself seems to be unused (no other functions call it).

Thanks! :thumbsup: