Basic layout / architecture / design for a game with editor

Hi, I am thinking about rewriting a relatively small game which is finished and I would like to improve it by including an Editor.
I would like to have the possibility to switch between editor and the game (test level in current state).
The editor should be there to help create new levels and help with testing / setting up lighting and place objects / transform objects.
The questions is what is the best practice or architecture / design which I could use for that? Where should I start?

The game is this one here for which I have only a short video at the moment showing some gameplay

For me I have a scene manager, so this would just be another scene in the game.

My basic scene manager is one of my nuget packages :wink:

Ok so I would then change from the ingame scene to the editor scene? And the editor scene loads the level and presents it?

So, from the main menu I would have a play option, from there you can select a level. Another option would be level editor, each would be a separate scene.

ok I will try to add a very basic editor scene to check if this works out in my old project.

The code is probably very “unoptimized” so I will see what I can do. I remember copying the game logic class between two seperate projects, one being the game and the other one my “editor” which actually was a 2D drawing game. But it worked well enough for that small game. Of course I would not do that like this again.

1 Like

I checked yesterday for the noise nuget and vs threw an error message about I should change the target framework of my project iirc.
I tried consuming (would this be the right terminology?) the nuget from a project which is targetting dotnet standard 2.0. I did not check further at this point. I guess it should work if I do as vs suggested (changing the projects target framework).

The nuget was targeting dotnet core 3.1 iirc.

What project type?

Class Library, here are some screenshots of the project layout

My packages are Core 3.1 using MonoGame.Framework.Portable. I did that as monogame is core now. Maybe I should make them .net standard.

Be nice if/when MG comes up to .net 6 :slight_smile:

I should educate myself a bit about those terms to be able to figure out what is happening I guess. Any good resources on a high level view about the terms “dotnet standard”, “dotnet core” and versions and compatibility etc.?

In the meantime I think the workaround here is installing the nuget to each project seperately. To be able to install it to the class library would allow to use it everywhere I guess? That would be nice. Afaik class libraries can only target dotnet and dotnet standard so I can’t change the target of this particular project to make it compatible from my side, right?

Let me now when documentation about the nuget is available or if there is a demo project showing how to use it to produce some pretty galaxies :grinning:

Ok, so my understanding is this. .net standard is like a bridge between .net framework (4.x) and .net core, but this breaks down after core 3.1, so won’t wirk for .net core 5.x and .net 6, so aa far as I can see not the best choice going forward.

I’ll do a test with a standard lib and my packages, see if I can get them working as you want to use them.

I’ll do a short tut on the noise today and let you know when it’s up. I’ll put it in the repo. I need to write unit tests too lol

1 Like

Gah, looks like Ill have to create “standard versions” of the lib in order to be able for that project type to use it.

I’ll start that now, I’ll let you know when a .Net Standard version is up there for the noise.

Interesting you are creating a Galaxy too :smiley:

1 Like

Just updated noise to .net standard versino, might not be listed yet, but should be in the next 10 minutes I hope :slight_smile:

1 Like

Actually I just quickly created a multi platform solution using my kickstarter bash script and so that I can remember better I chose the name Galaxy because I thought noise would have some kind of ootb Galaxy noise methods in there. I just wanted to have a look at it and just check it out. I have an older project where I played with the solar system (without the sun because I used correct scales for moon, earth and distances). And I think the skybox could be replaced maybe with some galaxies.

1 Like

Ah, k, well that is just a noise lib, it will just generate perlin noise for you, what you do with that is up to you :slight_smile:

I’ll try and get a sample up for it tonight.

1 Like is not right, pushing another now lol sorry, I was in a rush earlier :stuck_out_tongue:

OK, updated them all to be .Net Standard now, and I have just done a quick sample for the Noise pacakge too :slight_smile:

An issues, let me know :slight_smile:

1 Like

very nice! thank you, I will try to find some time to check it out. I only had a little time to checkout the galaxy topic which you are working on but if I got it right, the galaxies are 3D textures or they are at some point in the generation process?
Maybe I could try to place aome billboards into the solar system project haha
First I would have to refresh my skills and knowledge about the project a bit, it is or was a test of an entity component system some years ago. So given that it will be like reading code from somebody else probably.

Also, if you want to get at the sample code, it’s here

They were 3D textures, but I found that quite limiting. The render is now using instances billboards :slight_smile:

I could still store the galaxy in a 3D texture, but it woukd be limited to 512x512x512.

My Galaxy class now allows me to have any size. Render is difficult still once I get over 1 million particles, but I might look at chunking it. Tbh in my project the player will rarely need to see the whole Galaxy, so may be able to fake it a bit :wink:

1 Like