Investycoon Core SDK
Modular SDK to create custom plugins in the Investycoon ecosystem.
nuget install InvestycoonCore -Source "GitLab"Overview
InvestycoonCore lets you customize company types, items and their specifications, and technologies. The package requires .NET 10 with no additional NuGet dependencies.
- Custom company types
- Custom items and specifications
- Extensible technologies
Installation
To get started, create a .NET solution and reference InvestycoonCore via NuGet:
nuget install InvestycoonCore -Source "GitLab"
Or download the .nupkg file from the official registry.
Minimal Plugin class example:
public class CustomPlugin : Plugin
{
public override string Code => "custom-plugin";
public override string Version => "1.0";
public override string Name => "Custom Plugin";
public override string Explanation => "This is a custom plugin";
public override ResourceManager MainResourceManager => new CustomResourceManager();
}
The class exposes the Code, Version, Name, Explanation and MainResourceManager properties to customise.
Member reference
The abstract Plugin class exposes the following members. Code, Name, Version, Explanation and MainResourceManager are required. The others are optional and return false or an empty list by default.
| Member | Type | Description |
|---|---|---|
Code |
string |
Unique plugin identifier, used internally. |
Name |
string |
Name displayed in the admin interface. |
Version |
string |
Plugin version, shown in InvestycoonSky. |
Explanation |
string |
Description shown to administrators. |
MainResourceManager |
ResourceManager |
Resource manager for label localisation. |
ItemIgnoreVanilla |
bool |
If true, vanilla game items are removed. Default: false. |
CompanyTypeIgnoreVanilla |
bool |
If true, vanilla company types are removed. Default: false. |
Items() |
List<Item> |
Returns the list of items provided by the plugin. |
CompanyTypes() |
List<CompanyType> |
Returns the list of company types. |
ItemSpecificationTypes() |
List<ItemSpecificationType> |
Returns the list of specification types (quality, etc.). |
Full plugin example:
public sealed class MyPlugin : Plugin
{
public override string Code => "my-plugin";
public override string Version => "1.0";
public override string Name => "My Plugin";
public override string Explanation => "Plugin description.";
public override ResourceManager MainResourceManager
=> Resources.Resources.ResourceManager;
public override bool ItemIgnoreVanilla => true;
public override bool CompanyTypeIgnoreVanilla => true;
public override List<Item> Items() =>
[
new ItemResource(1, "lithium", 20_00).SetMass(25f).SetItemGroup("resource"),
new Item(2, "battery", 2, 10_00).SetMass(0.1f).SetItemGroup("refined"),
];
public override List<CompanyType> CompanyTypes() =>
[
new(1, "tech-company",
nameof(Resources.Resources.TechCompany_Label),
nameof(Resources.Resources.TechCompany_Label))
];
public override List<ItemSpecificationType> ItemSpecificationTypes() =>
[
new(1, "quality", ItemSpecificationTypeEnum.Quality, [10])
];
}
Item types
Choose the type that matches the nature of your item:
Item
Base product: component, manufactured good. Accepts a tier (1–5) that influences rarity and game progressions.
new Item(id: 1, name: "battery", tier: 2, defaultPrice: 10_00)
.SetMass(0.1f)
.SetVolume(0.0001f)
.SetItemGroup("refined");ItemResource
Natural extractable resource. Automatically sets tier=1, IsDivisible=true and IsStackable=true. The optional SetRarity() and SetWorldGeneration() methods configure rarity and map generation.
new ItemResource(id: 1, name: "lithium", price: 20_00)
.SetMass(25f)
.SetRarity(ItemRarity.GetByName("ordinary")!);ItemFuel
Consumable energy source. Set its capacity with SetEnergy().
new ItemFuel(id: 1, code: "atomic-battery", price: 300_00)
.SetEnergy(1_000)
.SetMass(1f);ItemNonPhysical
Digital or intangible item (software, data). No mass or volume.
new ItemNonPhysical(id: 1, code: "program", price: 0);MachineTransformer
Production machine with input/output recipes. Add recipes with AddRecipe().
new MachineTransformer(id: 1, code: "factory", price: 10_000_00)
.SetNbInput(2)
.SetNbOutput(1)
.SetDelayBuild(TimeSpan.FromHours(1))
.SetMaxWorkers(3)
.AddRecipe(new MachineRecipeFuel(
"my-recipe", "company-type-code",
inputCapacity: 64, outputCapacity: 12,
inputs: [new RecipeProduct("lithium", 2)],
outputs: [new RecipeProduct("battery", 10)]
));Localisation
In-game labels (item names, company types, recipes) are translated via .resx files. Create Resources/Resources.resx (English default) and Resources/Resources.fr.resx (French).
Configure your .csproj to generate the static accessor class:
<ItemGroup>
<EmbeddedResource Update="Resources\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
Then reference the ResourceManager in your plugin:
public override ResourceManager MainResourceManager => Resources.Resources.ResourceManager;
Deploying the plugin in InvestycoonSky
Once your plugin is compiled, the server administrator handles the import and activation from InvestycoonSky. You don't need to manage any infrastructure.
1. Build your plugin in Release configuration and send the .dll file to the server administrator:
dotnet publish -c Release
2. The administrator imports the .dll via InvestycoonSky and can enable or disable the plugin at any time without restarting the server.
The plugin appears in InvestycoonSky with its name, code and version as soon as it is imported. Activation and deactivation are managed entirely from the admin interface.
Illustrations
Each item and company type can be associated with a PNG image embedded directly in the plugin assembly.
Place images in the following folders inside your plugin project:
Resources/
└── Images/
├── Items/
│ ├── lithium.png
│ └── battery.png
└── CompanyTypes/
└── tech-company.png
Declare them as embedded resources in your .csproj:
<ItemGroup>
<EmbeddedResource Include="Resources\Images\**\*" />
</ItemGroup>
The filename must match the item or company type's Name property exactly (case-sensitive). On startup, AssertValidItem() throws a ResourceCompilingException if the image is missing.
License
Distributed under the LGPL v3+ license.
Credits
Developed by Alan Bretelle.