Jump to content
Null 45

Regional Supply/Demand DLL

8 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

Adds a basic supply/demand system in the form of a region-wide resource pool.

This mod differs from the BSC Daeley Regional Tracking Mod in that it works independently of the city names. It also lacks the region-wide building tracking features of that mod.

The 'resources' consist of a Uint32 resource id and a Sint64 quantity. The resource ids should be random to prevent conflicts between different mods that use this DLL as a dependency. Naming the resources is left up to the mod authors that use this DLL as a dependency.

Download: https://community.simtropolis.com/files/file/36832-regional-supplydemand-dll/

Building Exemplar Properties

The DLL adds two new building exemplar properties that allow resources to be added or removed by plopping a building. Both values use paired Uint32 items, consisting of a resource id and a quantity.

Property Name                         Property ID     Description
Regional Supply Consumed 0x16F4C223 The resources the building consumes from the regional supply.
Regional Supply Produced 0x16F4C224 The resources the building adds to the regional supply.

Lua Functions

The DLL provides a regional_supply table with the following functions for use by Lua code.

Function Name                Description
add_to_demand Adds to the existing demand for a resource.
remove_from_demand Subtracts from the existing demand of a resource.
add_to_supply Adds to the existing supply of a resource.
remove_from_supply Subtracts from the existing supply of a resource.
get_resource_quantity Gets the current quantity of a resource.
 
System Requirements
  • Windows 10 or later

The plugin may work on Windows 7 or later with the Microsoft Visual C++ 2022 x86 Redistribute installed, but I do not have the ability to test that.

Installation

  1. Close SimCity 4.
  2. Copy SC4RegionalSupplyDemand.dll and RegionalSupplyDemand.dat into the top-level of the Plugins folder in the SimCity 4 installation directory or Documents/SimCity 4 directory.
  3. Start SimCity 4.

Troubleshooting

The plugin should write a SC4RegionalSupplyDemand.log file in the same folder as the plugin.
The log contains status information for the most recent run of the plugin.

Source Code and Support

The plugin's source code and issue tracker are located on GitHub: https://github.com/0xC0000054/sc4-regional-supply-demand

  If you would like to make voluntary contributions to support me in continuing to create more content for SimCity 4, I accept donations via PayPal: https://paypal.me/0xC0000054
 

Thanks to the few people who have donated to me.

  • Like 3

Share this post


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

This looks really cool.  Some questions: the 2 new building exemplars relate to supply.  Would there be any reason for a building to show what kind of resource it demands?  Or is this DLL really just to implement lots that generate resources?  

Also, can multiple resources be created?  If so, then if there are 2 or more resources, will those exemplars be able to show supply (or demand) for each of those resources separately somehow?

What if each industrial lot is edited to produce a specific resource?  What are the practical limits of this mod?  Can there be dozens of resources?  Or it it more limited for use with things like power, water, garbage, etc?

  • Like 2

Share this post


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

This looks really cool.  Some questions: the 2 new building exemplars relate to supply.  Would there be any reason for a building to show what kind of resource it demands?  Or is this DLL really just to implement lots that generate resources?  

Also, can multiple resources be created?  If so, then if there are 2 or more resources, will those exemplars be able to show supply (or demand) for each of those resources separately somehow?

What if each industrial lot is edited to produce a specific resource?  What are the practical limits of this mod?  Can there be dozens of resources?  Or it it more limited for use with things like power, water, garbage, etc?

From what I see the DLL mod implements the resource logic in the game engine but still requires LUA Code and New_Properties.xml for things to work. Which allows us to create more resources that can be managed by buildings.

This mod has huge potential and overcome any limit but the limit is set by how we want to make complex production chains that then have to be written to LUA and New_Properties.xml

 

  • Like 3

Federal Republic of SiculiaFederal Republic of Sonora

   Ain Member  Wiki

NAM Team - Co-developer of Pedestian Revolution Mod - Railway Department (Hybrid Railway | HRW Expert) - MTA Member - BAT Creator

Ulisse Wolf YouTube Channel - Ulisse Wolf Mastodon Profile

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     
    On 4/19/2025 at 10:52 AM, Kel9509 said:

    Would there be any reason for a building to show what kind of resource it demands?

    Not yet. As I mentioned in the first post, all the DLL does is allow 'resources' to be tracked at a region level. The resources don't have names, they are just a random id and associated quantity. The intended use case was plopped buildings with some reward conditioned based on the available supply of specific resource ids.

    On 4/19/2025 at 10:52 AM, Kel9509 said:

    Also, can multiple resources be created?

    Yes.

    On 4/19/2025 at 10:52 AM, Kel9509 said:

    What are the practical limits of this mod?

    I have no idea. This mod is independent of the Maxis region system, but having hundreds or thousands of resources would eat up a lot of memory.

    • Like 2

    Share this post


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

    Is this DLL mod  similar to the industrial DLC for 《Cities: Skylines》?

    Share this post


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

    Is this DLL mod  similar to the industrial DLC for 《Cities: Skylines》?

     It could potentially be used to implement some kind of industrial reward chain, but there is no direct interaction with the RCI system.

    Share this post


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

    Circling back to this - has New_Properties.xml been updated to implement the new building exemplar properties?

    Share this post


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

    Circling back to this - has New_Properties.xml been updated to implement the new building exemplar properties?

    It doesn't look like it, but I may have missed the ids when I searched for them.

    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