Mikal's Forum Posts

  • On Animation Finished and On Any Animation Finished are working in my projects. Do you have a test project for me to review?

    If the test project is private, contact me on the Construct Community Discord and send it via DM.

  • For the bbox, you need the Spine Slot name and the Spine BBox name. Check in the spine editor or in the Spine JSON what the slot/bbox names are.

  • Some more work on Babylon 3D Model Sprite plugin, added default Animation Blending and isPlaying, onAnimimationFinished ACEs to handle transitions. Contact me on Construct Community Discord if you want to Alpha test (and have a 3D model to test with).

  • Nice work, nice to see these type of work w/o plugins (and just some effects). Keep up the good work, looking forward to the game when it releases, the demo looked good.

  • This looks similar to a 'smoothstep'

    en.wikipedia.org/wiki/Smoothstep

    Live example / formula:

    desmos.com/calculator/xykhidbkbg

    For your case you can do (1-(formula))*1000 to get your range and adjust a and b to match your limits.

  • I have seen converters/exporters sometimes fail to work perfectly between formats (and also have read about folks having troubles in general between many formats), in particular textures (there seem to be multiple different ways to handle 'materials' beyond just diffuse color between formats and tools.)

    If a glb works in the sandbox, it will very likely work using this plugin (since it's all based on Babylon and Babylon gtlf/glb loader.)

    In general performance could be relatively stable on desktop, but mobile tends to not handle dynamic texture updates from a canvas very well.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I see, my suggestion then would be to multiply everything by: PlatformInfo.DevicePixelRatio

  • There _may_ be a bug in the plugin (at least when run in preview).

    In c3runtime/instance.js:

    				self=this;
    

    This line might be overloading C3's use of 'self' at the top level (at least in preview.)

    After commenting out that line and disabling worker mode, the plugin no longer does a black screen (also a suggestion, if you see a black screen open up the browser developer console and check for errors, this is how I debugged and found the worker mode issue and the 'self' issue.)

    Also note that my experience is Corodova based plugins are not functional in C3 preview (since the cordova plugin may not be loaded in a preview environment.) They are functional when built for the target mobile platform (e.g. iOS or Android.)

    I would contact the original plugin author to see if they can help based on this info.

  • Here's a JS library that can do full body pose:

    medium.com/tensorflow/real-time-human-pose-estimation-in-the-browser-with-tensorflow-js-7dd0bc881cd5

    With C3 JS integration, you should be able to load the JS files and use C3 JS scripting to control it and pass back data to C3 events.

  • Quick guess: try turning off worker mode in 'Advanced' Project Settings.

  • If you are talking about Drawing Canvs snapshot, the details are here:

    construct.net/en/make-games/manuals/construct-3/plugin-reference/drawing-canvas

    More specifically look at:

    Expressions:

    PixelScale

    The size of a single canvas pixel in object co-ordinates. See the section Co-ordinate systems above for more information.

    SurfaceDeviceWidth

    SurfaceDeviceHeight

    Returns the current size of the canvas surface in device pixels. These are useful to use when defining a subset area to use in the Save image action.

    The one exception to this is using snapshots to read and write pixel data. In this case snapshot pixels are given in actual pixel co-ordinates rather than object co-ordinates. The PixelScale expression also gives the size of an actual pixel on the drawing surface in object co-ordinates, allowing you to convert between object and pixel co-ordinates.

  • The glb format supports multiple animations in one file and I have a simple play animation Action that controls which animation plays and switching animations. There is no 'tweening' between animations yet, but that's a natural next step.

    If you want to see Babylon render similar to this addon, load a glb into this online Babylon viewer (allows for selecting of animations also.)

    sandbox.babylonjs.com

    Connect with me on the Construct Community Discord or Twitter (@kindeyegames), if you have models to test. It's still in the experimental stage, but it's interesting to play with.

    Another example with simple light control.

  • I am doing an experiment (in C3) using approach 2. One issue is the time to copy the texture over from the canvas. I am doing something pretty simple focusing on using a model just for a C3 Sprite (e.g. w/o 3D physics, etc.) To handle multiple models, but not do multiple canvases, I used Babylon multi-view to have a separate camera per model, then update the viewports so that they all take up one part of a large canvas. I then transfer the single canvas over as a texture to C3 and use it like a C3 spritesheet to just use the viewport area for each model.

    I also did #4 using Spine's webgl lib (with help from R0J0's insight on how they did that before in C2). It was a lot of trial and error, but in the end worked (though Spine's webgl rendering is definitely simpler than Babylon - Spine is more 2D focused than 3D focused.)

    C3 Babylon experiment:

    construct.net/en/forum/construct-3/general-discussion-7/babylon-3d-model-sprite-156532

  • Thanks!

    The format _should_ be whatever Babylon accepts (gtlf, glb, babylon, obj), but I had to hardwire it for glb for C3 preview mode (since Babylon normally uses file extensions to check format, but in C3 preview mode, the file extensions are obscured due to referencing preview blob urls.)

    The conversion to glb does not seem too bad (there are converters out there.) The one pain I have run into is converting fbx models w/ separate fbx animations to glb. I had to load them into blender, combine them together and then export to glb.

    These are early days for the plugin experiment. In general it's similar to the released C3 Spine plugin that I have been working on, mainly for render/image, but all physics, game logic, behavior would be done in C3 with another sprite that the Babylon Model is 'pinned' to.

    What 3D model formats are you interested in using?

  • I am experimenting with a simple Babylon C3 addon. It renders a number of Babylon animated 3D models in a single canvas and then you can use the models as 2D Sprites in C3. You can zoom in and out of individual models and control the camera and animation for each model. It could be useful for a game like Donkey Kong Country w/ 3D model for the character in 2d platformer world. You can apply effects, z order, layer, rotate etc. similar to a sprite.

    Here's a couple examples:

    Single 3D model, attached to a sprite w/ platformer behavior:

    31 model (each rendered separately w/ separate camera control):