• Welcome to SC4 Devotion Forum Archives.

Industrial Resource CAP and CAP Relief

Started by RippleJet, July 02, 2010, 02:18:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RippleJet

This is a copy of a post I made at BSC in October 2008:





While writing Demand Simulator: Demand, Supply and CAPs, I started to think about a way to display the IR CAP in the Census Repository Facility's query.

After double-checking first the Prima guide:

Quote from: Prima's Official Strategy Guide, SimCity 4 Rush Hour
Generally, every job offered by developer type counts against it's own demand cap.   Agriculture is different.  Jobs from all other businesses count against the Agriculture Demand Cap.  The effect of this is that as other businesses grow, Agriculture is forced to stagnate.   Connections keep raising the cap, but the influx of non-agricultural businesses should outpace relief.  At some point you have to decide whether you want farms in your city.  If so, you must curtail all other business forms and put nearly all of your resources into farming.  Only then will Agriculture grow to large scale.  When you city begins to thrive, start a neightboring city, connect it, and commit it to Agriculture.   The Residentail population of your main city will feed the demand for Ag jobs and the farms' isolation will let them go unimpeded.   Plus you won't have to worry about their water pollution output affecting your Residents.

...and then the RCI exemplars in SimCity_1.dat,
it is clear that the following count against the I-R CAP:
R§, R§§, R§§§, CO§§, CO§§§, CS§§, CS§§§, ID, IM and IHT.

In other words, all RCI types except CS§ and IR itself.
From the RCI exemplar "Industrial Connection" (TGI 0x6534284A, 0xC7BB4816, 0x00004800),
it's also evident that industrial connections provide ID, IM and IHT CAP relieves, but not for IR.

Thus, as it's always been said that there's no way to provide IR CAP relief,
I thought I could simply compare the sum (R§+R§§+R§§§+CO§§+CO§§§+CS§§+CS§§§+ID+IM+IHT)
to the initial IR CAP of 30,000, and thus get a measure for the IR CAP.

This turned out to work pretty well. Off to test it in a city...
When the IR CAP surpassed 80%:



...IR (I-Ag) Demand phased out (as we all know it does sooner or later):






However, now I started to wonder why the IR CAP is said to be static.
After all, nothing stops us from entering 0x4900 (I-R CAP) in the property Demand Satisfied.

Thus, to test this I modded the Census Repository Vault to provide an IR CAP Relief of 30,000.
Plopped it in the same city, right after the situation shown above, and: :D



IR CAP Relief is fully functional and thus it would make it fully possible to have farms amidst skyscrapers...
Somehow I get the feeling this is what Colyn has always wanted... ::)

In order to get the Census Repository to accurately show the new IR CAP,
it needs to be able to count all buildings providing IR CAP relief though
(since there is no game variable available to report it, as for the other CAPs):



In order to get the CAP down to 40% above, I reserved a number of OG's to provide this information.
I created a LUA function for the Census Repository that calculates the occurances of these OG's:


function RJCR_IRCurrentCAP()
  local result = 30000 -- initial IR CAP
    result = result
    + sc4game.automata.get_source_building_count(hex2dec('b5c00cc0')) * 100
    + sc4game.automata.get_source_building_count(hex2dec('b5c00cc1')) * 200
    + sc4game.automata.get_source_building_count(hex2dec('b5c00cc2')) * 400
    + sc4game.automata.get_source_building_count(hex2dec('b5c00cc3')) * 800
    + sc4game.automata.get_source_building_count(hex2dec('b5c00cc4')) * 1600
    + sc4game.automata.get_source_building_count(hex2dec('b5c00cc5')) * 3200
    + sc4game.automata.get_source_building_count(hex2dec('b5c00cc6')) * 6400
    + sc4game.automata.get_source_building_count(hex2dec('b5c00cc7')) * 12800
    + sc4game.automata.get_source_building_count(hex2dec('b5c00cc8')) * 25600
    + sc4game.automata.get_source_building_count(hex2dec('b5c00cc9')) * 51200
    + sc4game.automata.get_source_building_count(hex2dec('b5c00cca')) * 102400
    + sc4game.automata.get_source_building_count(hex2dec('b5c00ccb')) * 204800
    + sc4game.automata.get_source_building_count(hex2dec('b5c00ccc')) * 409600
    + sc4game.automata.get_source_building_count(hex2dec('b5c00ccd')) * 819200
    + sc4game.automata.get_source_building_count(hex2dec('b5c00cce')) * 1638400
    + sc4game.automata.get_source_building_count(hex2dec('b5c00ccf')) * 3276800
  return result
end


Thus, to provide an arbitrary IR CAP relief would require a number of these OG's.
E.g. the building mentioned above that provides an IR CAP relief of 30,000, needs the following OG's:


B5C00CC2   
400
B5C00CC3
800
B5C00CC5
3,200
B5C00CC8
25,600
---------
TOTAL
30,000

By using all 16 OG's above, we can denote any CAP relief between 100 and 6,553,500, with increments of 100.

This will also allow me to display the exact CAP, not only a percentage:


jmyers2043

Let me ask a question to see if I understand. If a single 1X1 SimGoober irrigation canal section has the OG b5c00cc0 and if I make an irrigation ditch using 50 of those canal pieces in my city, will that provide 5,000 cap relief? Does it add?

Sometimes IR demand goes negative. I usually make a new village when that happens. Some R$ will move into town. The result is an upturn in IR demand and farms zones will sprout again. Instead, would the use of those same SimGoober canal pieces cause IR demand to go positive and cause farm development?

Jim Myers  (5th member of SC4 Devotion)

xxdita

Quote from: jmyers2043 on July 02, 2010, 06:09:57 PM
Let me ask a question to see if I understand. If a single 1X1 SimGoober irrigation canal section has the OG b5c00cc0 and if I make an irrigation ditch using 50 of those canal pieces in my city, will that provide 5,000 cap relief? Does it add?

Judging by the "get_source_building_count" for each OG, I would have to say you're exactly right Jim. The capacity will continue adding with each new piece plopped.

QuoteSometimes IR demand goes negative. I usually make a new village when that happens. Some R$ will move into town. The result is an upturn in IR demand and farms zones will sprout again. Instead, would the use of those same SimGoober canal pieces cause IR demand to go positive and cause farm development?

As long as there's workforce drives in place & no other C&I zoning to interfere with the capacity again, IR shouldn't have any problem going positive.

xxdita

#3
Since the LUA is included with the CRF, it seems that the CRF would become a dependency for any lots using the OG's to provide CAP relief? Or is the LUA in BSC Essentials? too lazy to look right now  :P

RebaLynnTS

What, exactly, would I need to add to my lots to get this to work?
Becca

Look for me at ... Becca At Bat

xxdita

Really, it's as simple as adding the proper Occupant Groups. So figure out how much IR Cap Relief you'd like a particular lot to give, then put in the necessary OG's to get that number.

But I'm not sure if the dependency would be BSC Essentials or the CRF itself... we'll let somebody else answer that one.

RebaLynnTS

Correct if I am wrong, all I need to do is add a rep to the OG's and put in the hex code listed below?
Becca

Look for me at ... Becca At Bat

xxdita

The following Occupant Groups will add the corresponding IR Cap Relief:

0xb5c00cc0 = 100
0xb5c00cc1 = 200
0xb5c00cc2 = 400
0xb5c00cc3 = 800
0xb5c00cc4 = 1600
0xb5c00cc5 = 3200
0xb5c00cc6 = 6400
0xb5c00cc7 = 12800
0xb5c00cc8 = 25600
0xb5c00cc9 = 51200
0xb5c00cca = 102400
0xb5c00ccb = 204800
0xb5c00ccc = 409600
0xb5c00ccd = 819200
0xb5c00cce = 1638400
0xb5c00ccf = 3276800

You can only use the OG once per building desc, but you can use any combination of different OG's from this set to get the value you want. ie adding 0xb5c00cc0,0xb5c00cc1, 0xb5c00cc2 would give you a total of 700 IR Cap. 

I believe that it's the Census Repository Facility v3 (check under RippleJet on the LEX) that has the LUA, and the functionality to keep track of the added IR Cap Relief, in clear statistics.

RebaLynnTS

OK, got that part, but my question is do I just add them to the existing OG?
Becca

Look for me at ... Becca At Bat

RippleJet

Quote from: RebaLynnTS on July 09, 2010, 12:10:39 PM
OK, got that part, but my question is do I just add them to the existing OG?

Yes, and you must of course also add the actual I-R CAP relief. ;)
In other words, Demand Satisfied 0x4900 CR, where CR is the CAP relief.

RebaLynnTS

Does this look right?

Demand Satisfied     0x49000064   
OccupantGroups       0x00001004,0x00001401,0xB5C00CC0
Becca

Look for me at ... Becca At Bat

RippleJet

Quote from: RebaLynnTS on July 09, 2010, 03:42:19 PM
Demand Satisfied     0x49000064   

Demand Satisfied requires pairs.
The first rep in each pair determines the RCI demand type and the second rep sets the value.
If the CAP relief is to be 100, then this is what it will look like in Reader:

Demand Satisfied 0x00004900, 0x00000064

RebaLynnTS

Becca

Look for me at ... Becca At Bat

Lior

On the RCI exemplar "Industrial Connections", what's the difference between the property "Satisfies" and the property "Contributes"?