• Welcome to SC4 Devotion Forum Archives.
 

News:

The SC4 Devotion Forums are no longer active, but remain online in an archived, read-only "museum" state.  It is not possible for regular members to post or use the private messaging system, and no technical support will be provided for any issues pertaining to the forums in their current state.  Attachments (those that still work) are accessible without login.

The LEX has been replaced with SC4Evermore (SC4E), and SC4E maintains an active Discord server.  For traditional forums, we recommend Simtropolis.

Main Menu

Historical Mod

Started by Lowkee33, June 05, 2010, 12:05:56 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cogeo

#20
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 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:



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.

CasperVg

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!
Follow my SimCity 4 Let's play on YouTube

cogeo

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.

Lowkee33

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.

Lowkee33

@ 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         


RippleJet

#25
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).

cogeo

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.

Lowkee33

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?

RippleJet

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:



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:

  • The lot is watered
  • The lot is powered
  • The lot is built

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.

Lowkee33

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.)   

Lowkee33

#30
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.