Now using Godot’s scene editor
I talked about making this move back in a different post. I think I’m now at a point where I want to start actually making the levels for the game. I still don’t have any assets, but I don’t think that should be too much of a hinderance. If I ever am able to create assets and want to add them, I should just be able to replace things. (Let’s hope.)
How things work now.
All nodes to be exported must have the properties script on them. The export button goes through the nodes, finds nodes that have the type field in their script, then adds their spatial information. From here, it goes through the children of these nodes and adds nodes that I’ve added support for. At the moment these are Collision shapes (only boxes and spheres) and paths. The type property in the parent node is a string that will tell the game what to spawn there. The collision shapes, will tell the game how to spawn the colliders required for the thing its spawning. The path is going to be used whenever I need a collection of points. Could be anything from an enemy that will patrol a certain path or a cinematic.
I did like the speed of the old editor, I may be able to bring something like that to this one if I care enough to implement the features. Certain things should be able to be quickly drawn with a brush. Such as walls and certain types of obstacles.
I’m not sure that I really like how I am serializing the data from the Godot scene editor into the importer and how I am arranging the data there. I think that it should be possible to make things more versatile. At the moment, every object has a list of rect colliders, sphere colliders, and paths even when these lists are empty. I imagine that it should just be a list of components and from here I should be able to generate what I need. A single list with multiple items that are somehow used.
Also, the rect colliders and sphere colliders are 3d objects, I just use the radius and certain axis extents in order to recreate them in the 2d physics space.