Making an Editor

It seems this has been attempted in the past. Our team (just three people- mostly art focused) has been using Godot for mobile development after a switch from Unity- two very Editor focused apps. I come mainly from an arts and design background. With that said, I’ve started to look into picking up C++ and into putting together a game engine. Then I found this awesome framework. And I’d really like to make an editor that kind of exposes the framework functionality in a drag and drop editor that would appeal heavily to artists and designers. (e.g. visual scripting system)
Since I’m really just starting out with C++, I can’t promise the most elegant, readable, scalable code at the outset. My question is, what would people here suggest as the best path for developing it. My first thought as an approach would be to make it so the editor is just a game- built with the framework- but I’ve been going through the PGui docs and it seems there is a bit missing. Also, in terms of playing levels in the editor or multi-window instances- there’s a lot I’ve been trying to figure out how to implement in the panda framework that I’m not entirely sure where is best to start.

Thanks all for reading this far lol. Cheers!

1 Like

Hi, welcome to the community!

The main challenge of writing an editor for Panda3D is that Panda3D is a very flexible, versatile engine, adaptable to a wide variety of workflows. When building an editor, whatever kind of workflow you implement, it is naturally going to restrict people towards certain ways of thinking about and constructing their games. This is the reason why there has also been pushback to adopting an editor from a part of the community, particularly from people who appreciate Panda3D’s not-getting-in-your-way design, who would rather be given the tools to make their own editor that is suited to their particular use cases.

To be generally useful, an editor would also have to not just implement the rudimentary basic drag-and-drop scene construction, but it would have to wrap tightly enough around all the important Panda3D attributes and concepts. If there is one particular attribute that I cannot set through the editor, it needs to be easy for me to modify or work around the editor to add it, or I can’t really use it. Or if I have to adapt my game to a completely new object model, that’s yet another barrier for me to use it. (Godot is nice—but after having used both for several games, I can safely say that Godot is nowhere near the level of depth or flexibility that Panda offers.)

Another tricky thing is that there has to be something to edit to begin with. You could make something that edits Panda’s scene graph, but a good user-friendly editing workflow might have to sit at a higher level of abstraction, at a level where users can associate scripts with their objects, etc. You would probably end up devising your own proprietary scene format, though that in itself carries the risk of locking people in to your tools (which might hinder adoption). There are so many editors floating around that never caught on, it would be great if there were an attempt to produce a generic, editor-independent scene layer that could be shared between multiple Panda3D editors, rather than each attempt reinventing their own proprietary format.

The next challenge is the fact that there aren’t really good UI libraries for Panda that would allow you to build a lot of robust UI to handle this challenge. I think any attempt at an editor would do well to first make sure there is a good, solid UI framework to build upon. This might mean building a new UI library,
creating a wrapper library around existing UI libraries, or using external toolkits (Electron, Qt) and embedding Panda3D into that, although each approach has its own challenges.

I am not trying to dissuade you: I would be happy to see someone work on designer-centric tools. But I would ask you to think carefully about what the goal is: a truly comprehensive general-purpose editor for Panda3D that meets the needs of existing users would be a herculean effort, requiring a lot of careful design work. That said, if you don’t mind making something more specific in scope addressing a particular audience (such as more design-minded newcomers looking for a more high-level drag-and-drop experience), that will work well for certain games but might not be suitable for all users, I think you have a lot more freedom.

Personally, as a developer, I’m less interested in a single-package start-to-finish editor than in a comprehensive suite of opt-in debugging, development and editing tools that can be combined and extended to meet the needs of my specific applications. I know that there are plenty of (prospective) Panda users who would be interested in a designer-centric workflow, though.

2 Likes

For the interface, look at wxWidgets, which is very easy to configure in Panda. Be prepared for the pitfalls of making changes to the source code. For example, adding new properties to objects that the editor needs, such as ShaderTerrainMesh, and so on.

Thanks so much for the responses! For the UI framework, I’m looking at Dear ImGUI with the MIT license that was implemented in C++, I’m taking a look at their examples for binding to different engines.To be sure, I’m not making the case for a unilateral new interface that is the sole way to make stuff in panda. I’m certain for many developers, the framework and libraries are precisely what they need to build what they want. My project would be more like an additional option without taking anything away from the projects structure at all. Indeed it would be just as you said, an interface for the design minded new comers but- trying to expose as much functionality of the framework as possible. My goal is moreso, simplicity in design but still plenty of power.
I really really appreciate you guys taking the time to respond. I’m probably really out of my depth here, but I really do believe there could be some way for me (and perhaps the other two guys in the team- I’ll see what they say after we publish) to contribute.

I’m very curious about this editor independent scene layer idea-I need to spend quite a bit more time with the docs- but how do people organize their scenes currently for finished games in Panda?

1 Like

Speaking for myself, I think that the structure that I employ varies somewhat from game to game. There’s generally a list of “game-objects”–sometimes more than one, if called for–along with whatever other elements are appropriate to the type of scene in question. If the scene has a distinct “player”, then that’s usually kept in a variable of its own.

The scenes themselves are then organised, again, in whatever structure makes the most sense to me for the game in question–there might be only one scene at a time, stored in a variable of the central (ShowBase-derived) game-class; or there might be a stack of scenes, allowing one scene to temporarily take over from another; or–in at least one (as-yet unfinished) case, a nested tree of scenes, one holding many, each themselves holding many.

Still, I suspect that all of these approaches could likely be reworked to fit a universal scene-layer. For example, the nested version could separate the hierarchy from the actual scenes, simply loading whichever scene is indicated when moving to a new node in the hierarchy.

There’s an interesting idea! Now I’m curious what the typical overall structure that people use for their entire games-From menu’s to that nested scene approach- and game states. Either way- that reminded me of another cool format from Pixar- OpenUSD -for containing large amounts of hierarchical data- often 3d data but also is extendable for properties about that data and other metadata that may come with it. I can’t really parse out all of the technical aspects of the format- but it seems that could be a viable portable format for the editor(and possible others).

1 Like

A bit off-topic but I think my experience may be helpful to you, rdb, for future Panda3d development considerations.
I used to think exactly like this, until I tried the editors the newer versions of Unity and Godot provide. I have to say, while skeptical at first, for somewhat complex games editors are a life saver and these general purpose editors never made me feel limited. There was only one time, when I was involved with a team porting an existing game to Unity, where no new assets had to be made and scene description files for each level were already there. But I realized that having an empty scene in an editor that has a single node which executes the startup script was just a mild inconvenience compared to ever other case the editor felt essential. Maybe there are some people who just can’t stand a default editor, but even then they can have an empty scene with a single object that executes a startup script of a custom editor, that is, if the game engine is closed source and forces you to use the editor. Even for closed source game engines this is not an either-or situation.
Just my 2 cents.