The Editor SDK : feedbacks and discussion to enhance its useability

0 favourites
  • 3 posts
From the Asset Store
Supports 1D, 2D, 3D arrays. Import and export arrays in JSON format
  • Hi ! this topic aims to be a constructive discussion between Addondevs and Scirra about how the exposed Editor SDK could be improved to allow us to create simple tools working in editor.

    As Scirra is using the "secret obfuscated Editor SDK" under the hood for all Vanilla Plugins and Behaviors, the "exposed Editor SDK" was never dogfooded in any way and there are many many holes that makes it almost impossible to use for anything relevant. This is why most addondev just abandon the Editor part of their addon and everthing can only happen at runtime. But it is an issue as many cool Plugins/Behaviors that could be made would only be useable if the user was able to set them up and preview some stuff happening at edit-time.

    Example usecases :

    • UI System
    • Addons displaying textures from other Plugins (as Particles and 3DShapes are doing)
    • Utility Plugins to create/place instances in bulk in the Editor

    Tagging skymen and Mikal as they're the 2 other devs I know that tried a lot to deal with the Editor SDK before. Skymen wrote an amazing article about this topic about this btw : construct.net/en/blogs/skymen-13/flexbox-weird-characters-1590

    Even if the best would be to have access to a much bigger part of the actual Editor SDK API, the goal of this thread is to discuss about the main holes in the exposed SDK and try to find reasonnable and clever ways to makes things much better with the smaller amount of changes and new methods, as I understand Scirra wants to keep most of the Editor SDK obfuscated.

    I spent an entire week trying everything I could thanks to skymen's help to make simple stuff happening in Editor with custom behaviors/plugins and just faced walls after walls preventing me to do anything relevant, no matter the tricks I used, even after trying every possible way of doing stuff. Here is a few issues I faced.

    • 1. Object property : Plugins can select other ObjectTypes as one of their property. It's very useful and used by Particles and 3DShape to be able to do stuff based on other objects. However at editime, those properties returns the SID of the ObjectClass but there is not a single way to get an ObjectClass by its SID using the Editor SDK.

    Solution : Add a GetObjectClassBySID(SID) method to the IProjectClass

    (could be cool to also add Object property support for Behavior btw)

    • 2. IRenderer.SetTexture() only works with IWebGLTexture class but "not secret WebGLTexture class" which is a big issue because it means there is no way to make anything work both with official Plugins/Behaviors and 3rd party addons. Indeed LoadWebGLTexture() method of AnimationFrames returns a secret SDK instance (WebGLTexture) that can't be used using the exposed SetTexture() method. It's as if the Vanilla Addons and the Custom Addons were their own island that can't interact with each other, making it pointless

    Solution : Different possiblities : make LoadWebGLTexture() returns an IWebGLTexture instance instead, also make functions like SetTexture() work both with exposed IWebGLTexture and WebGLTexture

    General Thought : Make sure any method that exists in the exposed SDK work both for Vanilla addons and Custom addons

    • 3. No way to do anything related to Hierarchy feature, while it would allow us to create AutoLayouting behaviors, utility tools and full UI system : I describe every missing stuff extensively in this suggestion : construct23.ideas.aha.io/ideas/C23-I-469

    • 4. Missing GetName() : It is possible to GetAnimations() from an ObjectType, but not a single way to get their animation name, so it means it's impossible to know for sure we access the animation we wanted to access.Ideally everything that has a name should have a GetName() property

    Solution : Add a GetName() method to the IAnimation Class (and any other class that should have one one but has not, same for all the basic stuff that would be useful and that isn't subject to change)

    Those are just a few roadblocks I faced while trying to do simple things using the Editor SDK. As there was never detailed dogfooding or detailed feedbacks from addondev on this, I hope a discussion could be a start to solve those annoying roadblocks in reasonable ways to improve the Editor Addon SDK so we can use it to make cool stuff.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I've added #1 and #4 for the next release cycle, and fixed #2 (which is a bug and could have been reported as such - the public SDK should always work in terms of public types and not internal types). I think #3 would be a fair bit more work though.

  • Wow amazing ! Thank you 🙏

    1. Does it also includes Object Property support for Behavior ? I found out that anytime an Addon could be a Behavior, it's better to make it a behavior rather than a Plugin as it allows for better Modularity and ends with easier events (no need to act on a bunch of seperate objects and to do picking). I think it's especially true for 3rd party addons that are meant to extend the functionnalities of Vanilla feature, they must work on top of any Vanilla World Plugin. construct23.ideas.aha.io/ideas/C23-I-464

    2. Thanks ! that's good to know, i'll keep that in mind if i ever face a similar issue and will report it as a bug.

    I suppose if LoadWebGLTexture() for AnimationFrames was wrong then maybe GetCachedWebGLTexture() also requires some fix ?

    3. I thought about it again and realized it was more complex than i thought, updated the suggestion to reflect those extra thoughts : construct23.ideas.aha.io/ideas/C23-I-469

    Some methods might be difficult to implement but other are probably a matter of exposing existing stuff and would help for a lot of usecases not even related to UI (Getting Parent/Children, Destroying Instance etc.)

    Other issues i faced (workarounds kinda exist for them - in some sitations only - but it feels like they're unnecesseraly tedious)

    5. It would be probably good to add a project.GetInstanceByUID(uid) or a layout.GetInstanceByUID(uid) depending on where it makes sense

    6. There is no way to get the Layouts of the Project, as explained in Skymen's article, a project.GetAllLayouts() would be useful to have.

    Above all, a project.GetCurrentLayout() would be useful to then get a specific layer then create a world instance on it, as Layout allows to access all Layers. (layout.GetLayerByName() would be a nice QOL but very easy to workaround with a loop) There is already a CreateWorldInstance(layer) method but it's sometimes tedious to use without handy ways to pick a specific layer.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)