oosyrag's Forum Posts

  • Glad it made a difference. Especially true since modern hardware lets us get away with a lot, so it's easy to overlook things like this. It works fine, until it doesn't.

  • Wild guess is that you no longer have the correct event sheet assigned to the layout.

  • Images are loaded into memory at their original resolution, then scaled.

    So use native sized sprites whenever possible unless they need to grow significantly during runtime, then you probably want the higher resolution sprite.

    This is probably having a massive effect on your memory use.

  • Use loop and the loopindex system expression to repeat a set of events with an incrementing number value as a variable.

    Specifically if you're creating the buttons dynamically:

    Repeat n times

    Create button at margin+loopindex*(button.width+padding), y

    If they're existing on layout already, you can use for each instead of repeat. But then you might as well just use the layout editor align options to position your buttons.

  • Deleting all your events and any behaviors, objects, or effects that are not default ones should do the trick.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If your goal is to move the sprites, just delete the plugins and open in c3.

  • The solution for nearest wall is simply to design the level taking it into account. Basically no long stretches of walls. Alternatively, use a different type of wall for long sets of walls - just put the "cover" type wall at the ends or corners.

  • Nah my idea in that thread would have the exact same problem actually. It assumes empty space behind the target, otherwise the wall behind the target would be the first thing hit.

    A better system would probably have a bunch of potential "cover locations" at all times set by the player position, and the enemies would pick the one with lowest pathfinding cost, since the nearest point by distance may not always be the shortest path.

    Unfortunately I'm not seeing a way to get the path length with the built in pathfinder expressions, besides which it could get quite costly to find a path to every potential cover location just to check the distance.

    Getting the path length is possible by looping through all the generated nodes after finding a path, but it would still need to be calculated and compared with all potential pathfinding targets, which sounds awfully heavy to me.

  • Not really, not for a sprite with a donut shape like that.

    The most straightforward way would be to create a set of sprites of all the different sizes you want. Probably different animation frames of one sprite object, and you would choose the animation frame of the suitable size for any given planet.

    You might be able to use an html/form element with styled css, which can set fixed border sizes, but that's going to cause all sorts of other problems you won't want to deal with down the road.

    Edit: You could also probably draw them dynamically with the drawing canvas plugin

  • "Nearest wall" would be easy, but it's a weak algorithm would only work with very specific level designs.

    It can only work for uniform wall tiles, maybe from a tilemap, and even then it would be illogical for more complex walls. For example, in the following image if blue were the player and red were the enemy, green was the nearest wall, then the pathfinding target would be at yellow, which is silly.

    If you want to do it like this anyway:

    On "flee" state

    Pick nearest wall to enemy - Create helper "target" sprite at wall

    While target sprite is overlapping wall - Move target sprite one pixel/tile/step at angle(player.x,player.y,target.x,target.y)

    Pathfind to target, destroy target

    If enemy does not have line of sight to player, stop pathfinding, change state

  • Weird! Graphics driver? Hardware acceleration enabled?

  • Your preview browser is Firefox and nwjs is chromium, which probably has something to do with it.

  • Sorry I wasn't really familiar with the details myself, I just found that and it seemed like a good place to start looking.