Ok... Today I read one of the most sucky articles on game tools ever. Of course it was made by a game industry veteran and published over at gamasutra. I won't link it since it was the suck! The example the author used even involved void pointers being cast to correct internal data structures... omg and these people call themselves professionals!
There are essentially three important things in game tool development:
For efficient real time editing the editor must be integrated into your game. This way you can easily switch to an editor when you spot something that is off. You also only have one code base to maintain and it will be true wysiwyg. Another advantage is that the game and editor loads and use the same data files and formats, this also means that if your game changes your compiler will help you since the code will not compile.
The other two points actually are just help to realize this requirement.
Model - View - Controller
The basic architecture of any game should be based on the model view controller patterns. This pattern will help you separate your actual game (rules, ai, whatnot) from your graphics rendering. There are some various flavors and implementation details that is much up to your own taste in things. I use an "it's free to read but writes are formalized via an interface" approach. This basically means that the views use a const reference to the model and get to read public data directly.
Basically your editor is a specialized view for, you guessed it, editing some aspect of your game.
The Model - View - Controller pattern is explained in various books and of course online.
Immediate mode GUI or IMGUI is simply the best way to realize a gui in a real time application. There are excellent imgui articles out there so I will not go into details. Basically imgui is the opposite to a big, bloated, object oriented gui framework where everything inherits from a "window" class.
And yes, you can do drag 'n drop, windows, sliders and all that gui fanciness with imgui.
Thats it! If you stick to these points your game editors will be next best thing to sliced bread, and you can focus on making your game!
Submitted by hObbE
Thu, 09/25/2008 - 20:25