Getting Started with Eco Modding in Visual Studio
Introduction
This guide covers how you could use Visual Studio 2022 as the development environment for your Eco mods — from creating your project to building, testing, and releasing a mod.
This guide won’t teach you how to code or write a mod, but it will help you get everything set up so you’re ready to start learning. There will be helpful resources for learning listed at the bottom of this guide.
Have Ready
- A copy of the Eco game installed
- A file explorer and the file-path to
Ecofolder- At the time of writing, within this folder there's folders like
D3D12andEco_Data. Also, you'll find theEco.exefile here. There are other files and folder here too, but this list is just to help you know what the folder looks like.
- At the time of writing, within this folder there's folders like
Note: Find Folder with Steam
Steam users can find the install folder by right-clicking on the game in your Steam Library:
Installing Visual Studio 2022
Visual Studio 2022 (VS2022) has a completely free to use version called the Community Edition. This guide is written assuming that's the version used.
Go to https://visualstudio.microsoft.com/downloads/#visual-studio-community-2022 and look for the "Visual Studio Community 2022" download. At the time of writing, the download button looked like:
Start the download by clicking on the Download button.
Then, run the installer till this the installer gets to the Workloads page. On this page, select these workloads:
- .NET desktop development -- Required for any mod development
- ASP.NET and web development -- Optional. If you want to interact with external websites or Eco's own web server (e.g. Discord's web-hooks or extending the API)
Note: Using the Workflow installation page is easy, but will install a few extra things (e.g. GitHub Copilot). If you want to keep the tooling minimal you can just install .NET from dotnet.microsoft.com/en-us/download. At the time of writing, Eco supports .NET version 8.0. See the later section .NET Version of this guide to learn how to check if that has changed.
At the time of writing, this is what the Workloads page looks like with those options selected:
Click the Install button. It will take a few minutes to complete installation. By default, it should launch VS2022 after it installs.
It will ask you to sign in. You do not need to and can completely avoid this by clicking the Skip and add accounts later option in tiny text below the buttons.
If you plan to upload your mod to Github, VS2022 does have integrated support for GitHub. So consider signing in with GitHub to make that process easier.
This guide is continuing as if the Skip and add accounts later option was selected. Finally, it might ask what color theme you'd like. Select your preference and continue.
Installation Complete!
The Mod
With Eco and VS2022 are installed all of the tools needed to code, build, and run a mod are ready!
Creating a New Project
When VS2022 first opens it will show you a dashboard where you can quickly select what you want to do. On the left, are any recent projects opened. There won't be any if this is the first time installing it.
On the right there will be a few options, from here select the Create a new project option.
Now, it's time to go through the new project wizard. First, the wizard asks what kind of project is being made.
To mod Eco we need to make a C# Class Library.
To find the template, search C# library in the search bar. Select the C# option titled Class Library.
It's important to pay attention to the icon and chips below the title and description. Make sure you select the C# option as there are other options similarly named Class Library.
The next page will ask you what the Project Name should be. Type the name of the mod being created.
The other options like the Location and the Solution Name do not need edited.
Leave the box Place solution and project in the same directory unchecked.
Click the Next button and continue along in the next section of this guide.
.NET Version
At the time of writing, Eco targets .NET 8.0 and the mod should too.
It's suggested to confirm the version of .NET that Eco uses by looking at the .NET version the reference assemblies use.
The reference assemblies can be found on the NuGet Gallery by searching for Eco.ReferenceAssemblies. See: www.nuget.org/packages?q=Eco.ReferenceAssemblies
Find the package with the name Eco.ReferenceAssemblies made by StrangeLoopGames.
There will be a chip underneath of it with the .NET version it targets. At the time of writing, this is what that page looked like:
By clicking on that search result (shown above), a more detailed page opens is show. Again, there's chips showing what version of .NET to use:
Back to VS2022
On the Additional Information page, there's the Framework drop-down. Select the same version of .NET Eco uses (as described above).
Click the Create button to finish creating the mod!
Linking to Eco Assemblies
Look for the Solution Explorer on the right-hand side of VS2022. It should look something like this:
Note: If the solution explorer isn't there, open it from the top menu. Click the View button and select Solution Explorer from the menu.
From the Solution Explorer, find the References line and right-click on it. On that menu select Manage NuGet packages...
This will open a new tab. Above the search bar there's sub-tabs. Select the Browse sub-tab.
Type Eco.ReferenceAssemblies into the search bar.
Check the Include prerelease check-box.
Find the option with the name Eco.ReferenceAssemblies made by StrangeLoopGames. Click on it.
A details panel will show up to the right. It will show the version of the reference assemblies being targeted. By default it chooses the latest and can be left at it's default.
Click the Install button.
Click the Apply button on the popup to finish adding the references.
The reference assemblies have now been added! When coding VS2022 will provide IntelliSense popups. Try it out by going back to the Class1.cs file and typing Eco. and you will see suggestion pop up. It’s an essential tool for a lot of modders.
Building The DLL
To build the mod into a Dynamic Linked Library
Setting up Debugging
Releasing a Mod
Mod.io
Eco Forms
Where to Next?
- Where to learn modding logic (Eco Modding Wiki, Discord, sample mods)
- Consider source control (Git)
- Explore Eco’s open-source mod projects for ideas