How to set up Unity with Visual Studio 2022?

I have made my game entirely in Unity Editor and VS Code so far, and I have separated the model logic from the presentation in different assemblies, asmdef Unity style.

Now I want to create a .NET Winforms game editor, I changed the preferences to open scripts in VS2022 (external editor), and created the .NET 9.0 Winforms project. In the Winforms project, I can add references to the model dll, but when I build, those Unity projects do not compile into dlls for the Winforms project to consume.

What do I have to do to allow me to build/compile Unity asmdef dlls for .NET Winforms to consume?

You don’t mix the Unity files and the Winforms project in the same solution.

Instead you should create a own “game editor” solution, outside of the whole Unity project folder and in this solution you shouldn’t add anything from the Unity project directly. You must build the Unity project, which will create the dlls and then you reference only the dll(s) in your game editor solution (not the cs files). You will most likely also have to add dll references from Unity itself to your game editor project, depending on what kind of classes you use. They can be found in the install directory of your Unity version.

Btw make sure that your Unity project builds the dlls with .NET standard setting and not the old .NET 4.6, otherwise it could cause problems if you want to reference the dlls in a .NET 9 project

Thank you! It works as you described.

What kind of editing does this tool need to do?

You could possibly save yourself a ton of time by using one of the store assets for editing game data, or by using a data file importer - be it json, xml, ini, csv, etc. - and editing the data in structured editors that exist for these formats.

CSV’s “structured editor” would be a Spreadsheet. :wink:
That works great for structured game data that has database-like qualities but you don’t want to deal with an actual database. Not recommendable for editing large amounts of text however.

I want to create a map and quest editor for my game, and be able to ship this for end-users to make their own maps. Is there a solution out there?

Depends on the kind of map primarily. If it’s a tilemap, then Tiled would be a good editor. I think it would also allow you to encode custom data, but probably not too elaborate.

If it’s a 3d world perhaps lean into Blender? There’s plenty more 3d editing tools. Even Unity itself might be an option.

This depends on many things, but some random general thoughts:
I think some people are too “afraid” to mod, no matter how easy or user friendly the mod tools are and the people who like to mod are not “afraid” to use external/existing tools, so it can be okay to require other tools for your mod support.

There is a existing tool for 2d tile maps, I don’t remember the name, maybe someone else does? It also supports exporting to different format like json, so you can read mod file in your game.

I don’t know your quest design or format, but for “text” based stuff, which I store in json. I usually just forward to existing editors like VS Code and provide a custom schema file for my data, which makes editing the json very easy with auto completion hints and error checking.

I think the best help for the mod is not to make creating mods as easy as possible (because they will figure it out with a little playing around) but to make the mod loader error checking as good as possible to provide useful hints if they made a mistake in their mod file and not just ignore it silently or just a generic message like “invalid mod file” without any details.