• Welcome to SC4 Devotion Forum Archives.

Modifying TreeControllers

Started by pvarcoe, June 08, 2008, 02:30:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pvarcoe

I am trying to decide on a TreeController. I have experimented with several by CycleDogg.
The one I like best is the Missouri Breaks Controller.

There are a couple of trees that are used by that Controller that I would like to remove.
I can modify the file in Reader. It is a question of what is the best way to do it.

Should the specific tree groups be removed or commented out?
Or would I be best to replace those lines with other trees?

I hoping someone with a little experience working in the TreeController files, may have some suggestions.

Thanks

Phil


Chrisadams3997

#1
Well, it may be a little more complicated than that.  What tree gets placed where is controlled by the kSC4FloraPreferencesProperty located within each flora exemplar.  That property has 256 reps.  Basically Maxis separated out the total elevation change possible on a map(controlled in the terrain parameters exemplar) into 16 evenly spaced zones, and for each of those it is separated out into 16 zones which to me seem to be separated out by moisture.  16x16=... 256.  Whichever flora exemplar has the highest value in the rep that represents that elevation/climate group gets placed there.

Now, it seems to me you're thinking of deleting individual flora exemplars?  Correct me if I am wrong.  That will do two things.  If there is another flora exemplar that has a value(albiet lower) for the places that tree would have gone, it will replace it next time you use the god-mode flora brush.  It'll also mean you can't place that type of flora in mayor mode. &mmm  This also doesn't give any real control over what is going there.

Instead, what you'll have to do is identify which flora you want to replace first.  Looking at it's kSC4FloraPreferencesProperty, copy it to notepad, it also helps to break it into 16 rep lines, each line of course being one elevation zone.  From here you'll see most values are probably zero.  That's where it isn't showing up.  The positive values are what we want.

Now, finding the flora you want to put in it's place, copy it's values to another notepad window.  From there you've got to copy and paste the positive values from the flora being replaced into the proper spots in it's replacement, unless the replacement has a higher value there already.  That's why you had to separate it out into lines of 16, so you can match them up and make sure it all goes in the right place.  Once you're done moving all the values over, remove the line breaks(there can't be any spaces) and paste the new 256 rep values into the replacement flora.  There'll be usually 5 models for a given flora type for most of cycledog's flora.  Make sure you update the property for all of them of that type.

Finally, you have to replace the propertie's values in the flora being replaced with a blank set(256 '0's I mean by that) so that it won't show up.  I happen to have a notepad file with that already set up, so I'll attach it.

And of course, if you didn't want to replace that flora type entirely, but only in some cases(at low altitude, etc.), then you might have to eyeball which ones represent the place you're replacing.

The kSC4FloraPreferencesParameter's values follow something like this:
                           Wettest              Driest
Lowest Elevation     1.........................16
                           17........................32
                           33........................48
                           49........................64
                           etc.
Highest Elevation    241......................256

The first rep in each for instance usually represents a small depression of some sort, or the lower part of a windward slope(if I recall right, Maxis has this set to be west facing slopes.)  Places that would collect moisture.  If you look at the texture regions in any of Cycledog's texture mods, they follow these same elevation/climate zones.

On the other hand, if you don't want to use the trees period, even in mayor mode, just replace the model (reskey1) with the model you'd rather have in there, works just fine, and avoids complications with the kSC4FloraPreferencesProperty that would arise by replacing the entire flora exemplar with another one.  For instance, if you were replacing lodgepole pines with, say, oak trees, you'd replace Lodgepole 1's TGI for reskey1 with the TGI for CPOaks1, Lodgepole2 with CPOaks2, etc.  In this case, the game sees it entirely the same as before, it acts just like before, places into the same elevation/climate spots in god mode.  It'll even still have an icon in game.  The only difference is, when it plops down a model, it'll be the one you wanted ;).

Another advantage of this method is that any of those trees you've already placed in a region(the lodgepoles in our example) will automatically switch to using the CPOak models instead.  But you'll never be able to place Lodgepole pines.

Lastly, you can just throw all zero's into the offending flora's kSC4FloraPreferencesProperty(using the file I attached.)  This will preserve the tree in you're mayor mode and remove it from the god mode brush, it just doesn't give you any control over what flora replaces it.

If I can clarify anything better, let me know ;).

Chris

p.s. sorry if I started with the hardest option there, the easier ones came to me as I was typing. ::)

pvarcoe

Chris

That helps immensely!
I will probably use the second method for what I have in mind with the Missouri Breaks Controller.
There are two tree types I want to replace.

But your first method has got me to thinking about creating same "really" custom versions.
The 16 zones sorted by moisture info was very useful too. I have wondered how the tree controller decides to place trees in the patterns it does.
They often coincide with the patterns of snow. The two obviously both depend on moisture, so that is very neat.
I have played with the snowcapped files on occasion and have wanted to modify them for more than just elevation.

Thanks again for the detailed answer.
I will make good use of it.

Phil


Ennedi

Very nice to hear that somebody wants to play with Tree Controllers, and I'm very glad this is you, Phil! I'm thinking about it too from some time, unfortunately I hadn't enough free time yet.
I am very curious what you will prepare, maybe it will be possible to exchange some experiences in future  :)

Great explanation Chris, very precise and helpful! :thumbsup:
I have several questions too. Some of them can be a little off-topic, but they are connected with the main theme and I don't want to waste bandwidth and to clutter information by opening the next thread.

1. The Maxis' division of the total elevation range into 16 elevation zones and 16 moisture levels is very important, it is also used in the .INI file in terrain mods. My question is: Can we define in a more precise way these moisture levels? Particularly, which is the relation between the moisture level and the slope angle? Which are other factors here?
Phil, I want to make some experiments with snow too, so this information can be important for us  :)

2. Every CPT No.7a file (Tree Controller) adds 34 types of forest to the Mayor-mode Flora menu. Which part of the CPT No.7a controlls these forests?

3. I didn't check if there are really 34 types of forests in my Flora menu, but I noticed an interesting thing: using the query tool to trees planted in the God mode (I use Meadowshire Coast Tree Controller) I saw a few forest names which are not present in the Mayor Mode. So I'm curious where are they and how can I unlock them in the Mayor Mode.

4. Here is Chris' message in the RRP thread (17th May 2008)

Chris said:
QuoteI'd like to have multiple models to give some additional randomness of sorts, but the only way to do that is through the clustering mechanism, which is not well suited to this particular project.  I've played with parameters, but the truth is with the method of placement, and more specifically how close the tiles are and the uniformity needed in that closeness, you virtually always go straight to the highest point of the cluster(the last model in the chain.)  At the same time the clustering gets in the way of placement.

I have the same problem with Mayor Mode CP forests. My questions are:
- Can we remove some models from the particular forest family?
- Can we add the new type of forest to the Mayor Mode flora menu?
If we would be able to do these two things, we would have more items in the menu, but we would be able to use particular types of our favourite flora. Sometimes a plant I want to use is the first or second one in the chain and it is extremely difficult to place it without "going to the highest point of the cluster" as Chris said.
Or maybe there is another possible solution?

Adam
New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

wouanagaine

Quote
Can we remove some models from the particular forest family?
I've played with MeadowTree controllers, and I removed all "Oaks" from it, it implies going thru all examplars, see if it is a "oak", then go to the previous one in that cluster ( hopefully just before this one in the .dat ), change its next to the next after the 'oak' etc .. repeat and rince ..
Another way would be to swap the S3DModel of tree you'd like to remove to a blank one, surely more easy, but you'll end up having "invisible trees" that'll prevent you to plop stuff in mayor mode

One question, which I had not the time to test but my alleviate some problem,  what happen if in the last flora examplar in a cluster, we put the Flora:cluster property to the beginning of the chain. Hopefully this will produce a ring that we can use to loop if we clic past the model we'd like



New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren ♦ emilin ♦ Ennedi ♦ Heblem ♦ jplumbley
M4346 ♦ moganite ♦ Papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine
Divide wouanagaine by zero and you will in fact get one...one bad-ass that is - Alek King of SC4

Ennedi

#5
Quote from: wouanagaine on June 09, 2008, 03:58:17 PM
I've played with MeadowTree controllers, and I removed all "Oaks" from it, it implies going thru all examplars, see if it is a "oak", then go to the previous one in that cluster ( hopefully just before this one in the .dat ), change its next to the next after the 'oak' etc .. repeat and rince ..
Another way would be to swap the S3DModel of tree you'd like to remove to a blank one, surely more easy, but you'll end up having "invisible trees" that'll prevent you to plop stuff in mayor mode

One question, which I had not the time to test but my alleviate some problem,  what happen if in the last flora examplar in a cluster, we put the Flora:cluster property to the beginning of the chain. Hopefully this will produce a ring that we can use to loop if we clic past the model we'd like

Thank you for an advice Stephane! No I don't want to have invisible trees  :D I would rather like to spend some time with flora exemplars.
As for your question: hmm... here is a definition of the "Flora:Cluster type" property:
"Flora type that results when combining this type and one of equal or lesser value"
Although I like your idea very much, I'm afraid we can't do it - we can't create a loop using "equal or lesser" relation.

Edit: The last property in the flora exemplar looks interesting. It is called "Special case only". Description: "If set, occupant is never choosen based on user action or normal simulation". It's a boolean type value (true or false). I see that some flora has this property set to 1 and some has 0. Maybe this one can be used to modify families?
New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

Chrisadams3997

#6
To start off with, I've been considering the possibility of making continuously looping clusters like Wou suggested for a while, but like him hadn't tested it.  So I finally did.  The short answer is it doesn't work.  First off, in my test, while the cluster never maxed out(which can actually be quite obnoxious the way most flora are set up), only the last model in the chain would show up.  Further more, and the real reason I doubted it would work, is that like any other time the last exemplar in a cluster chain has the "Cluster type" property, as soon as another flora type is placed in it's vicinity, the entire computer freezes such that it has to be rebooted.  So no go there.

Now, Ennedi's post:

1.)  There is a weather exemplar in SimCity1.dat, though I've never changed anything on it.  It could even be that it's not functional(like the waves properties you'd investigated before,) but there's no way to know until someone tests it out.  At any rate, here's a pic showing the properties:



As you can see, it's got a valley moisture boost, hill moisture factor, etc., so it may be useful.

2.)  What kind of control?  They are grouped into cluster groups by the three cluster params, where the first exemplar in any line contains the info whether that cluster group appears in god/mayor mode or both, whether it can be placed in water, it's icon, and menu order(Jeroni's tutorial covers most of these).  The kSC4FloraParametersProperty controls Mayor mode placement parameters, most notably the area it occupies(rep 15=radius), much like the occupant size of a prop and can be individual to each exemplar in the cluster group.  I've already discussed the PreferencesProperty in my previous post.  I can answer more specific questions on a lot of this.

3.)  You'll have to find the clusters in the tree controller that aren't in mayor mode(in reader) and make sure the first exemplar in the chain has all of the following properties:

Plop cost, Item Icon, Item Order, Item Button ID

The Item Icon and Button ID should both be set to the IID of the exemplar in question.  And of course, you'll have to add a .png for the icon and edit it's IID to that of the exemplar.  They should already have Ltexts for the name and description(check for the properties in the exemplar), but if they don't, the Ltexts and appropriate name and description key properties will need to be added.  When that's all in place, you'll be able to place them in mayor mode.

4.)  The key property here is the Flora:Cluster Max Radius.  This is the radius around an already placed model in a cluster chain that if you click again, it moves to the next exemplar(and thus it's associated model) in that chain, assuming there is room for it(based on that rep 15 I mentioned before.)  Therefore the easiest, and sometimes best, way to reduce the number of maxed out clusters is to reduce this number.  Look at any of my flora and you'll see a lot lower values here than for most.

An extreme case here on the other side of the spectrum is Jeroni's Caya Tormentosa and Acer Plantiods.  If you've used these, you've noticed that it's hard to produce thick stands of them as it's always replacing other models.  I think this was by design(I've never asked), but it's not much good if you want a thick stand, at least easily.  Look at it's Cluster Max Radius, it's 25.  That's compared to CP values ranging usually between about 6 and 10(depending on the size of models, etc.)  That means that a click within about 1 and 2/3 of a tile from an existing (non-maxed) cluster will upgrade it.  That's why it seems to jump around as well.

If you want a model to be more difficult to upgrade, just reduce this value.  If you want it to take less or more space, rep 15 of the Params(mentioned above) is the ticket.  Using the two together you can really dial in what you want a flora to do, as these don't have to be the same for all exemplars in a cluster.  I mentioned above that a model only upgrades if there is room for the new one(between the other flora and props/networks/buildings around it.)  Therefore, by increasing the size (rep 15) of the last model, etc, we can limit where it places.  This is used often in CP tree clusters, but only works well where there is already a lot of other item, not in the open, and results in 'areas of control' around that cluster where you can't place anything else(e.i. cottonwoods.)  This is advantageous if you want to design the flora to leave spaces, and a bad approach if you want thick forests.  In that case, the Max Cluster is the better way to go.

5.) (for you're new post) I'm not certain what the H*** Maxis had in mind for the special case only.  For instance, for the Maxis Pine and Oak tree clusters, they actually have this value set to false for the first in the cluster and true for the rest of them in each.  I've yet to find what it does.  By the way, where are you finding the definitions for the properties?

Chris

Ennedi

I suppose it can be an interesting discussion and we can achieve some valuable results  :)

Now my answer for Chris (numbers as in Chris' post)

1. The Weather exemplar is active! I copied it from simcity1, made a dat and changed one property: mfMoistureValleySlopeThreshold. My line of thought was as follows:
- This property controls which minimum concavity is required to detect area as valley (linear height deviation in meters). The Maxis value is 2,5.
- Increasing this value should remove textures appearing in wet areas from some nearly flat surfaces and leave them on more steep slopes.
So I made a picture of the pasture area (you saw it yet when we discussed how should look realistic pasture  ;D). Then I changed the "mfMoisture..." value from 2,5 to 10 and put the modified dat into my Plugins folder the last one in my picture):



And here is the result: Before


And after


This exemplar needs further researching, I suppose using it with the terrain mod can give some interesting effects, maybe we will create a new mod?  ;D

2.
QuoteWhat kind of control?  They are grouped into cluster groups by the three cluster params, where the first exemplar in any line contains the info whether that cluster group appears in god/mayor mode or both, whether it can be placed in water, it's icon, and menu order(Jeroni's tutorial covers most of these).

It is not clear for me. I looked at your Cattails.dat file. It contains three exemplars (as I understand, one exemplar for each Cattails model). The first exemplar contains three cluster properties, the second one contains them too, but the third one doesn't contain these properties. The "Cluster Type" property has different values in different exemplars (the difference = 1). So I don't see the grouping principle.
An additional question: Which property says if the cluster appears in God/Mayor Mode?

QuoteThe kSC4FloraParametersProperty controls Mayor mode placement parameters, most notably the area it occupies(rep 15=radius), much like the occupant size of a prop and can be individual to each exemplar in the cluster group.

Everything clear except one thing: kSC4FloraParametersProperty has only 14 reps  ()what()



Btw you asked where am I finding property definitions? You can see it on the picture. If you will highlight the property in the right window, the description will appear at the bottom of the window. I must say these descriptions are often unprecise (or mysterious  ;D), there are also many properties without a description. So I have an additional question:
- Did anybody check and update property descriptions in Ilive Reader?

3. CP Tree Controllers have all exemplars for all trees available in this particular controller in one .dat file. I can identify chains by their names (Cottonwood 1, 2... etc.). I can also see the first one ie. the exemplar containing Plop Cost, Item Icon etc. But what about the last one which does not contain cluster properties?  :)
I understand that it is possible that some clusters can be present in the tree controller but they are not provided to use in the Mayor Mode? So my question is: is it possible to use the same cluster both in God and Mayor Mode? I suppose it would need to create different exemplars for both cases, connected with the same tree models but having different exemplar IDs - am I right?

4. Thank you! I supposed it can be helpful. In fact I used similar method last time using your ploppable flowers to limit the space  :D
One time I noticed a trouble with filling spaces between trees by your flora (it's natural). So I started from plopping some flowers and then I tried to plop an Arctic Forest on them. I saw that only smallest (usually first and second) models appear and I understood what happened - there was no space for bigger trees from this cluster. It was very nice for me  ;D

5. As I see you used this property (Special case only  ;D) so it would be good to know how it works.
As for your question about property definitions, I answered yet.

6. The new question: Some your plants have the property "Water Flora" = True. Here is a definition of this property:
"If this property is present, then the given flora is a water flora and it's elevation preference table entries are interpreted as depth below the sea level instead of altitude above sea level".
- As I understand, the elevation preference table is used by the game when we are plopping flora in God Mode. Has it any meaning in Mayor Mode? The same for the "Water Flora" property - what is it's meaning in the Mayor Mode?
- Using both your new plants and - for example - Gizmo's Water Flora we are able to use it on land without any problems. So it looks mysterious for me  ;D

7. I'm afraid you will lose your patience soon  ;) but I would be very happy If I would know the meaning of all values in the kSC4FloraParameters Property  ;)

Adam


New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

Chrisadams3997

Alright, here goes.

1.)  That's very cool that it works, I'd always wondered, but never had a reason to mess with it myself.  That said, given particular thought about what you'd want to achieve by changing it(which it seems you might have some thoughts on), it could be very useful.

2.)
QuoteEverything clear except one thing: kSC4FloraParametersProperty has only 14 reps 
Ooops!  I didn't have it in front of me and was assuming it had 16 reps, and it's the second to last.  Thus I called it rep 15(I'll update my previous post so as to not confuse others stumbling in here.)  The correct rep would be 13.

QuoteThe first exemplar contains three cluster properties, the second one contains them too, but the third one doesn't contain these properties. The "Cluster Type" property has different values in different exemplars (the difference = 1).
The way it works is that the "Cluster Type" points to the next IID in the cluster(hence the difference of one each time.)  Theoretically you could jump more than one IID, but I've never tried it, and there's little reason to that I've run into.  The last exemplar(more on why I say this rather than model later) in a cluster chain("top" of the cluster) NEVER should have any of the three cluster properties.  IF it does, any other flora intersecting it in game freezes the computer as mentioned at the top of my last post.

QuoteAn additional question: Which property says if the cluster appears in God/Mayor Mode?
There's not one ;).  To appear in god mode, two things have to exist:

a. "Flora: wild" property must be present and set to 'true'(I presume this, never tested)
b. It has to have dominant values at some point in it's "kSC4FloraPreferencesProperty", relative to all other wild flora types in you're plugins folder, as discussed in my first post

To appear in mayor mode, it needs the properties I set out in my last post.

3.)
Quoteis it possible to use the same cluster both in God and Mayor Mode?

Most of them already are ;).  Big exceptions in CP files are the 'edge' exemplars(CPOak edge, etc., etc.) that he's used to control the pattern of trees placed in god mode to the best of my understanding.  It usually contains smaller more disperse models(I believe, working on a few untested presumptions here) that would appear(again presumably) at the edge of the brush.  These aren't much use to us in Mayor mode as they don't add anything.  There are also the 'combination' exemplars(SubfirLodgepole, etc., etc.) which I presume is merely a god mode type that combines models from the two different tree types so that you'll get a combination in a specific elevation/climate zone.  Again, no NEW models, but rather a brush that combines two tree types models.  That said, any of these can be added to Mayor mode by adding the properties I mentioned before(and I'll test it to make sure about this, but it's been my experience at any rate.)  The only outside thing needed is a png file for the icon, and a description Ltext file.

4 has been well covered I think so....

5.)  I actually just remembered something I ran into in LE the other day.  In there you can of course add things from the 'Flora' tab, and I noticed that only part of the flora I created were in there.  I suspect a quick check will reveille that it's only those with "Special Case" set to false...

6.)  I can answer the mayor mode question here easily.  If this is absent or set to false, it can't be placed in water.  If it's true, then it can.  You're post brings up questions about use in God mode however.  According to your definition, we should presume(until testing) that it will impact where the 'elevation' zones fall for 'water flora,' and thus would create problems.  At present, no 'water flora' have ever been set up for use in God mode, at least not in any released tree controllers, so it's been little issue.  I see the bigger issue being that you wouldn't want flora plopping underwater in god mode, as it's usually better that such things be done in a more controlled manner.  Thus it would be best used only for flora intended just for mayor mode.

7.)  Hey, I wish I knew too.  Rep 13 seems to be the only one with significant impacts at the mayor mode level.  I presume that at least most of the remaining ones have to do with the patterns of placement(density, hardness, etc) and (maybe)rotation of the God Mode brush, much like setting up a brush in Photo Shop.  I've never had the occasion or time however to explore them in detail, and I presume c.p. is the only one of us with any halfway sure knowledge of this area.  If you're curious about these,  a close look at his tree controllers and it's correlation to such things is where I'd start.  Other possible things I also expect could be controlled here include height, max slope(which would be useful if it exists), possibly even rotation patterns/constraining the axis of individual models(though I doubt this).

Chris

Ennedi

OK Chris! There is a lot of interesting information and your explanations are very clear and precise  :thumbsup:. Now I'm going ot organize it and play a bit with all these parameters. It will take some time, at least a few days I suppose  ;D
I also think it will be good to don't disturb you now, the RRP project needs a lot of time and you are close to finish at least a few important parts of it.

Thank you very much!
Adam
New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine

pvarcoe

Adam

Your experimenting with mfMoistureValleySlopeThreshold is very interesting.
One aspect of the terrain mods that I find somewhat deficient is the snowcapped mods.
I have notice the transition at the edge of snow to cliff can be very unatural.
Often there is a very geometric looking edge to the snow. Yet in other areas the transition looks quite good.
I can't help wonder if some of those parameters like mfMoistureValleySlopeThreshold might affect this?

Phil

Ennedi

Quote from: pvarcoe on June 10, 2008, 10:23:43 AM
(...) I have notice the transition at the edge of snow to cliff can be very unatural.
Often there is a very geometric looking edge to the snow. Yet in other areas the transition looks quite good.
I can't help wonder if some of those parameters like mfMoistureValleySlopeThreshold might affect this?

Phil

I will check it, Phil. This is one of most annoying things for me  :)
But first I would like to make some movement in the terrain mod INI file.
I talked with Cycledogg about snow some time ago. We know there are several snow textures in his newer mods. In my opinion the trouble comes from the basic one (completely white) on steep slopes. Other snow textures work very good, mainly because they are partially transparent and we see soft and uneven edges of them. Brian (Cycledogg) told me that snow textures IIDs are: 0xde, 0xdf and 0x9f (he told there can be more of them, I checked it but didn't find any others). My idea is to change positions of the "basic" snow texture to let it appear on less steep slopes than now. In this case is possible we will have less snow and we will see some rocky textures from CPT No.5 file between snow and cliff, but it is nothing bad in my opinion, and we still will be able to have much snow - everything is a question of good terraforming (precisely adjusted slopes).
I also want to have the "basic" snow texture surrounded by/merged with other snow textures in every place it appears.

Of course I will play with weather conditions too, but it is a completely new theme and there are much more aspects in it (for example wind direction and it's influence on moisture level)

I'm very curious of your experiments!

Adam

New Horizons Productions
Berethor - beskhu3epnm - blade2k5 - dmscopio - dedgren - Emilin - Ennedi
jplumbley - moganite - M4346 - nichter85 - papab2000 - Shadow Assassin - Tarkus - wouanagaine