fedca's Recent Forum Activity

  • You can change the z-elevation via js as a workaround for now.

    runtime.objects.DrawingCanvas.getFirstInstance().zElevation = z;

    I just wrote a bug report for the drawing objects with missing z-elevation (something similar came up just a day or two ago with the Video object on the Community Discord)

  • Automatically following the addon when you download it would notify when an addon was updated that they are using. Often people use an old version for a long time as pressing the follow button is easily missed.

    This would be in line with how you auto follow threads if you interact with them.

    Tagged:

  • Yes, doing a pick by evalue doing all the checks in condition using operators (Object.var=? | Object.var2=? | Object.var3=?| Object.var4=?)can be faster as the loop through the instances is only done once.

    But it only matters in extreme cases and can hurt readability imo.

    But yes I have used this optimization in my projects!

  • New Effect: Directional Blur

    https://www.construct.net/en/make-games/addons/1149/directional-blur

    Allows you to set the blur angle and tweak the blurs strength and quality (supports webGL and webGPU as always)

    Additionally I ported the RGBA Channel Separation shader to webGPU and also was able to improve performance of the webGL variant.

    https://www.construct.net/en/make-games/addons/1127/rgba-channel-separation-webgpu Original Effect was created by Oppenheimer and Ludonaut.

    Also I updated the following shaders to improve performance and fix some minor stuff:

    • Box Blur Horizontal/vertical
    • Kawase Blur
    • Add Color
    • Tint Blend
  • Thank you Ashley, while other algorithms are interesting this is probably the most pragmatic solution. I hope we get access to the collision cells via scripting and addon sdk too at some point!

    Btw the dropbox link doesn't work for me and I remember other people having the same issue with dropbox links on the forum recently.

  • if the hierarchy children have width height checked, mirroring the parent should work with the children

  • A problem with making built-in quadtrees is Construct's collision engine needs to extend over an unlimited area (e.g. still handling activity outside the layout area, or with unbounded scrolling). Collision cells can do that with sparse cells. I'm not sure quadtrees can handle that.

    Isn't this the main benefit of a tree structure, that sparse areas can just be one large node/cell and it only sub-divides where many instances are?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • const ALPHAEX_SHIFT = 1024;
    const ALPHAEX_MAX = 1023;
    const RGBEX_SHIFT = 16384;
    const RGBEX_MAX = 8191;
    const RGBEX_MIN = -8192;
    
    C3.GetRValue = function GetRValue(rgb) {
     if (rgb >= 0)
     return (rgb & 255) / 255;
     else {
     let v = Math.floor(-rgb / (RGBEX_SHIFT * RGBEX_SHIFT * ALPHAEX_SHIFT));
     if (v > RGBEX_MAX)
     v -= RGBEX_SHIFT;
     return v / 1024
     }
    }
    ;
    C3.GetGValue = function GetGValue(rgb) {
     if (rgb >= 0)
     return ((rgb & 65280) >> 8) / 255;
     else {
     let v = Math.floor(-rgb % (RGBEX_SHIFT * RGBEX_SHIFT * ALPHAEX_SHIFT) / (RGBEX_SHIFT * ALPHAEX_SHIFT));
     if (v > RGBEX_MAX)
     v -= RGBEX_SHIFT;
     return v / 1024
     }
    }
    ;
    C3.GetBValue = function GetBValue(rgb) {
     if (rgb >= 0)
     return ((rgb & 16711680) >> 16) / 255;
     else {
     let v = Math.floor(-rgb % (RGBEX_SHIFT * ALPHAEX_SHIFT) / ALPHAEX_SHIFT);
     if (v > RGBEX_MAX)
     v -= RGBEX_SHIFT;
     return v / 1024
     }
    }
    ;
    C3.GetAValue = function GetAValue(rgb) {
     if (isNegativeZero(rgb))
     return 0;
     else if (rgb >= 0)
     return 1;
     else {
     const v = Math.floor(-rgb % ALPHAEX_SHIFT);
     return v / ALPHAEX_MAX
     }
    }
    
  • yea you are right, it seems to give incorrect results. Let me check c3 source to see how they generate it

  • Converting a colorValue back to RGB 255:

    R = int((-colorValue / 2^38) % 1025 * 255 / 1023)

    G = int((-colorValue / 2^24) % 1025 * 255 / 1023)

    B = int((-colorValue / 2^10) % 1025 * 255 / 1023)

    A = int((-colorValue) % 1025 * 255 / 1023)

  • There is this property available for the parent of a hierarchy, with the mode set to wrap or all it will now select the whole hierarchy every time you select any of its members. If you want to select them individually again, for example to turn off wrap mode you can hold alt and then click the instance

  • I read this very interesting blog posts on the topic yesterday, it goes into different 2d collision optimizations as well as benchmarking. https://0fps.net/category/programming/collision-detection/

    The main verdict is:

    - cells are super fast if the cell size is tuned properly and the distribution of instances is uniform

    - the tree structures try to fix that by putting more cells where more instances are so it can handle random distribution and clusters more efficiently

    Looking at the benchmarks this person does it seems like rBush (https://github.com/mourner/rbush) is performing very well in a wide variety of cases, so I added it to Wacky Toasters benchmark https://drive.google.com/file/d/1aM894Ckvqb-BVBREuXN34CqDtpzmuZQ3/view?usp=sharing (just hacked in)

    Test 1:

    3x faster than quadTree and 100x faster than collision cells. But that is probably only due the collision cell size being tuned badly, as in theory this bench should be very favorable to collision cells.

    Test 2:

    I don't really understand how events are so fast in that benchmark.

    Another side note: to me it seems like wasm is a good fit for a collision system like this as it seems easy to separate from the main js logic and could lead to some nice perf improvements.

fedca's avatar

fedca

Online Now

Member since 6 Jul, 2017
Last online 22 Jan, 2025

Twitter
fedca has 66 followers

Connect with fedca