Jump to content
boformer

Deeper zones? Well, why not?

138 posts in this topic Last Reply

Highlighted Posts

  • Original Poster
  • Posted:
    Last Online:  
     

    I'm not sure how you would define the 3 wealth levels we have in the game.

    For me low-wealth are farmers, simple industrial workers, people working in fast food restaurants...

    Medium-wealth people would be teachers, engineers, medical doctors, the manager of the fast food restaurant, office workers.

    High-wealth would the CEO of the fast food company, the office manager, the chief engineer (millionaires and above). They would own one of those large villas on 8x8 lots with the grass that looks greener, only drive with sports cars.

    These 3 wealth levels can easily be recognized by the player. Adding more levels would just make it all blurry again.

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    1 hour ago, boformer said:

    I'm not sure how you would define the 3 wealth levels we have in the game.

    For me low-wealth are farmers, simple industrial workers, people working in fast food restaurants...

    Medium-wealth people would be teachers, engineers, medical doctors, the manager of the fast food restaurant, office workers.

    High-wealth would the CEO of the fast food company, the office manager, the chief engineer (millionaires and above). They would own one of those large villas on 8x8 lots with the grass that looks greener, only drive with sports cars.

    These 3 wealth levels can easily be recognized by the player. Adding more levels would just make it all blurry again.

    Those perfectly describe R$, R$$, and R$$$$. I just want to blur the line between middle class and upper class. The upper-middle class live in track mansions (oversized cookie cutters without yards) on 3-tile wide (4-8 tile deep) lots, "executive homes" (3 storeys, tacky or dull, small front yards with hedges), renovated historical manors with small yards, penthouses of middle-class condominiums, the lower floors of upper-class condominiums, lofts, and run down historical manors (small mansions) with standard yards. They include declining blue bloods, successful workers, and most yuppies. They drive luxury sedans, cheap sports cars, convertibles and luxury minivans where upper class drive sports cars or classics and middle class drive cheap sedans and cheap minivans.

    The upper-middle class are college-educated (like the upper class), live in cheap imitations of upperclass buildings on middle class lots, or run down blue-blood property. They are the stepping stone between middle class and upper class though ceilings mean most never exceed this class and upper class can slowly fall to this class. They can arise from upgrading from middle class or falling from upper class.

     

    I should start a new thread.

    • Like 1

    Ocram's Razor: Though "more things shouldn't be used than are necessary," they're just too fun to pass up! Expect many verbose arguments from me. I will try to write abstracts before or short summaries after from now on.

    Words to live by:
    "Now there are varieties of gifts, but the same Spirit. But to each one is given the manifestation of the Spirit for the common good. For to one is given the word of wisdom through the Spirit, and to another the word of knowledge according to the same Spirit; to another faith by the same Spirit, and to another gifts of healing by the one Spirit... But one and the same Spirit works all these things, distributing to each one individually..." 1 Corinthians 4-11

    "Do not worry about tomorrow; for tomorrow will care for itself. Each day has enough trouble of its own." Matthew 6:34
    "Do not judge so that you will not be judged. For in the way you judge, you will be judged; and by your standard of measure, it will be measured to you." Matthew 7:1-3

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Not sure how realisable it is, but if you would orient the buildings by real parameters.

     

    so in Reality, a high density building ist only built, when there is a advantage in comparison to the low density buildings. In rural zonesit is simply cheaper to build a few low density buildings than a big one.

    if the land value becomes higher, the big buildings get more useful, cause the cost for the ground are more decisive.

    so maybe you could make the high density buildings dependent on whether there is in a certain radius a better spot for smaller buildings.

    Dont know if this makes sense to implement and if its understandable :D

    but maybe you can get some inspiration :)

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    1 hour ago, DaHindi said:

    so maybe you could make the high density buildings dependent on whether there is in a certain radius a better spot for smaller buildings.

    That's my plan.

    The city has to reach a decent size before medium density buildings will spawn (that size depends on the available build space of the map).

    Medium-density buildings would only spawn in places with high desirability (service coverage etc.) and land value.

    I'm not sure if there should also be a fixed cap that limits the amount of medium density buildings. It could be depending on the population count:

    Basically like the CAM or SC4 caps. It would have to be carefully balanced to make the growth of the city challenging, but not overwhelming.

    zones.thumb.PNG.9e372065b2918ef09fc81963

     

    • Like 4

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I did not understand (and I am not sure to agree)...

    I agree that the access at densities depends on population of the city.
    But:
    - Or the mayor has a unique possibility of zoning (which does not integrate the density) and the simulation calculates the density;
    - Or the mayor has 3 possibilities of zoning including the densities (LMH) and buildings develop... or not!

    So, the density of buildings does not depend on the wealth: there is numerous large housing projects where live poor inhabitants.
    The density of buildings depends, for example, of:
    - the land value with regard to the income of families;
    - the number of available housing with regard to the income of families;
    - time and cost of route between the house and the work;
    - the age of the zone...
    Of course, every criterion is balanced according to the wealth of the family.

     

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Oohhh!!!

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Initially you mentioned 8x16 as possible sizes as well. As I'll soonish start some more industry I'm wondering if it's still on the table. I plan on making some larger stuff (RICO for now) which can be turned into growables when we have larger growables, I'm wondering what size limits we're looking at (most will prob be within 8x8, but some could be wider). :)

    • Like 3

    My workshop items

    Catch my latest project and future plans on my Patreon page

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    No idea. I will think about it when I am implementing the spawning alg.

    Right now i'm on vacation.

    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    This is not dead. It's just paused like all the other projects.

    I uploaded an unpublished change that changes the maximum size of growables to 8x8:

    https://github.com/boformer/GrowableOverhaul/commit/d61a159533d4d4f13e2cc2d82abc56ca2628b788

    The reason for that: dreadicon wants to work on the mod.

    • Like 5

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Just wondering, did you ever get around to figuring out how to add new zone types? I would like to mod in medium density housing (seeks 50% families & 50% singles, semi-detached, low-rise housing with L5 being mid-rise) zones, hotel (requires After Dark) zones, and small offices (L1 low rise, L2 borderline midrise, L3 midrise).

     

    If you documented which algorithms and data sets need to be changed, I could put my extended downtime to good use. I'm currently bored to tears.


    Ocram's Razor: Though "more things shouldn't be used than are necessary," they're just too fun to pass up! Expect many verbose arguments from me. I will try to write abstracts before or short summaries after from now on.

    Words to live by:
    "Now there are varieties of gifts, but the same Spirit. But to each one is given the manifestation of the Spirit for the common good. For to one is given the word of wisdom through the Spirit, and to another the word of knowledge according to the same Spirit; to another faith by the same Spirit, and to another gifts of healing by the one Spirit... But one and the same Spirit works all these things, distributing to each one individually..." 1 Corinthians 4-11

    "Do not worry about tomorrow; for tomorrow will care for itself. Each day has enough trouble of its own." Matthew 6:34
    "Do not judge so that you will not be judged. For in the way you judge, you will be judged; and by your standard of measure, it will be measured to you." Matthew 7:1-3

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    1 hour ago, OcramsRzr said:

    If you documented which algorithms and data sets need to be changed, I could put my extended downtime to good use. I'm currently bored to tears.

    That's the major work that needs to be done ;)

    Basically just decompiling the code and finding out where the zone types are referenced. All those parts must be changed by the mod.

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    19 minutes ago, boformer said:

    That's the major work that needs to be done ;)

    Basically just decompiling the code and finding out where the zone types are referenced. All those parts must be changed by the mod.

    At least throw me a bone with keywords! With the right software and keywords (and time, and motivation), I might be able to fulfill your dream of separating wealth of inhabitants from wealth of zoned buildings from their density/level and my dream of adding middle school, community colleges, and graduate school universities (existing ones are undergrad only) in addition to the shared desire of more zone types.

    • Like 1

    Ocram's Razor: Though "more things shouldn't be used than are necessary," they're just too fun to pass up! Expect many verbose arguments from me. I will try to write abstracts before or short summaries after from now on.

    Words to live by:
    "Now there are varieties of gifts, but the same Spirit. But to each one is given the manifestation of the Spirit for the common good. For to one is given the word of wisdom through the Spirit, and to another the word of knowledge according to the same Spirit; to another faith by the same Spirit, and to another gifts of healing by the one Spirit... But one and the same Spirit works all these things, distributing to each one individually..." 1 Corinthians 4-11

    "Do not worry about tomorrow; for tomorrow will care for itself. Each day has enough trouble of its own." Matthew 6:34
    "Do not judge so that you will not be judged. For in the way you judge, you will be judged; and by your standard of measure, it will be measured to you." Matthew 7:1-3

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    2 hours ago, OcramsRzr said:

    At least throw me a bone with keywords! With the right software and keywords (and time, and motivation), I might be able to fulfill your dream of separating wealth of inhabitants from wealth of zoned buildings from their density/level and my dream of adding middle school, community colleges, and graduate school universities (existing ones are undergrad only) in addition to the shared desire of more zone types.

    Decompiling section: http://skylines-modding-docs.readthedocs.io/en/master/modding/Workflow/Reverse-Engineering.html#decompiling

    Look at the decompiled Assembly-CSharp.dll

    ItemClass.SubService can have values like ResidentialLow and ResidentialHigh. It is referenced in many places. For example, the residential AI checks if a building is low or high density.

    In the tree on the left, expand ItemClass and right-click on m_subService, then click Analyze. It will show you the references.

    I think there are about 100 references, not all of them are relevant because subService also has values like transport types or special industry types.

    You can also export the sources to a single file for easy searching of terms like "ResidentialLow" and "ResidentialHigh".

    ----

    ItemClass.Zone is the zone type itself. It is referenced in a few places directly related to zoning.

    Storage of the zone information:

    The zone type bits are stored for every zone block, in this float bit mask:

    https://gist.github.com/boformer/aa850369bfa58c839bdc#file-zoneblock-cs-L44-L46

    Here you can see how the data is saved in the bitmask:

    https://gist.github.com/boformer/aa850369bfa58c839bdc#file-zoneblock-cs-L1028-L1066

    (This is decompiled and commented source code)

    According to my last investigation, it is possible to have 12 zone types (there are 4 bits for every zone cell to store the zone type).

    Right now these 6 exist, there is room for 6 additional zone types:

    •     ResidentialLow,
    •     ResidentialHigh,
    •     CommercialLow,
    •     CommercialHigh,
    •     Industrial,
    •     Office,

    -----

    How to add/modify stuff would be step 2 after a complete analysis.

    • Like 4

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 28/02/2017 at 11:23 PM, AJ3D said:

    However, I can't find the code that then reads this texture, and actually applies the zone colors.

    It is done by a shader. Here is the part where the zone colors are supplied to the shader:

    // ZoneProperties
    private void InitializeShaderProperties()
    {
    	for (int i = 0; i < this.m_zoneColors.Length; i++)
    	{
    		Shader.SetGlobalColor("_ZoneColor" + i, this.m_zoneColors[i].linear);
    	}
    	...
    }

     


      Edited by Cyclone Boom  

    Note: This is a reply to a post hidden by the quoted user.
    • Like 2

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 01/03/2017 at 7:52 PM, AJ3D said:

    Is is possible to determine what uses the m_zoneLayout texture? That's the last reference to the zone byte I can find. Analyzing it in IlSpy yields nothing. There has to be some code somewhere that reads the alpha of that texture, reads the global shader colors, and spits out the final result.

    That all happens in the shader. The texture is supplied to the shader at some point (zone material). I guess only CO could help us.


      Edited by Cyclone Boom  

    Note: This is a reply to a post hidden by the quoted user.
    • Like 1

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 02/03/2017 at 0:04 AM, AJ3D said:

    Perhaps the color assignment is hard coded into the zoneshader? Is that something that can be modified? Perhaps we will need to derive a new shader?

    That's very likely. CO likes to hardcode stuff.

    The number 0.0322580636 is about 1/31, that means there are 32 distinct alpha values for zone shades.

    Maybe @Ronyx69 can help us to take a look at the zone shader? I know that there was tool to extract the first lines of the shaders, but I don't have the time to find it.


      Edited by Cyclone Boom  

    Note: This is a reply to a post hidden by the quoted user.
    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    18 minutes ago, boformer said:

    That's very likely. CO likes to hardcode stuff.

    The number 0.0322580636 is about 1/31, that means there are 32 distinct alpha values for zone shades.

    Maybe @Ronyx69 can help us to take a look at the zone shader? I know that there was tool to extract the first lines of the shaders, but I don't have the time to find it.

    Since the 1.6 update I haven't been able to get the shaders out like I could before, the appearance of the files changed and most of it just looks like gibberish since then.

    This is all I could get with unity assets explorer, same thing with hex editor. From resources.assets

    Spoiler

    Shader "Custom/Overlay/ZonedArea" {
    Properties {
     _Color ("Color", Color) = (1.000000,1.000000,1.000000,1.000000)
    }
    SubShader { 
     Pass {
      ZTest Always
      ZWrite Off
      Blend One OneMinusSrcAlpha
      GpuProgramID 35339
    Program "vp" {
    SubProgram "d3d9 " {
    GpuProgramIndex 0
    }
    SubProgram "d3d11 " {
    GpuProgramIndex 1
    }
    SubProgram "glcore " {
    GpuProgramIndex 2
    }
    SubProgram "d3d9 " {
    GpuProgramIndex 3
    }
    SubProgram "d3d11 " {
    GpuProgramIndex 4
    }
    SubProgram "glcore " {
    GpuProgramIndex 5
    }
    }
    Program "fp" {
    SubProgram "d3d9 " {
    GpuProgramIndex 6
    }
    SubProgram "d3d11 " {
    GpuProgramIndex 7
    }
    SubProgram "glcore " {
    GpuProgramIndex 8
    }
    SubProgram "d3d9 " {
    GpuProgramIndex 9
    }
    SubProgram "d3d11 " {
    GpuProgramIndex 10
    }
    SubProgram "glcore " {
    GpuProgramIndex 11
    }
    }
     }
    }
    }

     

    • Like 1

    Ronyx rhymes with electronics...  

    Steam  //  Twitch  //  YouTube  //  Twitter  //  CSLModding.INFO

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    I wonder if there is anyone who still got the old asset files.

    • Like 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    15 minutes ago, boformer said:

    I wonder if there is anyone who still got the old asset files.

    A ship came by and gave me an old version of the game.

    https://gist.github.com/anonymous/be201f8a0fcf0c2613ac77ed296106fc

    • Like 3

    Ronyx rhymes with electronics...  

    Steam  //  Twitch  //  YouTube  //  Twitter  //  CSLModding.INFO

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    All these is so nice - Trafficmods, zones withslider, new Sizes, CAM, NAM - paradox wouldt have make a own expansion for that and we get it for free - wonder why you guys dont build a own game :)

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Is this still active? Do you have a working mod? If so (and Asset Tool works) I can start work on my HK projects for this game (Finally..............)

    Additionally you said there is room for 6 more Zone Types. I am pretty decent at C# and I will look at the repository or maybe even fork it.

    I was thinking we can restrict ResidentialLow, ResidentialHigh to 6x6 (use a conditional) and create 2 new Zone Types

    ResidentialDense, CommercialDense and allow that to open to 8x8


    I love coffee and buildings.

    You can find more info about me here > http://nbixelsimcity.tumblr.com/

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    It's unfinished and not updated for the latest version of the game. I know that @AJ3D did some experiments a few months ago, adding larger assets and a very basic spawning algorithm, but it was not ready for release.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Adding new zone colors is also impossible until CO fixes it with a patch. I'd personally love to see medium density residential & commercial and high density offices but some other thread revealed that they cannot currently be new colors.

     

    However, @bixel, you can make Hong Kong assets with ploppable RICO (make them unique buildings and add a special text file or 2). Personally, I recommend a vanilla scale population and a realistic population file.

    • Like 1

    Ocram's Razor: Though "more things shouldn't be used than are necessary," they're just too fun to pass up! Expect many verbose arguments from me. I will try to write abstracts before or short summaries after from now on.

    Words to live by:
    "Now there are varieties of gifts, but the same Spirit. But to each one is given the manifestation of the Spirit for the common good. For to one is given the word of wisdom through the Spirit, and to another the word of knowledge according to the same Spirit; to another faith by the same Spirit, and to another gifts of healing by the one Spirit... But one and the same Spirit works all these things, distributing to each one individually..." 1 Corinthians 4-11

    "Do not worry about tomorrow; for tomorrow will care for itself. Each day has enough trouble of its own." Matthew 6:34
    "Do not judge so that you will not be judged. For in the way you judge, you will be judged; and by your standard of measure, it will be measured to you." Matthew 7:1-3

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    On 5/25/2017 at 6:59 PM, bixel said:

    Great, I will check that out, perhaps I can iron out some wrinkles myself.

    Feel free to add me on Steam, and I can fill you in on what my plans where if your interested.

    I've got some basic ideas for lot merging, lot dividing, a spawning algorithm that spawns entire rows of buildings at once, and different behaviors for different zones at different wealth levels. Ive also got some ideas for district level controls.

    I did start with the intention of doing 6x6, but once you crack everything open, there is no reason not to go to 8x16 and 16x8. That allows full size RICO assets to grow.

    I've also worked on an updated RICO mod that feeds RICO assets to the new larger growables mod for growing.

    • Like 2

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account


    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections