Hello there,
today I would like to explain how our mineral source distribution and extraction system works.
There will be many different types of resources like organics, minerals, components and gases, and each will require to be obtained differently.
Primary resource type are minerals, which can be harvested all around the world using Mineral Extractor. Mineral Extractor is a deployable machine that harvests resources around it. This process takes some time and attracts hostile fauna, which means the player has to defend it.
To gather minerals effectively you need to find a correct spot that contains the mineral type and grade you require. For this the Mineral Scanner comes in.
This is a basic introduction to the mineral mining mechanic, but now let’s take a look how we spawn resources around the map. The process is super simple, but it works.
Mineral Source Distribution
1) Setup
- first we tell the Mineral Source Generator how many mineral nodes we want
- then we set what rarity types we want to be generated in this area, they are: common, frequent, uncommon, scarce, rare and very rare, there’s also a last rarity called mythical but this one is either super rare or spawns only in specific location and is usually not used in the crafting process
2) Spawning Nodes
- the Mineral Source Generator now generates the set amount of nodes on random X and Z coordinates
- after obtaining the X and Z coordinates, we sample the terrain height at the current position and get the Y value - mineral source is always spawned on the surface of the terrain, but not visible without the scanner
- it also generates the mineral rarity based on rarity percentage and assigns one of the mineral types this rarity level uses
3) Node Size
- last step is to determine the mineral grade and amount of resources (node hitpoints) in it
4) Regeneration
- by mining the specific node, you subtract it’s material amounth, when this value reaches zero, the node is destroyed and regenerated elsewhere with completely different properties
Mining
Scanning for these mineral nodes and mining them is a bit more complex.
Mineral Extractor detects nodes in range, then calculates percentages based on their distance.
When the extraction process is complete and the Extractor’s cargo size is 1000 units for example, the mineral unit count will be 571x Vindium ore, 286x Iron ore, 143x Copper ore.
These values are subtracted from the mineral node.
When there’s an Extractor operational, the nodes it harvests from are locked and cannot be harvested using another Extractor until the first one finishes the process or is destroyed.
Resources are currently not being shared with nearby players and are added only to the Extractor owner’s inventory. Unlike backpack, the resource inventory is infinite.
Resources are stored in the database in the following format:
"resources": [
{
"resourceId": 0,
"amount": 622,
"quality": "D"
},
{
"resourceId": 1,
"amount": 595,
"quality": "B"
},
{
"resourceId": 0,
"amount": 397,
"quality": "C"
},
{
"resourceId": 1,
"amount": 615,
"quality": "E"
},
{
"resourceId": 1,
"amount": 250,
"quality": "D"
},
{
"resourceId": 1,
"amount": 500,
"quality": "A"
}
]
This will be obtainable using API calls to our public endpoints.
Thanks for reading and if you have more questions, feel free to ask down below.