Tech Trees - game-stuff-official/exampledustry GitHub Wiki

[!Warning] Page under construction

The tech Tree is an integral part of any Mindustry mod. If you had strong turrets immediately then the game becomes too easy and is not fun anymore. Plus, the added sense of progression and gradual discovery keeps the player interested and engaged.

Root

The root of a tech tree is the very first node. You begin with it unlocked and all other nodes connect to it in some way. In Mindustry and in most AEMs(Alternate Environment Mods) the root is the first stage of the core. On Serpulo it is Shard and on Erikeir its Bastion.

To set something to be the root of your tech tree you use the research: property.

name: Ormalute

research: {
  root: true
}

Screenshot 2024-12-07 4 52 51 PM

Ormalute's source code

[!Note] You may notice that your core's icon is missing its team color in the UI. To fix this add a [name]-full sprite.

Adding Nodes to the tech tree.

Adding nodes to the tech tree is easy.

Simply add the parent node to the parent: property of the research: object.

name: Lead Conveyor

research: {
  parent: core-ormalute
}

Any items in requirements: will need to be researched as well.

Screenshot 2024-12-07 4 45 15 PM

Lead Conveyor's source code

Objectives

Objectives are like secondary parent: nodes, except they are not connected.

Use the objectives: array to add objectives.

name: Harcite Wall

research:{
  parent: lead-wall
  objectives: [
    geode-cracker
  ]
}

Only uncompleted objectives will appear in the tech-tree.

Harcite Wall's source code

Non Unlockables

Some content such as core units shouldn't have to be unlocked in the tech tree. They should be unlocked with the core. Core units also don't show in the tech tree.

To make a content that is always unlocked use the alwaysUnlocked: property. Don't add a research: property if you do not want your content to appear in the tech tree.

name: Vdulk
alwaysUnlocked: true

Vdulk's Source Code

Research Costs

The default research cost for modded content is always rounded to the nearest 100.

The function for calculating research costs looks like this at the time of writing.

int quantity = Mathf.round(60 * researchCostMultiplier + Mathf.pow(requirements[i].amount, 1.11f) * 20 * researchCostMultiplier * researchCostMultipliers.get(requirements[i].item, 1f), 10);

Use researchCostMultiplier to multiply the cost of researching.