Jump to content
Francis90b

On reliably laying roads and infrastructure from an external image

55 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

G'day,

 

I've been thinkering with the idea of developing a whole region by laying down just the transportation infrastructure, without building an actual city, similar to how it's done in some "roadgeekery" CJs.

 

For that purpose, I've been tracing every road I intend to lay inside the game on a region overview I have gotten from Terraformer - please see first image. There are non-orthogonal or winding stretches of road, and for those I took note of the footprint of the puzzle pieces I might need to recreate them, and checked that the combinations I need would be doable in game without modification.

Many more roads will follow, inclusing some rather winding ones - the second image kind of gives an idea of some I would like to incorporate in the road grid. That's doable too, just by doing what I've been doing.

 

I'm now concerned with finding a way to translate all of that planning into the game, individual city tile after individual city tile, following an efficient and reliable method.

In Cities skylines that is definitely possible - an external image is overlaid on the terrain map, and roads can be efficiently and accurately plotted from there. Alas, this is not  as straightforward in SimCity4.

Common sense has it that I should take careful note of the position of every interection and every non-orthogonal segment, and work methodically from there - which is what I intend to do.
However, I understand that this method alone might not necessarily be the most efficient, and might not grant sufficient reliability.

Sure, in some cases erring 1-2 tiles might not represent an issue, but in general it would be far better if I can make the roads I plotted on the overwiew align as intended.

 

I'm looking forward to more insight from someone who might have found themselves in a similar situation.

Thanks in advance.


PS: The map is an excerpt from Drunkapple's /Dobdriver's beautiful "Minneapolis" map, with further edits. I might attach it upon request, if it is possible.
 

 

SL region roadgeekery overview JPG.jpg

3628 paths JPG.jpg

 

 

  • Like 3

Share this post


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

There should be a way to do it, but it's very convoluted and might not be very useful in the long term.

You can create, with the BAT, a flat 3D object with your image used as the texture, then render into the game, and lot it, slightly floating over the surface on a small lot, letting it overhang in all sides for as much as the game allows, and it would be visible over the terrain, provided that the terrain is flat or goes underneath the level of the spot where the lot is plopped. Of course, because the object is opaque, you couldn't see underneath it, so you would have to follow the lines blindly with the network tool, or go back and forth plopping and demolishing the map lot to check your advances.

Now, the main limitation with this approach is that the flexibility of the game's networks, even if tremendously expanded from the original set, is still quite limited when compared to real life, so it's almost sure that you'll find lots of situations in which the best (or only) option is to deviate from the plan, and in that case, having a rigid format to follow will be even more limiting. Having tried to do something similar years ago, I would recommend you to do it backwards, by taking hints from your original plans, building them in the game as it results functional, and then checking them from outside the game to see how much you deviated from the original, and how to fix the plan onwards.

You can use this method to export game images to Google Earth to check for real-life proportionality:

 

  • Like 2

matias93's Unexpected Mod Workshop (dev thread)             Ciudad del Lago in the making (dev City Journal)

"Let us be scientists and as such, remember always that the purpose of politics
is not freedom, nor authority, nor is any principle of abstract character,
but it is to meet the social needs of man and the development of the society"

— Valentín Letelier, 1895

Share this post


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

    Thanks, @matias93 !

    I considered , and taken into account, the opportunity to run the road-laying and mapping process as a multi-pass procedure, checking in-game if the alignments I drew are suitable in practice as they should be in theory, and revising the map if I find that this isn't the case:  I composed the non ortho section by putting together the footprints of puzzle pieces, which should imply that if I lay them correctly, they should work without adjustment, but the terrain, as you can see, is far from being flat. Hence it might well be that there is some excessive steepness within the path of a road, and that a certain bend which I placed at some point, maybe to avoid a small buff, ought to have been placed further or earlier on the road. Or that a certain path might look doable on the map, but like an exciting rollercoaster when implemented into the non-flat reality of the game.

    I should clarify that I do not plan to recreate the real Saint Paul, and my map has been edited and distorted to suit my vision.
    I took note of the method you developed for overlaying Simcity4-excerpted map views on Google Earth, and appreciate your mention of it and the careful explanation you provided at the link you posted. However, I'm afraid it might not be of much use in the specific situation i'm in.

     

    I've been wondering if there's a way to instruct the game to plop something (for example a single tile of industrial zone, or a water pipe) on a given set of coordinates within a given city-tile, and to automate that process to some extent.

    That way, it might be possible to generate the equivalent of an overlay, which I can then use to place roads.

    • Like 2

    Share this post


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

    A year ago I would have said "sorry, no, there's no way", but the impressive advancements we have seen recently with DLL modding make me question that received knowledge. Maybe @Null 45 might have something else to say about it.

    • Like 1
    • Yes 1

    matias93's Unexpected Mod Workshop (dev thread)             Ciudad del Lago in the making (dev City Journal)

    "Let us be scientists and as such, remember always that the purpose of politics
    is not freedom, nor authority, nor is any principle of abstract character,
    but it is to meet the social needs of man and the development of the society"

    — Valentín Letelier, 1895

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    15 hours ago, matias93 said:

    Maybe @Null 45 might have something else to say about it.

    Yes, indeed. I've been testing Null's SC4 Auto Run Cheats - DLL Plugin which would allow the zone placement upon entering a city tile. There is currently a tiny bug tho in which the necessary command doesn't work from the INI, but I've reported it and I believe there'll be a quick resolution. (I'm guessing the DLL didn't realize there could be up to 5 parameters passed for a cheat code and so it's getting confuzzled. That's not a fact, but just my own guess.)

    Turns out I misunderstood what the DLL mod can do. It handles cheats whereas the needed command isn't supported. Ofc, knowing how Null digs into things it might later be possible.

    • Like 2

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    1 minute ago, CorinaMarie said:

    (I'm guessing the DLL didn't realize there could be up to 5 parameters passed for a cheat code and so it's getting confuzzled. That's not a fact, but just my own guess.)

    As I already replied on the file topic, the bug is due to the fact that the game has separate systems for commands and cheats. Currently the DLL only supports cheats, i.e. anything that shows up in the right-click cheat list that the extra cheats DLL adds. But I am currently working on adding the command support.

    Once that is done, I plan to add an alternate command format that should be more friendly for automation (which is a use case for the DLL that I didn't originally consider). That would allow cheats/commands to be placed in an external text file with a new command on each line.

    • Like 4

    Share this post


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

    The SC4 Auto Run Cheats DLL has been updated to enable using commands like PlaceNetwork and to allow the commands/cheats to be specified in an external file to make automation easier.

    • Like 1
    • Thanks 2

    Share this post


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

    Thank you very much for the updated version!

    I was somewhat aware of the DLL's existence when postimg my inquiry, and wondering if it could help somehow.



    "PlaceZone" seems exactly what I was looking for, more so than "PlaceNetwork".

    The difference being that while placing a network on a tile would flatten it, placing a zone shouldn't necessarily do that - except when the ground is significantly steep.

    Someone might choose to use PlaceNetwork to mark down specific intersections or relevant points: flattened/altered ground wouldn't be an issue over a single tile.

    But I was looking forward to establish contiguous "ribbons" of marked tiles following the path of planned roads. Placing single network tiles along a contiguous path effectively flattens the terrain along that path - great for terraforming, but not necessarily desiderable in this case.  Placing zones (i'm thinking industrial) - would minimize that effect.

     

     

    This is how I imagine it ought to look like:

     

    [EstablishedTile]

    RunOnceCommandList= File:(path)

     

    Then, within the file:

    PlaceZone (zone type) (tile coords)

    Therefore:

    PlaceZone MediumIndustrial 25,64
    PlaceZone MediumIndustrial 25,65
    (snip)
    PlaceZone MediumIndustrial 36,44
    PlaceZone MediumIndustrial 36,45

    Etc, etc.

    Did I get that right?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    11 hours ago, Francis90b said:

    [EstablishedTile]

    It can also be: [UnestablishedTile] *:)

     

    11 hours ago, Francis90b said:

    RunOnceCommandList= File:(path)

    Yep. And here's my example:
    RunOnceCommandList=File:C:\Users\Cori\Documents\SimCity 4\Auto Run Commands\AutoRun List.txt

    Ofc, I made the folder "Auto Run Commands" under "SimCity 4" and created the .txt file too.

     

    11 hours ago, Francis90b said:

    Did I get that right?

    Not quite. The PlaceZones (and PlaceNetwork) are passed five parameters. The first is the Zone (by number) or the Network Type (by number) and then the starting X and Y and the ending X and Y and there are no commas separating the coordinates.

     

    11 hours ago, Francis90b said:

    PlaceZone MediumIndustrial 25,64
    PlaceZone MediumIndustrial 25,65

    Here your intention is to place each cell of zoning individually and you can do that like this:

    PlaceZone 8 25 64 25 64
    PlaceZone 8 25 65 25 65

     

    11 hours ago, Francis90b said:

    PlaceZone MediumIndustrial 36,44
    PlaceZone MediumIndustrial 36,45

    But we can create a bounding box and do this with one command:

    PlaceZone 8 36 64 36 65 (I made these close to your first ones so the following pic would show them better.)

     

    11 hours ago, Francis90b said:

    placing a network on a tile would flatten it

    That's a good point. *:ohyes:

    How about using Power Lines? They don't distort the terrain.

    PlaceNetwork 5 26 63 35 63

     

    And with those four commands:

    imgW10-2605.jpg

     

    And for reference, here're the numbers for each command:

    Road          =  0
    Rail          =  1
    Highway       =  2
    Street        =  3
    Pipe          =  4
    PowerLine     =  5
    Avenue        =  6
    Subway        =  7
    ElevRail      =  8
    MonoRail      =  9
    GroundHighway = 10

    See this post below.


    ZoneTypeUndefined                =  0
    ZoneTypeLowDensityResidential    =  1
    ZoneTypeMediumDensityResidential =  2
    ZoneTypeHighDensityResidential   =  3
    ZoneTypeLowDensityCommercial     =  4
    ZoneTypeMediumDensityCommercial  =  5
    ZoneTypeHighDensityCommercial    =  6
    ZoneTypeResourceIndustrial       =  7
    ZoneTypeLightIndustrial          =  8
    ZoneTypeHeavyIndustrial          =  9
    ZoneTypeMilitary                 = 10
    ZoneTypeAirport                  = 11
    ZoneTypeSeaport                  = 12
    ZoneTypeSpaceport                = 13
    ZoneTypeLandfill                 = 14
    ZoneTypePloppedBuilding          = 15 -- // This is what user-plopped buildings are zoned as.

    Disclaimer: I've pulled these from the game code and cleaned them up so I have not tested each to verify the numbers are all correct, but I believe so.

    • Like 2
    • Thanks 1

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     

    I've been tinkering and have a couple more ideas for you. *:)

    The first is to grab @hugues aroux's Scoty Zoning Mod from the STEX.

    For the following pics I used the scoty_ZM_tex_empty.dat file for the textures and the scoty_ZManag_CBVD.dat file for the brightest zone colors. Then, additionally, I edited the High Density Residential color to be full (0xFF) opacity additive to the zoning texture and full (0xFF) red color (cutting both the Green and Blue to 0x00 each).

    Ideally, for your purpose, I believe it'd go even better if the zoning textures were simply all black (or maybe 95% black) as the game merges the zoning color with that underlying FSH.

    With only the color change here's how it looks in a tile:

    imgW10-2611.jpg

    Note: I made it double wide for a reason. *;)

     

    And zoomiered:

    imgW10-2612.jpg

    ^ Notice how the edges are bolder? That's from the underlay texture and I propose it'd go well if the whole texture was like that.

     

    Now the reason I went double wide is cause I also enabled True Color Zones in the region's Transportation View:

    imgW10-2613.jpg

    ^ It only shows for the tile I loaded and saved. For the others to show the full colors, they'd need loaded and saved too.

     

    I ran the PlaceZone commands on an [UnestablishedTile]. (It's just north of Tiny Town and that red line showing is the zoned strip.) I do believe with the more solid texture, a single wide would show reasonably well at the region level.

    With 9 easily available zones they could each be colored bold and bright and might allow even better control as you design your creation. If you need more colors the unused zones could also be enabled for 5 more. (Do avoid using the Landfill Zone as it'll level the terrain in weird ways.)

    One thing goofy about the game (for this use) is it wants to toss in a street plop on every 7th cell when using the command from the Auto Run Cheats DLL. (If you hold shift and do it in the game yourself, it'll give you the zones only.)

    As such my commands were:

    PlaceZone 3 95 0 96 6
    PlaceZone 3 95 7 96 13
    PlaceZone 3 95 14 96 20
    PlaceZone 3 95 21 96 27
    PlaceZone 3 95 28 96 34
    PlaceZone 3 95 35 96 41
    PlaceZone 3 95 42 96 48
    PlaceZone 3 95 49 96 55
    PlaceZone 3 95 56 96 62
    PlaceZone 3 95 63 96 69
    PlaceZone 3 95 70 96 76
    PlaceZone 3 95 77 96 83

     

    If you want to see them in the Region Transportation View, this mod'll allow that:

    zDataView - Regional Transport Map - CoriBoom Filters.dat

    ^ This file was part of a larger mod CB and I created with different than Maxis bright colors for the networks, but the rumor (likely true) was that it wouldn't work with NAM's RHW and since we never installed that, we didn't test with it nor release the full package.

    And so it could also be the above file might fight with others. I don't know. It is a separate exemplar from the network colors so it'll prolly be alright. I sort of remember filtering Seaports and Airports differently too so that might also be a difference. (Basically, I'm saying I forget all the details of what I created in this one, but it does work for the test pic I made. *;) )

    • Like 3

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    4 hours ago, CorinaMarie said:

    Disclaimer: I've pulled these from the game code and cleaned them up so I have not tested each to verify the numbers are all correct, but I believe so.

    The zone types look correct, but the network types are missing 2 values. The list in gzcom-dll's cISC4NetworkOccupant.h is:

    Road                     = 0
    Rail                        = 1
    Highway               = 2
    Street                    = 3
    WaterPipe            = 4
    PowerPole           = 5
    Avenue                 = 6
    Subway                = 7
    LightRail              = 8
    Monorail              = 9
    OneWayRoad      = 10
    DirtRoad              = 11
    GroundHighway = 12

    DirtRoad was unfinished in the base game, and the NAM team repurposed it for RHW.

    • Thanks 3

    Share this post


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

    Thanks!

    For the sake of general discussion I've been wondering how the DLL might react if it is instructed to run autoplacement on the same tile withinin the same set of instructions or in two different sets run at different times.

    In the example below I'm making a nice little cross:

    "Placesomething" 3 1 3 5
    "Placesomething" 1 3 5 3

    The tile that would appear twice is 3 3.

    I surmise that DLL should be able to handle this without crashing. But I can't rule it out entirely. Can someone confirm that it will keep running?



    If it does, the following might happen:

    - Same tile *and* same zone specified: the DLL will run the first line and the second line, and the tile will be zoned once, according to the first line.The second line will be run, but given that the zone it specified was already present on that tile, there won't be any change.

    - Same tile *and* a different zone specified: the DLL will run the first line placing the zone specified there, then the second line where a different zone has been specified, replacing the former.

    -Same tile, a *zone* specified in the first line, and a *network* which would obliterate it in the second line: the DLL will run the first line zoning the tile, and then the second line, replacing the zone with the network.

    -Same tile, a *network* specified in the first line, and a *zone* in the second line: the network won't be replaced.

    - Same tile, two networks which can intersect each other: the DLL will place both, creating the intersection.

    -Same tile, two networks which cannot intersect each other (e.g. ground highway and railroad): a) the DLL will place the network that has been specified first *but not* the latter one or b) the DLL will *replace* the network that has been specified first with the latter one - which is the case?

     

    This, as far as general musings are concerned.



    There's a lot of potential in using the DLL that way: if someone had the map of a real terrain and knew the precise coordinates they can also extract a map view from Google Earth or similar, trace down what they want to recreate in game, and use the DLL to do that. That will be someone's gold, i'm sure.



    But that brings me to the other half of the issue, so to speak.

    Writing down paths on the text file is cool...

    PlaceZone 8 25 65 25 65 (point)

    PlaceZone 8 25 65 25 95 (line)

    PlaceZone 8 25 65 29 95 (bounding box)

    ...but finding some other way to do it might be even cooler for non-griddy situations.

    Take a look at this example, the little quaint Bendyburg:

     

    Bendyburg.png

     

    The blacks are the intended position of roads, the whites everything else.

    Almost no straight segment there: not really practical to write it all down as a set of lines and points, is it?



    I wonder if there might be some tool that might help to list every single pixel possessing a given RGB value?

    If there's any way to do that, the list can be used to create placement instructions for the DLL.

    And it wouldn't matter how convoluted or messy a pattern is, it would be replicated reliably....even Bendyburg.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    8 hours ago, Francis90b said:

    I've been wondering how the DLL might react

    The DLL itself won't have any reaction for any of your scenarios.

    The brilliant thing it does is simply allow you to have repeated access to the cheats and commands which previously could only be done by pulling up the cheat code box with Ctrl+x. It is passing on whatever you'll tell it. So, if you tell it something the game itself wouldn't understand via the popup box, then the very same command passed using the DLL will also be ignored.

    For examples where you make a cross it'll depend on what the Placesomething is. If it's streets for each and we stay orthogonal, they will make an intersection the same as if you did it with your mouse in the game. Same for roads. If you try to intersect a ground highway with a rail line, that won't work.

    Essentially any valid command you send to the game's cheat system via the DLL will react the very same as if you did it manually in the game.

    Try to zone on the same cells as a road and it'll just ignore that. Zone one thing then another on top of it, and the latter will take precedence.

     

    Bendyburg will be the very same challenge with or with out the DLL access for sending commands. It'll need NAM style solutions to come up with the best it can be and I suspect those drag patterns might need to be done manually. The best you might do issuing commands is give a general marker path to later follow.

     

    Edit: I've been thinking about this:

    8 hours ago, Francis90b said:

    I wonder if there might be some tool that might help to list every single pixel possessing a given RGB value?

    If there's any way to do that, the list can be used to create placement instructions for the DLL.

    Your concept is certainly possible. It would need someone with the programming skills and desire to do it. I would imagine you'd need to make the diagram fit the same pixel size as the city tile and an easy way would be to save it as two-bit color so each pixel is either on or off.

    BMP would prolly be the easiest to work with and then for simplicity the output would be one command per pixel / city tile cell for the zone placement so it wouldn't have to figure out short lines nor bounding boxes.

    • Like 3

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


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

    @CorinaMarie

    Sorry, I didn't provide Bendyburg as an example of something I would like to do.

    I provided it as a typical example of a situation in which the autoplacement method might not necessarily be effective unless some way is found to automatically mark down the position of the pixels intended for autoplacement.

     

    What's there so far (thans everyone!) helps with grids made up by orthogonal segments.

    Defining a grid of paths spanning a large city tile, with a N/S or E/W path every 1024 mtrs (64 tiles) just take eight lines.

    However, defining a single diagonal running NW to SE would take 256 lines....which someone would need to write, one by one.

    With something like "Bendyburg", writing a list would be downright insane - unless the list of pixels actually exists- With no ability to generate that starting list, one would actually do things much quicker as they had always been made. But "Bendyburg" is the representation of a fairly typical real life scenario.

    EDIT: Wolfram does it. How, i have no idea. And I have no idea about how it might be done with other tools.
     

    • Like 2

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    24 minutes ago, Francis90b said:

    EDIT: Wolfram does it. How, i have no idea. And I have no idea about how it might be done with other tools.

    With some magic in N++ or Excel, that output could be converted to the PlaceWhatever syntax without too much trouble.

    • Like 2

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


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

    @CorinaMarie

    I imagined that by using Excel converting a position list to the desired format would have been doable (if one is a bit careful).

    Nor I mentioned that the footprint of everything someone wants an overlay for within a given city tile will need to be traced down on on a 1 pixel=1 tile representation of that city tile, using a single RGB combination.

    Both seemed straightforward, making the issue of the middle link between these two phases even more glaring.
     

    What I stumbled upon is just a script for Wolfram - don't even know for which of the gazillion of softwares they have in their suite that script is for.
    But perhaps there's a way to do a script that's accessible and easy for the general public? 

    Whatever script might be used to generate the position list, though, it will need to do the following things:

    1) To load the image.
    2) To cycle through it, looking for every pixel which has a specified RGB value.
    3) To record the position of each pixel identified in that way and
    4) To print out the position list.

    • Like 1
    • Yes 1

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    5 hours ago, Francis90b said:

    1) To load the image.
    2) To cycle through it, looking for every pixel which has a specified RGB value.
    3) To record the position of each pixel identified in that way and
    4) To print out the position list.

    Yep. You've got it exactly right. *:ohyes:

    Here's what CB and I did via some Tiny C code:

     

    imgW10-2624.jpg

     

    We're still tweaking, but the proof of concept works. It is a Dos-Based program, but I imagine you can live with that. *;)

     

    Edit: With my Region View tweak and just standard zone coloring:

    imgW10-2625.jpg

     

    And the file if you want to run it too: Bendyburg.txt

    • Like 4
    • Confused 1
    • Thanks 1

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     

    Some progress. *:)

    The Image2zones.exe program can now distinguish three colors (black, orange, and red) and assign a different PlaceZone to each. I've then also modified the FSH for the zoning textures to be solid middle gray color (hex 0x8b8680 / RGB(139,134,128) and then for the zone color additives, I've made them 100% (0xFF) opacity.

    Here's the modified Bendyburg.bmp:

    img.jpg

    ^ Pasted here as .jpg so it'll actually show.

     

    Here it is rendered in a large city tile:

    01 - Zones in City Tile Overview.jpg

     

    And remember, these are actually Zones:

    02 - Zones in City Tile Details.jpg

     

    With my modified Region Transportation View:

    03 - Full Color Zones Enabled in Region View.jpg

    ^ I do need both exemplars to get the colors as close as possible so I'll need to review what I did in the other (not yet attached anywhere) one since it's a bit more complex. Said exemplar tweaks won't be totally necessary as the program and placing zones can be done without it. Just that the zones will show up in their native color.

     

    Without any zoning color and texture overrides they'd look like this:

    04 - Maxis Zoning Textures.jpg

    ^ Oh, wait. I still have an override in plugins somewhere, but you get the idea.

     

    Here's the file with commands for the Auto Run Cheats DLL: img.txt (I forgot to mention you'll need a minimum cell size of 1 for AG for it to place them.)

    Be sure to load a Large City Tile. I've found if Placing Zones (or Networks) beyond the edge of the tile, the game will immediately CTD. :O

     

    A conundrum:

    It turns out the internal game cheat engine (or whatever it's called that accepts the cheats and commands) has a hard coded (from my perspective) limit for the number of cells which can be placed and then it ignores all subsequent commands. If placing Low Density Residential, Commercial, or Ag the limit is 10,000. Medium Density of all three kinds are cut off at 5,000, and High Density craps out at 2,000.

    My original idea was to have up to 9 colors (one for each available zone), but our sample data currently has 3,035 black pixels, 317 orange, and 512 red. If we tried the black ones as high density then we'd only get about two-thirds and it'd quit. >.<

    I did have the idea to utilize the unused zones (military, airport, seaport, and spaceport), but I can't figure any way to tie colors and textures to them so that's out. We can place them and the query tool shows their name, but they are invisible. Oddly (and prolly cause they can't be used) the limit is 65,536 of each of them.

    So, currently the BMP image data to convert will likely be limited to 10,000 colored dots. (There was some success running a 2nd PlaceZones after the first 10,000 crapped out, but that would complicate things and would need a lot of testing.)

    We'll still get it set up to be able to use all 9 zones, but that can really cramp your style if the 2,000 limit is hit and then it refuses to go on with the others which've not hit their own limit. (Bunches of testing will still be needed to see how severe this really is.)

    • Like 1
    • Thanks 1

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


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

    unused zones (military, airport, seaport, and spaceport), but I can't figure any way to tie colors

    I guess you tried, but to be sure... Assigning a color (on Rep 11/12/13 or 14) in the file [Zone Manager] (exemplar IID: 0xe9482490) -> Prop: [Zone Drag Color] does not work?

    • Thanks 1

    What is good when you have nothing to say is that you can always pretend to listen. Anyway it does not prevent to think!

    >> My little plugins contribution << -- >> Depot | Fabrik | Testing <<

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    53 minutes ago, hugues aroux said:

    I guess you tried, ...

    Yep. I did this:

    imgW10-2653.jpg

    I later realized I have the opacity at the wrong end for Robin Egg Blue, but still no color at all showing for any of the 4 unused zones. (The 0xFF99CCFF in rep 13 is a copy of your rep 5 while I changed low density commercial to nearly black.)

    So, yeah. We are thinking along the same lines. I suspect it's because they are not tied to a texture so it's seeing invisible texture multiplied by anything is still indiscernible.

     

    Edit:

    Sorry for the double beep, @hugues aroux, but since your Zoning mod already has " A handy little fix: for I$ (rural) Zones, you can draw a single-tile zone (Maxis constrains a minimum 4x4 zone). " and I'll be recommending it as a dependency for Image2zones.exe, what do you think about adding the required textures and color scheme for this current project so peeps can just get those parts all in one place from you?

    I've not settled on the full 9 colors yet, but Black (0xFFFFFF), Orange (0xFFA500), and Red (0xFF0000) are for certain. Here's the textures file which you could rename to be consistent with your existing selection:

    zzMiddle Gray Zoning Textures.dat

    • Like 2

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    58 minutes ago, CorinaMarie said:

    what do you think about adding the required textures and color scheme

    Yes .. Sure... I could prepare this on Monday or Tuesday ...!

    thinking .. the zoning of the Landfills is done by a FSH of 8px (0x7ab50e44,0x0986135e,0x00001005 (in sc_2.dat)). It's the only one, but ...

    Still in Zone-Manager, we find this Instance in the property [kZM_mZoneTextureResourceInstanceArray] for -> Landfill !! .. and the other : military, spaceport, ...

    So .. you could try a FSH for military =>(in Group 0x0986135e)  0x7ab50e44,0x0986135e,0x00001012 ; etc...
    (just for information : In sc_5.dat, we find FSH (8px) in another Group, for example a Cyan FSH: 0x7ab50e44,0x1abe787d,0x00001000 .. like AirportZone in simcity3k, I think?! ;-) ...

    • Like 2

    What is good when you have nothing to say is that you can always pretend to listen. Anyway it does not prevent to think!

    >> My little plugins contribution << -- >> Depot | Fabrik | Testing <<

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    11 minutes ago, hugues aroux said:

    Yes .. Sure... I could prepare this on Monday or Tuesday ...!

    Yay! But no hurry at all. We don't even know which 9 colors the colors will be and then which should be assigned to what density.

    For instance in my alternate Region Transport (and Cori's Crayons City) view I used pink for Monorail and if doing that for this program, it'd then make sense to tie that to high density as I would expect less than 2,000 pixels for them. OTOH, I'd expect Road to be the most used and I like Black for that and tied to a Low Density so we can have 10,000 dots of it.

    Ofc, peeps would be free to say any given color is some other network since it's all just representational anyhow. Just we would want a popular color tied to a low density zone for maximum pixels.

     

    11 minutes ago, hugues aroux said:

    So .. you could try a FSH for military =>(in Group 0x0986135e)  0x7ab50e44,0x0986135e,0x00001012 ; etc...
    (just for information : In sc_5.dat, we find FSH (8px) in another Group, for example a Cyan FSH: 0x7ab50e44,0x1abe787d,0x00001000 .. like AirportZone in simcity3k, I think?! ;-) ...

    Sounds like a good lead Sherlock! You're more of an expert at this now than I am. How about I attach a small city tile with all 4 zones zoned and you run a test whenever you might have time?

    City - x.sc4

    • Like 1

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    39 minutes ago, CorinaMarie said:

    Sounds like a good lead Sherlock! You're more of an expert

    héhé ! .. I just reread my 2020 notes about ZoneManager ;-)
    No worries, I'll just prepare the files and you'll tell me the colors chosen later ... and I'll do the Zone test with your city at the beginning of the week. .. strike while the iron is hot as they say!

    • Like 2

    What is good when you have nothing to say is that you can always pretend to listen. Anyway it does not prevent to think!

    >> My little plugins contribution << -- >> Depot | Fabrik | Testing <<

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    2 hours ago, hugues aroux said:

    [kZM_mZoneTextureResourceInstanceArray] for -> Landfill !! .. and the other : military, spaceport, ...

    Ok. I finally peeked and wrapped my head around your suggestion. I just used my same middle gray textures and used the 2nd to smallest with the IIDs listed and it seems that doesn't help.

    I'll attach them here in case you'd like to double check my work: zzz8px Military, Airport, Seaport, Spaceport Zoning FSH.zip

    • Thanks 1

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


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

    Update on our  Image2zones  Tool:

    In my first SC4 modding project in over 25 months, I've been working with Cori on the image to zone commands tool. *:)

    Here are a few pics to show what we've been working on.  (The ones in game are from Cori's comp.)


    Firstly a preview of the source bitmap image, showing each zone type:

    01 - Source Image.png

    Note: Actual size is 256 x 256 pixels to match a Large city tile size. Upscaled here above for easier viewing.


    The code is updated to read 9 distinct colors from the BMP and assign them to the 9 zones in the game.

    Here we've created a transportation demo network layout, based on the Bendyburg image @Francis90b posted initially. The idea is to produce an image, save it as a .bmp file, then our tool reads this and produces commands to run using @Null 45's excellent Auto Run Cheats DLL plugin.


    Our Image2zones tool tallies counts for each pixel colour:

    Low Res - Orange pixels...:        406
    Med Res - Magenta pixels..:        401
    High Res - Green pixels...:        382
    
    Low Comm - Black pixels...:       2111
    Med Comm - Blue pixels....:        277
    High Comm - Purple pixels.:        125
    
    AgrFarm Ind - Red pixels..:        512
    Light Ind - Yellow pixels.:        460
    Heavy Ind - Cyan pixels...:        422
    
    White pixels..............:          0
    Other pixels..............:      60440


    We've given the background a slight off-white shade to make it more contrasting.
    (This works because our code only counts exact matches to the colors we use.)

    As an example, this is the generated file which contains the list of PlaceZone commands:

    img.txt  *:read:

     

    Here's a game preview with the PlaceZone commands run:

    02 - Rendered in Game.jpg

     

    And region view with the tile saved:

    03 - Region View.jpg


    This is with the Region Transportation Map using Cori's two updated exemplars. This means the zones will show within city tiles as true colors, otherwise they'd use the game's default region transportation palette.

    We'd love to hear any feedback on this so far. If there's enough demand for such a tool, we can consider a STEX release along with posting the source code. *;)

    -CB & Cori

    • Like 4
    • Yes 1

    Quick Links

    “SimCity 4 is not just a game, but a tool driven by our own imagination and creativity.”

    Buy me a coffee

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     
    11 hours ago, Cyclone Boom said:

    As an example, this is the generated file which contains the list of PlaceZone commands:

    But by what mistery do you manage to display this? Where do you indicate the reading of "img.txt" and with what syntax? The DLL instructions are not very explicit on this subject!


    What is good when you have nothing to say is that you can always pretend to listen. Anyway it does not prevent to think!

    >> My little plugins contribution << -- >> Depot | Fabrik | Testing <<

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    3 hours ago, hugues aroux said:

    Where do you indicate the reading of "img.txt" and with what syntax?

    First you grab @Null 45's Auto Run Cheats DLL plugin. Place the .dll and the .ini file in game's installation plugins folder:

    01 - Plugin and INI Location.jpg

     

    Then open the .ini file with your fav text editor:

    02 - INI Contents.jpg

    ^ Update line 37 to match your folder locations. If you're not Cori, change that part accordingly. *;)

     

    I made the "Auto Run Commands" folder under SimCity 4 in My Documents:

    03 - Command File Location.jpg

    ^ This is where you drop our img.txt file.

    After that, start up SC4 and select a large, empty city tile and the PlaceZones commands (within the img.txt file) will run before it fully loads. Do not load a small or medium tile because this set of commands would try to go beyond their borders and you'd get a CTD. (Doesn't hurt anything, but it's shocking and totally no fun at all.)

    When you've finished testing you can change line 4 of the .ini to =false and then none of the Auto Run thingers run. Alternately, you can make the other "Run" lines = empty space and that disables them too.

    For the full release version of our program that's where a version of your scoty_ZManag_CBVD - Cori Tweaked.dat file comes in along with my middle gray zoning textures. Here's the first 10 of my current Zone Drag Colours:

    0xFF0000FF,0xFFA500FF,0xFF00FEFF,0x00FF00FF,0x010101FF,0x0000FFFF,0x800080FF,0xFF0000FF,0xFFFF00FF,0x00FFFFFF

    These are not set in stone as we need to decide which would be the most popular colors and assign them to low densities due to the game's hard-coded limit for the number of PlaceZones we can run.

     

    Please do post a pic when you get it to work, or let me know if you have any other questions. *:)

    • Like 1

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    Share this post


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

    Thanks Cori

    ... aaaargh! it's => [ File: ] !!!
    That's what I was missing at the beginning of the line! I didn't understand it with the translation .. and so I skipped it .. pfffu no brains the guy. :boggle:
    That's good for me. Too easy! (show-off!) *:8)
    In any case you have a demo, above will perhaps be useful to other airheads like me !!

    And .. what is that? a street tile !!??!!! 66c362ed30228_Capturedcran2024-08-19171729.png.959711b34cacb2cf927e2c5d466e5579.png

     

    Well, I prepared the two DAT files for an update of Scoty-Zoning-Mod .. ready for any desired adjustment .. later.

    So if I understand, this is only temporary - during a city creation - the time to place networks, then delete the ZoneManager-spécial-Img2Zones files, to return to the basic ZoneManager - or modified by my plugin ;-) !?

    • Like 1
    • Thanks 1

    What is good when you have nothing to say is that you can always pretend to listen. Anyway it does not prevent to think!

    >> My little plugins contribution << -- >> Depot | Fabrik | Testing <<

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
    Currently: Viewing Forums Index
     
    7 hours ago, hugues aroux said:

    And .. what is that? a street tile !!??!!!

    Yep. That seems to be a built-in Maxis test thinger and another bug we'll need to describe for peeps using the PlaceZones commands. :uhm:

    Here are a couple pics while we were testing last night. (I've deliberately changed from Cori Pink to a duller blue so the image doesn't burn out your eyes.)

    imgW10-2675.jpg

    imgW10-2677.jpg

     

    These get auto-placed when there are zones nearby. >.< And nothing we mere mortals can do about it. So the quantity of zoned cells limit (via the Place Zone command) and these mysterious self-appearing street stubs are also going to be limitations to the program.

     

    7 hours ago, hugues aroux said:

    So if I understand, this is only temporary - during a city creation - the time to place networks, then delete the ZoneManager-spécial-Img2Zones files, to return to the basic ZoneManager - or modified by my plugin ;-) !?

    Yes. That is the basis of @Francis90b's idea. The zones are laid out to be an indication of where they will later create roads and FARRs and highways and whatever they are planning.

    We took their original idea a bit further by making 9 colors available and assigning them to the 9 usable zones. The extreme changes to the in-game zones colors and the middle gray zones textures was my idea so that they would be bold enough to show at the region level with the idea that would make placement easier to see. The latter requires my tweaks to two region view exemplars which I'll release as well. I just need to re-analyze them cause I made changes which NAM's RHW might not like and when we learned that, we simply abandoned any idea of releasing it way long ago. (We just used the updates ourselves.)

    Now, nothing about the Image2zones.exe requires any changes to any exemplars. Those are only if peeps want the apparent network paths to become brightly colored, distinctly different, and solid.

    Edit: First introduction of our Region Transport View as a Before and After Post.

    • Like 1
    • Thanks 1

    Chance favors the prepared mind. ― Louis Pasteur  
    Remember, a few hours of trial and error can save you several minutes of looking at the README. -- I Am Devloper (on Twitter)

    Clickable ---> The Best of Cori's Posts  (scroll down a wee bit there)    Something fun: MySimtropolis - Invitation to become a SimCity 4 MySim

    Are you new here? Check out the Introduction and Guide to Simtropolis.

    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