En voilà, we have a graphical level editor!
Well, it’s still in an “early alpha” phase 😉
So far the following features are working:
– Select a game object from a list of all objects.
– View the properties of the object.
– Modify the properties and update the object and its graphical representation accordingly.
Although this doesn’t sound very impressive, it is the proof-of-concept that really counts here. The editor code is currently only 350 lines long but is already able to edit 16 kind of different game objects. There isn’t much more code in the game classes to support this.
What I have learned from RemBolo’s big sister, is that a standalone editor doesn’t work out well, especially if done as an afterthought. It would always be outdated compared to the actual game and it would be a maintenance nightmare.
So I’m taking a different approach here where the editor will be integrated into the game engine from the beginning. A big enabler for this is the CAMP C++ reflection library. It basically allows the editor to stay completely independent from the actual game classes. Once the editor “knows” how to manipulate the basic type of properties (e. g. integer, float, string, bool, enumeration and so on), it will be done. We can add any kind of additional object classes without having to touch the editor code again!
I’ll write about how this kind of magic works in one of the next articles.
Have fun and keep coding!