SC4 Devotion Forum Archives

SimCity 4 General Discussion and Tutorials => New creations requests => Where can I find this ....?¿ => New MODs requests => Topic started by: Lowkee33 on June 05, 2010, 12:05:56 PM

Title: Historical Mod
Post by: Lowkee33 on June 05, 2010, 12:05:56 PM
I like to make all of my buildings historical so that I can control the way my city grows.  I am getting tired of doing this one building at a time.  Is there a way to make buildings grow historical?  If someone could make this that would be awesome, but I am also trying to do it myself.

So far I am looking for where the historical data is stored.  There appears to be no difference in wouanagaines save game explorer between a historical or non-historical building.  I was also thinking that this mod could be an ordinance.  Any help would be appreciated.  Thanks
Title: Re: Historical Mod
Post by: RippleJet on June 05, 2010, 01:51:02 PM
Unfortunately it's impossible to make buildings grow, readily marked historical.

Quote from: Lowkee33 on June 05, 2010, 12:05:56 PM
So far I am looking for where the historical data is stored.  There appears to be no difference in wouanagaines save game explorer between a historical or non-historical building.

There's a very small difference... one single bit to be precise.
This is the beginning of the structure for the lot subfile (Type ID 0x09BD5D4A):


DWORD   Record Size
DWORDCRC
DWORDMemory
WORDMajor Version?  (only seen 0x0008)
DWORDLot IID
BYTEFlag byte 1

Flag byte 1 has the following known bits:

Title: Re: Historical Mod
Post by: Lowkee33 on June 05, 2010, 02:25:25 PM
Ok then.  Can you explain to me how you got the stats you posted?  Is there another thread with people who have explored this?

I have done some testing.  Res and Com save the historical status after being bulldozed, but not after de-zoneing. Industry does not save status after bulldozing.  This would make me think that Historical status is saved in the zone and not the building or the tile.  I would imagine that if zones could be modified like that then we would see all types of zone mods.  hmm.
Title: Re: Historical Mod
Post by: cogeo on June 05, 2010, 02:28:24 PM
If someone could make a dataview, showing historical lots in a different colour (or highlighted), this would be extremely helpful (I too use the historical feature to control city growth).
Title: Re: Historical Mod
Post by: RippleJet on June 05, 2010, 02:37:43 PM
Quote from: Lowkee33 on June 05, 2010, 02:25:25 PM
Ok then.  Can you explain to me how you got the stats you posted?  Is there another thread with people who have explored this?

Long-term ongoing research on the BSC board... :)


Quote from: Lowkee33 on June 05, 2010, 02:25:25 PM
I have done some testing.  Res and Com save the historical status after being bulldozed, but not after de-zoneing. Industry does not save status after bulldozing.

Do you mean that you bulldozed a (res or com) building that was marked historical,
and the next building that grew on that same lot was readily marked historical when it grew?
Title: Re: Historical Mod
Post by: Lowkee33 on June 05, 2010, 02:44:26 PM


@ Cogeo:  That would be helpful.  I have no skill, but am trying things.  I have a pre-existing data view mod, and am using IlivesReader to try to understand how to tweak it.

@ Ripplejet:  That is what I mean.
Title: Re: Historical Mod
Post by: cogeo on June 05, 2010, 02:51:52 PM
Dataviews need a "datasource" to get the data from, and these aren't made with mods or scripts, they are implemented in the .EXE, I'm afraid.
Title: Re: Historical Mod
Post by: RippleJet on June 05, 2010, 02:59:40 PM
Quote from: Lowkee33 on June 05, 2010, 02:44:26 PM
That is what I mean.

Would that same apply if you save the city after bulldozing, exit the game, restart it and return to the same city?
Would a newly growed building in that same lot, at that stage still be marked historical?
Title: Re: Historical Mod
Post by: Lowkee33 on June 05, 2010, 03:22:36 PM
Yes. 

Commercial taxes were set to 20. When demand dropped I bulldozed my store.  Cheetah speed for a year. Pause.  Resident bulldozed.  Save and quit.  Restart. Drop taxes on commercial.  Unpause.  House grew historical and then the store (which grew as a different model) was also.

I have been playing with my data mod, which can show higher demand values.  I can change the source of the info and so far ResDemand$ shows up blank :).  Perhaps I can get into the power view, which displays data as either a 0 or a 1, instead of a demand value   
Title: Re: Historical Mod
Post by: RippleJet on June 05, 2010, 03:29:01 PM
Quote from: Lowkee33 on June 05, 2010, 03:22:36 PM
Restart. Drop taxes on commercial.  Unpause.  House grew historical and then the store (which grew as a different model) was also. 

Quite interesting... :)
My guess is that the bulldozed lot's record was still in the lot subfile (but marked as bulldozed),
and then reused (not recreated) when another lot grew on it... with the "marked historical" bit still set.
Title: Re: Historical Mod
Post by: Lowkee33 on June 05, 2010, 04:47:16 PM
After playing with my DataMod in the Reader I can change the name of the title (R$ desirability is titled Mayor Rating), and can make the R$ desirability view show the ID desirability.  On the data view front I would need help to understand how this mod was made in the first place, as well as how the creator found the 0x... IDs for the different data views.  I feel like if I knew how to find the ID for Historic then I might be able to continue.

For the Historic Mod I would need a lot of help.  If I could understand the IDs that Ripplejet has talked about then I could make steps in that direction.  Perhaps there is a Readme somewhere, or a program I could DL.  I have no knowledge about these things.

Thanks for the help.  I will get back to some gameing.   
Title: Re: Historical Mod
Post by: Andreas on June 05, 2010, 05:11:30 PM
Quote from: Lowkee33 on June 05, 2010, 03:22:36 PM
Commercial taxes were set to 20. When demand dropped I bulldozed my store.  Cheetah speed for a year. Pause.  Resident bulldozed.  Save and quit.  Restart. Drop taxes on commercial.  Unpause.  House grew historical and then the store (which grew as a different model) was also.

I've noticed this behavior as well - if you bulldoze a building that was made historical, the next one that will grow (not necessarily the same one) is already marked as historical. I cannot tell if this is always the case, but I've seen it happen quite a few times.
Title: Re: Historical Mod
Post by: Lowkee33 on June 05, 2010, 05:59:35 PM
@ Ripplejet (or anyone) :
Quote from: RippleJet on June 05, 2010, 01:51:02 PM
0x20 (00100000b) means the lot is marked historical

Does this mean that a lot will have 0x20100000b somewhere in its data if it is historical?  what is the b?
Title: Re: Historical Mod
Post by: Lowkee33 on June 05, 2010, 07:07:39 PM
...So I guess I didnt play the game.  I built a road up a hill and then had an idea that maybe part of a Lots ID would be that it grows historically.  So I used the editor to make a custom lot that I could force on a new map, and then messed around with what was in my knowledge to do so in the ILivesReader.  After a bunch of failures I thought of adding properties to the lot instead of modding the existing ones.  I came across the long list of things that can be done.

Is this list the entirety of what we can moddify in the game?  I have to give extreme credit to everyone who has modded this game.   &apls

One possible solution I have found is to set the rebuild demand to a very large number for every building.  This way no SC4 construction company would tear down a building to put up a new one.  If there is a building we want to replace, then we could bulldoze it. The problem would be that there would be no assurance that a higher stage building will take its place.

I will think about this, and also work with messing around with data views.  Is the BAT editor the way to make new buildings from scratch?  I might have figured some things out tonight.

Thanks everybody.  Thanks Ripplejet, your interest kept me motivated.       
Title: Re: Historical Mod
Post by: RippleJet on June 06, 2010, 09:20:14 PM
Quote from: Lowkee33 on June 05, 2010, 05:59:35 PM
@ Ripplejet (or anyone) :
Does this mean that a lot will have 0x20100000b somewhere in its data if it is historical?  what is the b?

They are different representations... the following three are all the same number:


Binary representation is easier in the case above, when we want to distinguish single bits from each other. ;)
Title: Re: Historical Mod
Post by: CasperVg on June 06, 2010, 09:59:40 PM
Quote from: cogeo on June 05, 2010, 02:51:52 PM
Dataviews need a "datasource" to get the data from, and these aren't made with mods or scripts, they are implemented in the .EXE, I'm afraid.

There's actually one dataview in the exe that was never implemented in the game, the Moisture Dataview. I haven't tried implementing it as a wholly new dataview, but replaced (http://i424.photobucket.com/albums/pp328/CasperVg/propTut0018.jpg) the Health Dataview with it instead.

Either way, good to see the developments here, as I'm also a big-time Make Historical afficionado  ::)
Title: Re: Historical Mod
Post by: thingfishs on June 06, 2010, 10:02:17 PM
interesting. What are the in game advantages of knowing where areas of high/low moisture are?
Title: Re: Historical Mod
Post by: Lowkee33 on June 07, 2010, 08:05:21 AM
I wouldn't think it would be possible to change the words for which data view you want.  That would be on the lines of changing the font of the game.  However, where your view says All Off, that can be changed.  How do you know that is moisture?

I suppose there is no need for moisture in game.  My guess is that it could theoretically effect water pumps ("gets its water from the aquifer"... what aquifer?).  It may be that this is a value that can effect farm desirability.  It would be neat to mess around with that.

As a side note.  Can someone point my in the direction of making mods by scratch?  I can add an exemplar property to the blank .dat that ILIvesReader starts up with, but I basically copied it from another .dat.  Does that mean that it is full of data already.  Where can I get crisp .dat files?
Title: Re: Historical Mod
Post by: CasperVg on June 07, 2010, 08:13:42 AM
QuoteI suppose there is no need for moisture in game.  My guess is that it could theoretically effect water pumps ("gets its water from the aquifer"... what aquifer?).  It may be that this is a value that can effect farm desirability.  It would be neat to mess around with that.

Well, as you've said there's, as far as I know, no effect in terms of functionality when it comes to moisture in-game. However, the moisture level is fairly important for Tree Mods and Terrain Mods, I think.
Title: Re: Historical Mod
Post by: Lowkee33 on June 07, 2010, 09:24:50 AM
If that is true then that is handy information.  I would like to know the code for moisture (Data Source = 0x.......).  For that matter, I would like to know the codes for everything.  Is there a list somewhere, or is all of this figured out through trial and error?

Is there a way that we could make our own data sources?  We are not allowed to alter the .exe files, but can we read them?
   
Sorry if this thread is getting far from historical mods.  I am basically trying to learn where Historical is stored in the game's data, and how other data is used by the game.  Perhaps there is some way to put these things together to at least get a data view.  Today is nice outside, so I will be outdoors and not able to play with the Reader.
Title: Re: Historical Mod
Post by: cogeo on June 07, 2010, 10:05:13 AM
Quote from: CasperVg on June 06, 2010, 09:59:40 PM
There's actually one dataview in the exe that was never implemented in the game, the Moisture Dataview. I haven't tried implementing it as a wholly new dataview, but replaced (http://i424.photobucket.com/albums/pp328/CasperVg/propTut0018.jpg) the Health Dataview with it instead.

Could you tell me which is the Moisture Dataview, or better yet, provide a dl link to your dataview (as is)? I think it's not hard at all to make it a separate one.

It would be even more interesting to tell us where you found the information about this dataview (there may be more ones, who knows?).

Btw, if you are interested, I have a modified Land Value dataview, with more gradual colours (I have also added blue, for the highest values, as well as yellow). Here is a pic:

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fimg20.imageshack.us%2Fimg20%2F9148%2Flvdataview.th.jpg&hash=545565f68f67cf36e008235b7088688db5b1faa8) (http://img20.imageshack.us/i/lvdataview.jpg/)

You can see the effect of elevation (top-left), water (bottom-left) pollution (right), pollution from roads (main arteries coloured green/yellow), as well as lack of education/health/parks (middle, deep-red). I tinkered a lot with this, because the quality of the data delivered by this datasource is really low; too many tiles have the highest possible value (255), while there are very few ones with a value of 254 or 253. So the colour ramp had to be modified radically, with the colour transitions being all but uniform; this was necessary because the data are like that as well, so this was the only way for the intermediate colours to be visible.
Title: Re: Historical Mod
Post by: CasperVg on June 07, 2010, 10:14:52 AM
Quote from: cogeo on June 07, 2010, 10:05:13 AM
Could you tell me which is the Moisture Dataview, or better yet, provide a dl link to your dataview (as is)? I think it's not hard at all to make it a separate one.

Sure, I've attached the modified file to this post. Put it in your plugin folder and check the Health dataview. Your modifications to the Land Value dataview look very interesting as well!
Title: Re: Historical Mod
Post by: cogeo on June 07, 2010, 11:15:28 AM
Thanks!

Well, we have hijacked Lowkee's thread - hope this doesn't trouble him.  /wrrd%& Anyways.

Did take a look in your mod. So you have overridden the health dataview, as you have said. Also I see that simcity_1.dat already contains an (incomplete) Moisture Dataview exemplar (which you have copied unchanged in your mod - or not?). This is not shown in the game, because it is not included in the UI (which btw is copied unchanged in your mod as well or not?).

I think the mod should be done as follows:
- Override the (original) Moisture DataView, not the Health one. Just add the missing fields. Optimising the properties values, like the colour ramp, so that it looks better is a different thing, and can be the last step.
- Modify the UI file. Add the Moisture Dataview, as well as all needed (?) labels (LTEXTs) - these may be already in place (a search in simcitylocal.dat can tell this).

RalphaelNinja had released long ago two "DataView Mods" (SC4 and RH), so you may want to make your mod as a patch (or replacement) of that mod (I mean the RH one, of course) instead of the original SC4/RH dataviews (the ones in simcity_1.dat).

If you like my mod, I have attached it at the end of this post. To install it, copy the datfile under your plugins folder. If you have installed Ninja's mod, make sure that is loaded last (after Ninja's), so install it in the same folder as Ninja's. If not, it would be OK to install it in any location (under your Plugins folder). The mod is quite simple, it overrides the Land Value Dataview exemplar only, so it should work whether Ninja's mod is installed or not.
Title: Re: Historical Mod
Post by: Lowkee33 on June 07, 2010, 01:00:57 PM
On the contrary, this is all useful to me.  I have no clue what I am doing, and learning that the SC4 data files can be read is interesting.  I found the stage limit information in the SC4 data, and then looked at the CAM, and through that am learning the way that mods are made.

In all of the SC4 data, there must be something that relates to Historical Buildings.  I suppose it would appear at least twice.  Once as a determinate of new construction, and second as in the query.  Finding the source of "historical" would certainly get me closer to a conclusion.

As far as moisture level, it seems like it has to do with slope and elevation.  I will look at the meadowshire tree controller, as that seems to leave some places bear that appear to be the same as other places that it has covered.  Understanding how a mod would use data would also relate to creating a historical mod.
Title: Re: Historical Mod
Post by: Lowkee33 on June 07, 2010, 09:43:36 PM
@ Cogeo:  I like those colors  Perhaps the most realistic thing to come out of this examination is a sweet data view mod.  Your file will certainly help me with understanding the color limits.

A late night has me here.  An "everything grows historic" mod will have to be on the back burner, as my searching has not lead to any occurrence of the word HISTORIC (my quote button just broke).  RippleJet has also pointed out some numbers to look for, but a string such as 0x0010000B has yet to show up.  I wonder what program was used to find that information.

A HISTORIC DATA VIEW would be possible with the data source.  There are two ways to achieve it: find it in SC4 .dat or make it.  Either way, I am going to have to understand what information makes a data source.  Tonight I made a list of all of the data sources found in the Graph/Data View/Trends list, and will continue to look for patterns to learn how SC4 organizes data.  A couple things interest me at this point (but alas, sleep): There are certain gaps where a group of four views use, say, 5-6-7-9. Where is the 8? what is it, can we use it?  The other thing is a data view called Demolition ....... Which I forget the name of.  This very much interests me, because that statistic is the formula the game uses to determine if it is going to demolish and rebuild a lot.  It uses UNKNOWNS instead of, say, Data Source.

BTW, not yelling here, my quotes button broke (it is known to happen)

Thanks All         

Title: Re: Historical Mod
Post by: RippleJet on June 08, 2010, 12:39:11 PM
Quote from: Lowkee33 on June 07, 2010, 09:43:36 PM
RippleJet has also pointed out some numbers to look for, but a string such as 0x0010000B has yet to show up.  I wonder what program was used to find that information.

Any hex debugger...
The obvious candidates would be iLive's Reader or Wouanagaine's SC4SavegameExplorer.
It's not a string you should be looking for, it's a byte (8 bits of data).
Title: Re: Historical Mod
Post by: cogeo on June 08, 2010, 01:34:17 PM
Yeah, 00100000b is a binary mask, not a string, while the 0x... prefix means hexadecimal... I'm afraid you have confused these quite a bit. And this is a mask, not the actual data; the data is the flag byte (at the beginning of the lot structure) RippleJet mentioned. This byte must be AND'ed (binary operator) with the mask, to determine if the historical bit is set. And of course you may not "search" for it, it's in a given position in the strucure.

Furthermore, even if you find these in the city file, this doesn't make them available through a datasource (to display them in a dataview). Did take a look at the game's datasources/dataviews, and found that they are "small" numbers. One could write them down, see if there are any "holes" (in the sequence) and test if these correspond to any possible "hidden" datasources - determining what they actually are, is a different thing. So this is an "exhaustive" approach, with uncertain results, but it may be worth finally.
Title: Re: Historical Mod
Post by: Lowkee33 on June 09, 2010, 07:59:09 PM
An update:

First, let me explain the way I have understood what has been explained to me.  When I open the Save Game Explorer and open the LOT files I will see this phrase somewhere "Type ID 0x09BD5D4A" or pehaps something like it.  When I "AND" it with 0x00100000b, and correctly read the resulting data, I will find out if it is historical.  I have not done this, so the last sentence is also a question.

Now, I am new to this, so I am basically pocking this problem from different directions and finding out where the most give is.  Searching through the Reader I have found the Cohorts that say what zone something is (R,CS,CO,I) and the UI Queries that they refer to.  My first thought was to try to find a way to make the "historical" button checked by default, so I made a new .dat file with the Cohorts and have them reference UIs that I have made with new instances.  After some google and tinkering I can change the "Make Historical" to say whatever I want.  I then ran out of free time (dinner).

I could potentially change the "toggle" option to "on".  The ID for "Make Historical" references 0x00001007A.  I could potentially explore that byte.  My thinking now is to make the ID reference a statistic that I have made myself.  Not too sure how this would work.  I have to think about what makes something historical.  And, if I can't make the default to be checked, then I would have to make the query say "make for sale".

There are a lot of calculations the game makes when it decides to rebuild, and one of the values it considers is the worth of the building.  This is a number we can change.  If I mod all of the buildings so that they have a huge value, then they would be basically historical.  Checking the "for sale" button would then reduce that value to something that a sim developer would build over.  I have to wonder though, if a Stage 1 is worth more than a Stage 2, then will the Stage 1 grow there when we check that box?
Title: Re: Historical Mod
Post by: RippleJet on June 10, 2010, 01:57:08 PM
Quote from: Lowkee33 on June 09, 2010, 07:59:09 PM
First, let me explain the way I have understood what has been explained to me.  When I open the Save Game Explorer and open the LOT files I will see this phrase somewhere "Type ID 0x09BD5D4A" or pehaps something like it.  When I "AND" it with 0x00100000b, and correctly read the resulting data, I will find out if it is historical.  I have not done this, so the last sentence is also a question.

The answer to your last sentence is "no"... ::)

Below is an image from wouanagaine's SC4SaveGameExplorer:

(https://www.sc4devotion.com/forums/proxy.php?request=http%3A%2F%2Fi232.photobucket.com%2Falbums%2Fee198%2FRippleJet%2FSC4SaveLotSubfileFlagByte1.jpg&hash=00f8deb0b49b6f78e37ed1faf3703fe2c1fcc6f6)

The city we're looking at is the ingame tutorial for making money.
The lot subfile has been opened (in Lot Record View), and the first lot is displayed.

Flag Byte 1 is the one indicated with a red arrow, called unknown02.
Unknown, since this flag byte has partly been decoded after the program was released.

That's the value that needs to be "anded"... 0x58 AND 0x20 = 0x00.
Thus, this lot is not marked historical.

It's probably easier to see which flags are set if we write 0x58 in binary representation: 01011000b

If you compare this with the explanation to the Flag Byte 1 I gave earlier, you'd see that the following bits are set:

You must also know that we cannot change anything in the Savegame (*.SC4) files.
Any changes would require a recalculation of the checksum (CRC), otherwise the edited record is discarded as erroneous.
As long as we do not know how Maxis calculated this 32-bit checksum, we cannot make any changes to the savegames.
Title: Re: Historical Mod
Post by: Lowkee33 on June 23, 2010, 09:16:00 AM
Grrr.
    Editing the save game was a potential also.  The only thought I have now is that part of a building growing makes the game think the slope is large, and no other building would want to grow there.  Clicking the "make for sale" button would set the slope back to what it actually is.  That may not be possible, but it is certainly less obstructive than changing the building value would be.   
    Exploring through maxis and other mods have enlightened me to Lot Creation.  Needless to say I am spending more time making my own civic buildings and house configurations than making them historical .  In fact, I almost want my own question thread.

Thanks for the help everyone.  I am putting this mod as a low priority for my life right now.  The only thing I can think of exploring is changing what the "make historical" button does, so if anyone wants to take that up they may.  ( I queried a BSC park for the first time.  Pretty sweet.)   
Title: Re: Historical Mod
Post by: Lowkee33 on September 10, 2010, 02:15:31 PM
No progress on the historical mod other than to make big lots:)

In the past few weeks I got uploading rights, so here is a little something.  I mixed the CasperVg's moisture data view with Cogeo's colors.

Some changes have been made.  One to the color ramp.  I have not seen any blue yet, but i changed the triggers so that moisture can be seen to change every week.  I also set this to replace Land Value instead of Health.  Of course, this is all for fun and I haven't made it anything beyond functional (no UI changes).

Included in the .dat is the weather tuning exemplar.  I have made the moisture variations more extreme so that the in-game changes are more notable.  Yes, terrain mods certainly use moisture (and temperature), and if you run this file you will see significant change in your landscape as the year goes by.  In fact, some tiles change weekly, but you have to change your zoom to see them.

So many side projects...
-With the correct tuning I am sure that we could have desert and jungle on the same city tile.
-The rain tool increases moisture levels.  I have not seen moisture level make game water though, or game water (water height increase that comes from too much rain tool) go down due to dryness.   
-Flora that grows by itself depending on temp, moisture, and elevation would also be neat.  There is a property that randomly seeds flora, but I don't know if it can work on custom trees (we don't really want random either).  In my testing changing this property to anything but 0 will eventually cause a crash

---During my testing of this an interesting thing happened with vanilla maxis.  Say the game seeds one tree per month.  Eventually a seed gets placed on top of a pre-existing tree and that turns into a clump.  The clump then spreads out like a can of worms that I can only assume eat SimCity4 and make it crash.