Implementing 'Running Code in the Editor' Feature in Defold

Hello. I’ve been closely following Defold for a long time now, but there’s a significant feature that has prevented me from transitioning to Defold for quite some time. I wanted to share this with you.

I have been working with Unity for an extended period, and I later switched to Godot. Perhaps one of the most significant shared features between these two game engines is the ability to write third-party tools that can work within the editor and integrate with its built-in tools. In Godot, this capability is almost limitless, and the game development logic is designed to accommodate this. For a better understanding, you can refer to these resources:

For a more advanced example, check out this video:

For instance, to give a simple and common scenario as an example, being able to visually edit the movements of moving enemy objects on the canvas or creating a polygon editor where you can add and edit points on the canvas. These features greatly streamline the workflow and contribute to high-quality project development.

It seems very challenging for me to give up on this feature because I integrate and use third-party libraries with visual editors. Do you have any plans for something like this in the near future?

6 Likes

Another example from me, I could write this tool in Godot;
https://twitter.com/erayzesen/status/1592235870232653824

But I could do similar things in Unity as well.

Editor Scripts allows to embed some kind of tooling into Defold’s Editor:

I don’t have an idea on what we really could achieve with this, because currently released by community scripts are making simple, repetitive things with one click of some action. I don’t know if this allows us really to create some kind of “editor in the editor” like the polygon editor example. I have a lot of ideas on how such enhancements could look like, but I’m not sure if we have everything needed exposed, it feels somehow restricted.

It needs a comment of the Defold team to start a discussion here :wink:

2 Likes

We want a much more versatile editor script API. There is no question about it. The API is currently limited to running additional code during the build process or to add additional menu items to perform scriptable tasks on resources in the project. We want to expand the API to allow developers to also add widgets/windows/gizmos to manipulate project content using a UI rather than a script. We have however been busy with things that we have considered of higher priority.

4 Likes

@britzl Sound is good. I really wish Defold Engine had these features; I can consider it the biggest drawback for me. I desired it for two reasons: firstly, to seamlessly integrate some native libraries I wrote that require editor support, which could contribute to the ecosystem. Secondly, I wanted to use Defold in some game projects, but unfortunately, it seems challenging to port my custom tools at the moment.

Although the discussion has focused on the specific advantages of Godot and Unity in this regard, Defold has its own appealing advantages in other areas where they may be lacking. I want to clarify that the examples I provided when expressing this feature request should not be misunderstood.

I’ll be eagerly awaiting developments on this matter.

4 Likes

Would having Jason versions of and translators to Defold manifest files be possible and useful? This could make it easier to write maintainable translators/mappers from other software such as Blender and Tiled.

You mean json?

And what do you mean by Defold manifest files? The data files such as .go, .model, .collection etc?

If that is what you mean then those are already in a standardised format, the protobuf text format (Text Format Language Specification | Protocol Buffers Documentation) for which there are readers and writers in almost any programming language.

2 Likes

Yes, Json, doh. Yes data files, protobuf looks good, I did not know about this, I will investigate when I find some time:-) Thanks.

Currently, we package most of our python writers for protobuf, but I need to add the manifest writer as well. My plan is to produce a package with all the .proto + *.pb2.py files, so that it’s even easier to modify your content (e.g. split a live update archive into multiple archives).

2 Likes