R0J0hound's Recent Forum Activity

  • 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.

  • Nevermind about using font-smooth css. Mac and iOS stuff only seem to support it. I tested on Chrome for windows and it does nothing. Oh well, so close.

    iOS uses the freetype library to rasterize it's fonts to an atlas, and while there is a js port it seems to be a very low level beast.

    Still looking though. Turning off text aliasing doesn't seem to be something you can reliably do without rasterizing the font directly which is pretty low level.

  • Looks like it works on iOS. Basic test. There’s some other css variations of font-smooth needed to support most browsers.

    Probably nothing we can do as users to get the text object to do this. CSS can only be added to elements added to the webpage or elements we can access. So best as a feature request or get a dev to make a custom text object plugin or something. Probably could get by using some js to draw to an html canvas, then get the dataurl from that and load it into a tiledbg object whenever you want to change text.

    <!DOCTYPE html>
    <html>
    <head>
    </head>
    <body>
    <style>
    #canvas{
    font-smooth: never;
    -webkit-font-smoothing: none;
    image-rendering: crisp-edges;
    }
    </style>
    <canvas id="canvas" width=100 height=100></canvas>
    </body>
    <script>
    const canvas = document.getElementById("canvas");
    const ctx = canvas.getContext("2d");
    ctx.font="10px arial";
    ctx.fillText("testing", 0,50);
    </script>
    </html>
  • Unsure. I’d have to fiddle with it. CSS lets you apply rules such as for all canvas elements on the page.

    The text object uses a canvas element that isn’t added to the page to render the text. That canvas is then copied to a texture which is then drawn. I think that canvas is hard to access directly, and will be harder once they obfuscate everything.

    Actually I’d want to take a step back and just try that on a canvas element directly outside of construct to see if it even works.

    If it ends up not working for text on canvas you could try it on the htmlelement plugin, or whatever it’s called.

    Beyond that maybe we’d need to bypass the browsers text rendering entirely and render text directly using a library like free type or something where we have full control. But realistically that would be to make a texture atlas that construct then uses to render text, probably via a custom plugin since existing solutions by using distort meshes or tiledbg to do it is too slow or may end up being too tedious.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You could try this css.

    developer.mozilla.org/en-US/docs/Web/CSS/font-smooth

    Says it’s supported by most browsers currently?

  • You can make the walls thicker and/or reduce the speed of the ball.

    Motion is an illusion, objects move by teleporting a bit each frame which can cause collisions to be missed. What’s probably happening in your case is the collision response is struggling with that particular collision polygon so it’s perhaps pushing out in the wrong way.

    Anyways another idea could be to clamp the balls position inside the box. Something like

    Set x to clamp(self.x, box.bboxLeft+radius, box.bboxRight-radius)

    And do the same with y with top and bottom.

  • You can apply a constant force downward. Technically force=mass*acceleration so the gravity force for a specific object would be that. But the physics units are flawed in the behavior so a constant like 50 would work.

    Alternatively you could set the y velocity to self.physics.velocityY+500*dt which would just apply an acceleration directly

  • You mean ranking who finished first? Just who collides with the finish line first. Typically you’d have a bunch of lines along the track that the players need to collide with in order to make sure the car is going the right way around the track.

    I made one such example a while back but you’d have to search the forum for it.

  • You probably need to use a for each in there with custom action

  • Can’t help since I don’t use export. That is annoying if remote preview is smooth but the export is not though.

    Is there a difference between exporting a debug apk and a normal release one? No idea of it relates to construct but in many other languages a debug build will perform worse than a normal release since it’s doing more debug stuff.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound