Skip to content

Research ​

Register a tree to add prerequisites, item costs, and part unlocks. SSLib handles the layout.

Extend the tutorial's tree ​

Replace its existing RegisterResearchTree call:

csharp
content.RegisterResearchTree(new ResearchTreeDefinition
{
    Id = "technology",
    Nodes = new[]
    {
        new ResearchNodeDefinition { Id = "basics", Name = "First Mod Basics" },
        new ResearchNodeDefinition
        {
            Id = "controllers",
            Name = "Controller Technology",
            Prerequisites = new[] { ResearchRef.Mod(content.Key("basics")) },
            Costs = new[]
            {
                new ItemCost
                {
                    Item = ItemRef.Native(Items.Model.ItemsConstants.IronItemId),
                    Quantity = 1
                }
            },
            UnlockedParts = new[] { PartRef.Mod(content.Key("controller")) }
        }
    }
});

Unlock First Mod Basics, then spend one iron on Controller Technology to unlock the controller.

References and IDs ​

TargetReference
This mod's nodeResearchRef.Mod(content.Key("basics"))
Another mod's nodeResearchRef.Mod("other.mod:basics")
Native researchResearchRef.Native(actualResearchId)

Node IDs are unique across all trees in your mod. basics is example.firstmod:basics, regardless of the tree name.

Empty prerequisites create a root; empty costs make it free. Missing references and cycles fail world loading. Cross-mod references require that mod to be installed.

Property defaults are in Research definitions.

StellarStriderLib documentation · Mods for StellarDrive