Skip to content

Developing and Setting Up IDEs

Quintillus edited this page Apr 4, 2022 · 31 revisions

Although C7 uses Godot, an estimated 90% of the development is in C#, either using Godot libraries through code, or writing non-Godot-related code such as loading files or AI code. Thus, having a good C# development environment set up is essential.

The team has tried out three different IDE setups, each of which have their advantages and disadvantages. This post is being expanded to explain how to get started with each, and why you might choose one or another.

The tl;dr of the below is that if you have a Rider license, it is recommended as the best all-around IDE. If you don't, Visual Studio 2019 offers debugging support; VS Code has a subjectively better interface and is slightly easier to set up.

Required Items, Regardless of IDE

First, you'll probably need to install the .NET SDK. Version 6.0 should work. We're still collating data on the exact requirements, and 5.0 probably works too, but that one is working for several of us.

Then you'll will need to download the Godot IDE, which is available here. Be sure to download the Mono version (C# support). Either 64-bit or 32-bit will work, and contrary to Godot's website, the 32-bit version does work on 64-bit Windows.

Technically you can do all your work in the Godot IDE, but its C# editing and refactoring capabilities are poor, so it's recommended that you choose a more full-fledged C# IDE as well. You will use the Godot IDE for tasks such as wiring up Godot events on the front end and updating Godot themes, but that is an estimated 10% of the work.

C# IDEs

Visual Studio Code

Once VSCode is installed, open the "Prototype" folder to which you downloaded this repository.

Next, you'll need to install a few plugins from the marketplace:

  1. C# for Visual Studio Code. This gives you syntax highlighting, IntelliSense, Find References, and other nice IDE-like features for C#.
  2. C# Tools for Godot. This gives you the ability to launch C7 from VS Code, and lets you debug it.

It should be possible to follow this guide to set up debugging, but we've had mixed experiences with that, so we're still figuring out exactly what the steps are.

Visual Studio 2019 Community Edition

It's important that you use Visual Studio 2019, as you cannot run/debug Godot from Visual Studio 2022 yet, and 2019 was the first version to be supported. The lack of 2022 support is due to changes made in Visual Studio, and Godot hopes to eventually support it, but for now 2019 is your friend.

TODO: CFC Post to be Migrated

You'll also want to set up Visual Studio's whitespace configuration, specifically using tabs for indentation. This can be done via Tools -> Options, with this setting:

image

It may also be useful to turn on the "View Whitespace" option:

image

JetBrains Rider

Rider is arguably the best IDE for developing with C# and Godot. It has strong C# support, including refactoring, and supports debugging Godot projects with very little manual setup. Rider (and other JetBrains products) also have, IMO, the best Git merge resolution tool in the industry.

If you want to debug with Rider, you'll also need to install DotTrace, which is JetBrains' C# profiler/debugger.

The downside is that Rider and DotTrace are commercial products, and if you are just trying out C7, it's probably not worth the cost. But there is a 30-day free trial for both Rider and DotTrace, which is enough time to try out Rider and C7 development. You can download Rider here.

Once you have Rider and DotTrace installed, open C7.sln, which lives in the C7 folder of the Prototype repository.

Then, set your Run/Debug configurations to be equivalent to the following, making sure the paths are correct locally. These will likely default to the correct values:

image

You can optionally rename the "Player" configuration, but it is the one you will want to launch. You should now be able to debug C7 from Rider.

For additional discussion of Rider, please see thread about it at CFC.

Clone this wiki locally