Click here to read the previous dev blog (#10): Factories and Power in TownyBuildings
Welcome to the 11th experimental plugin development blog, where I discuss a suite of plugins being developed for a new gamemode provisionally called "CampaignWar". In this edition, we will explore how resources work in this gamemode - particularly in the context of TownyBuildings and province attributes.
Resources
Before we talk about how resources are distributed, let us recall how provinces work. The map is divided into provinces, and only one town can settle in each. Every province has attributes associated with it, which can affect various aspects of gameplay such as mining and crop yields. This includes a permanent resource attribute which determines the province's "speciality" resource. Along with the vanilla resources (such as coal and iron), these can also be:
- Zinc
- Tin
- Sulfur
- Saltpeter
- Lead
- Nickel
- Crude Oil
The custom ores associated with each resource: tin, nickel, lead, zinc, saltpeter and sulfur. These are provisional textures that are being redesigned.
Let's look at the resource attribute of my town's province:
This attribute means I will be able to find Nickel Ore while mining inside the province. Additionally, it means I am guaranteed to find at least one Nickel Deposit inside my town through surveying.
Surveying
Each resource has an associated TownyBuildings mine - for example, the Nickel Mine for nickel. These buildings produce the resource every day. However, in order to build one of these, our town will need a Nickel Deposit inside its borders. To do this, we need to survey one of our claims.
Because our province has the Nickel Deposits attribute, our first resource is guaranteed to be a Nickel Deposit.
After completing the survey, it turns out that our Nickel Deposit is only Size 2 - which means we can only upgrade our Nickel Mine building to Level 2. Whilst that is disappointing, we will have another chance to complete another survey after our town upgrades to the next tier (e.g. Village -> Town). We won't be guaranteed another Nickel Deposit in the next survey, but our province attribute means we'll still have a higher chance than normal.
Resource Distribution
In general, the discovery chance of a resource is determined by:
- the biome in the chunk,
- the province attribute
In theory, we can discover any resource from anywhere. However, some biome groups have a much higher chance of finding specific resources than others.
Values subject to change.
The attribute that a province rolls also depends on the biomes inside it. For example, if it is half arid and half tropical, it will have a decent chance of rolling either saltpeter or sulfur as its speciality resource.
The Bigger Picture
Why does this matter? All combat-related items need these resources, and most will need multiple of these. For example, many ammunition items need brass (copper + zinc). Cordite, another ingredient for some ammunition, is crafted from sulfur-derived items. Gunpowder is crafted from saltpeter. Although there are a few ways to obtain sulfur and saltpeter outside of their provinces, these are not as efficient. This means that it is important to control their provinces or trade with those who do.
Building Logistics
In the previous blog, I introduced factories in TownyBuildings - our alternative to Slimefun. To recap, each factory has "processing slots"; each processing slot is essentially a separate machine.
The supply chain involves multiple factory buildings. For example, cordite is crafted in a Chemical Plant and is then used by the Ammunition Plant to craft ammo for guns. But how do we move it between the two buildings? We could do it manually, but the minecart logistics system can speed things up for us.
Chest minecarts can extract items from a specific processing slot within a building and deposit them into a specific processing slot inside another building. However, it is not limited to building logistics - they can also move items between chests. I think this, alongside the copper golem being added in 1.21.8, will allow for some interesting supply and sorting systems.
Conclusion
Note that this under development and everything shown is subject to change - especially the minecart logistics system, as we don't know how it will perform with a large number of players online, but also the distribution of resources between biomes. As always, let me know if you have any comments, suggestions or concerns in the replies.
Last edited: 1 day ago x 5