R0J0hound's Forum Posts

  • Construct already doesn’t render objects that are not on the screen. And effects only are run for pixels on screen.

    Sorry. That’s more help than I’m able to provide.

    Things get far less simple to do sorting without arrays or instance variables.

    Global variables are handy but get tedious to manipulate. You’ll end up with more events too.

    I’m bored though and know a silly way to sort with waits. For example with three global variables. You’d basically add an additional event per global. To use just set sort to 1 somewhere in your events and it’ll sort in basically a second. I won’t be making an example.

    Var sort=0
    
    Compare: sort=1
    — wait 1/global1 seconds
    — text: append text global1&newline
    
    Compare: sort=1
    — wait 1/global2 seconds
    — text: append text global2&newline
    
    Compare: sort=1
    — wait 1/global3 seconds
    — text: append text global3&newline
    
    Compare: sort=1
    — text: set text to “”
    — set sort to 0

    Probably works best when sorting values in the range of 1-60. Higher values won’t sort right. Values of 0 will never sort.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Presumably you could use the templates feature to have direct control over what instance you copy from.

  • Looks like a grid based fluid simulation. It would mostly just be a matter of adapting a fluid sim algorithm with arrays and the displaying the result with a drawing canvas. Performance will be poor on all fronts though. Instead of using events you’d want to use js or wasm to process it faster. Displaying per pixel with the drawing canvas alone will be slow too. But that’s pretty much what we have available. Maybe limit the canvas size or use a scaled canvas.

    Fastest approaches do the fluid on the gpu but in general c3’s renderer is rather specific with what gpu stuff you can do with it.

    There are js libraries that do fluid but those aren’t trivial to modify to get the result into c3.

    Short version is there is no simple drop in solution at this time, instead it’s a complex Frankensteins monster to get something working. Of course I’m speaking from the point of view of knowing what’s involved, and not having enough time to actually do it. In the end there are simplifications that probably make it closer to a drop in thing. But it’s mostly the busywork to get there.

  • Construct provides nothing to do that other than JavaScript. Presumably you can find and use a JavaScript library to do it. Search the forums deeper and someone probably did it before and shared a plugin or example. It would be completely separate from the audio plug-in and hopefully the library is robust enough to support all the platforms you want to support. Basically it’s almost completely independent from construct other some JavaScript to interact between the two.

  • I don't understand the question. The main useful blend modes are normal, additive and destination-out (which erases). You'd have to experiment with the other ones.

    To only show stuff in the light you'd have a layer

    with force own texture = yes

    with transparent = no

    with color = black

    and the light object on that layer with destination-out (which is the same as erase).

    Any layers under that will be hidden if not over that light, and any layers above will always be visible.

  • Browser based engines usually utilize what the browser provides to do things. For example the browser provides a way to draw text so they use that, which works fine other than not being able to disable antialiasing for low res games.

    You can bypass the browser text rendering and do it directly. It involves rasterizing the text directly from the font files onto a texture. Since it’s a pain to do that a library such as freetype is used.

    Anyways, overall it’s a lot of work just to add the ability to disable antialiasing.

    Easier to just use a spritefont I’d say.

  • The best you can do is use the alpha clamp effect on the text. Otherwise you need to use a spritefont.

    The blurriness is do how the browser antialiases all text which you can’t disable on most browsers. You can disable it with some css on Mac and iOS devices but it will still be blurry with anything else

  • So probably event sheet functions use js functions under the hood but uses more data so the stack space is used up faster?

    Stack space is usually a fixed size in programs but I could imagine it’s fixed per tab or something in browsers’ js engines.

  • The only thing I did differently was make the v<500 condition directly below the function instead of as a sub event. Perhaps the sub event takes up more data so the stack space gets used up faster?

  • Can’t reproduce. It sets v to 500 or any other limit I throw at it? Got it to 1500, and after that the screen is black. Couldn’t look at the browser console to see if there are any errors. In the past I’ve seen a recursion limit error when trying to do a flood fill algorithm. Luckily any recursive algorithm can be made iterative instead.

  • Ah, I didn't realize this topic was so old. Oh well, this is still relevant.

    One way I've found works well is to make a gradient from the top of the platforms up to the jump height. Then with that we can encourage paths to be found closer to the floor and not try to go up past the jump height. Here I used it with Dijkstra's algorithm because I wanted paths from every location to one point. You could used Astar instead for a single start and goal too I suppose.

    It doesn't replicate precision platforming so enemies do fall into holes and miss jumps, but it will get to the player after multiple tries in most cases.

    dropbox.com/scl/fi/z6dlthcsp7ihqvb1wv83n/platform_pathfinding2.capx

  • I did some further tests. Fullscreen scaling is set to "low quality" and I tested text done three ways for three fonts.

    First its the normal blurry look we get with the Text object.

    Second is the same Text with the "alpha clamp" effect with a threshold of 50.

    Third is rasterized with the FreeType library without smoothing.

    Using alpha clamp looks like it could be usable for some fonts, and you could probably fiddle with the threshold per font. The downside of it is the fonts look more rounded, and thin characters cause gaps.

    FreeType has nice results, even with thin parts. The con is it's probably slower, and the js ports aren't in a super usable state.

    I ended up using this library and heavily modifying the example to get the results above inside C2, but I wouldn't call it user friendly so I'm not posting it.

    github.com/metafloor/freetype-js

    Anyways as is it could be handy to make a tool to generate crisper spritefonts from a font.

  • The deeper I look the more it looks like removing anti-aliasing will never become a standard thing. Which makes sense since anti-aliased and clear type text is better looking in most cases. Most fonts don’t look good aliased.

    Crisp aliased text is niche feature of low res pixel games. The easiest solution is basically using the alpha clamp effect on the text for a general case. But a spritefont will likely look better, but we probably need better tools to generate them from fonts.

    cesisco

    That’s what I tried too. But it’s only a Mac/iOS thing. It doesn’t work for other platforms. Our only solution is a spritefont or maybe use the alpha clamp effect on the text.