R0J0hound's Recent Forum Activity

  • zenox98

    The issue is the point cleanup is overzealous. You can disable event 4 and it works.

  • zenox98

    You mean curves with the walls? It was only made with unrotated boxes in mind at the moment.

    Edit:

    Updated it to work with rotated boxes. The cleanup stage to reduce the points doesn't work as well though.

  • A convex hull may be what you want, however it's won't be like your second image exactly.

    Here's an example:

    https://www.dropbox.com/s/tcwhjf0expdwx ... .capx?dl=1

    Other methods here:

    https://en.wikipedia.org/wiki/Convex_hull_algorithms

    You may be able to get closer to your second image by first doing the convex hull and then collapse in some of the sides.

  • YoHoho

    The astar search function returns a list of the uid's of the nodes making up the path. I implemented moving before here:

    I think i came up with a cleaner way, so i updated the capx above in this topic, as well as added some more comments.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ...and as another behaviorless example there is this:

    https://www.dropbox.com/s/aondowy4ycjgl ... .capx?dl=1

    Click drag to mark start and end points.

    I took dop2000's map, added in the event based astar shortest path search i've made previously, added some setup events to generate nodes at the corners of the walls, and then finally did an event based los to create a connection graph.

    It works pretty well, I thought it would be slow. There are a few things that could be done to improve it.

    * The corners can be moved closer in. Too close may cause issues with the los and generation though.

    * Only unrotated boxes work for walls with this. Rotated boxes or arbitrary polygon shapes can be done. The generation and cleanup of the nodes in setup would need to be modified.

    * The mesh is kind of ugly, so another idea is to build in an editor in the game to be able to give more manual control if need be. Tweaking the whole thing to be more navmesh like would be nice.

    Anyways, that was fun.

    cheers

  • I've had luck in the past doing instant path finding in the past by utilizing the LOS behavior.

    It's similar to oosyrag's idea but works with simpler maps of just isolated boxes.

    It works by first placing corner objects at the corners. Then the objects either move to the goal if it has LOS, or it goes to a corner sprite it has LOS to. I also believe it did some checking to see which corner was closer to the goal, but it's been a while since i looked at it.

    My following code is in need of improvement since objects get stuck, and you could manually place corner objects instead of automatically moving it if need be.

    I'll probably putter around and see if i can come up with something closer to your op. It seems interesting.

  • This comes up a lot. You can’t do some thing like

    Key = 40 | 41

    You have to do

    Key=40 | key=41

    The reason is because or is treated like an operator like +. The two numbers get or’d together which isn’t what you wanted in your op.

  • The layout already has a number as I recall. Isn’t there an expression for it?

    Otherwise you could a sprite with one instance per layout and use an instance variable and set it to a different number per layout.

  • angryscientist

    I won't be able to add that since i'm not working on this anymore.

    delgado

    I don't use parallax, but it is something you can do via events. Basically just move the object from one layer to the other, paste, and then move it back. Something like this:

    global number oldLayer=0

    global number oldX=0

    global number oldY=0

    global number x=0

    global number y=0

    set oldX to sprite.x

    set oldY to sprite.y

    set oldLayer to sprite.layer

    set x to LayerToCanvasX(sprite.layer, sprite.x, sprite.y)

    set y to LayerToCanvasY(sprite.layer, sprite.x, sprite.y)

    Sprite: move to layer canvas.layer

    Sprite: set position to CanvasToLayerX(canvas.layer, x, y), CanvasToLayerY(canvas.layer, x, y)

    canvas: paste sprite

    Sprite: move to layer oldLayer

    Sprite: set position to oldX, oldY

  • Same issue as dop2000. The forum is dog slow now. I get the idea that websites aren't Scirra's expertise.

  • It's the fx:

    It's used apart from the canvas plugin.

    The only useful action in the canvas plugin would be the "paste object" action. You could use it to stamp the sprites onto the canvas. You could then give the fx to the canvas. The paster plugin could be used instead, it's a bit different but solves some performance issues canvas had.

    Another option is to just have the sprites on a layer and have the layer have the fx.

  • If you're happy with a solid outline you could use the outline effect.

    For a dashed line you'd need to calculate the outline from the intersection of the shapes. The canvas plugin gives a way to draw it after you calculate it, or you could use a tiled background for each edge.

    It's not super trivial to calculate but a lot of solutions can be found online that can be adapted over.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound