Prominent's Forum Posts

  • I get about 20 fps on the first one. It'd be better if you had a side by side comparison.

  • I experimented a bit, but didn't find any solutions. The issue I was facing is how to manage which unit attempts to go through the pathway first so that units don't compete with each other.

    This would require more work to figure out than I'm willing to invest, since it basically means designing a way to store where each unit is, and how to process all of it so that they work with each other to get through.

    One thing that comes to mind is using a dijkstra map instead of pathfinding, since that creates data that multiple units can use to move through a level. That way, each unit would have their own way of finding a path to the destination without generating one for each unit.

    edit: also with a dijkstra map, the units would be moving towards the next tile rather than being pulled by something that could be currently behind a wall, so the flow of forces would be more accurate. You could also stop other units from trying to get to a tile if that tile is already occupied by another unit.

  • megatronx , I would probably try to cycle through the nodes, finding the node closest to the destination that is in the line of sight with the unit.

    So I would check the last node to see if it is in sight, then continue with each consecutive node until it gets to a node it can see. I'd only do this if the object collides with a wall. Apply a force towards the node that is in sight.

    If two units are fighting over a node, I would somehow apply force to only one of them (maybe the one closest to the destination)..

    I'll try experimenting a little, but it might be something that requires more time to get right, and not sure if I can do too much.

  • edit@ R0J0hound The Prominent example doesn't seam to work https://www.dropbox.com/s/9286l0hy9pp9etk/tst.capx?dl=0

    I fixed your capx: http://1drv.ms/1P1WOhr

    You were doing various things wrong.

    You set the joint at 0x0y of the layout(not the object).

    You also have to move the object to the pathfinding object first before connecting them I think.

    You had the object all on the same physics layer, so they were colliding.

    I also, changed the joint type to a dampened spring, adjust the mass of the blue objects, dampened their velocities so they don't stay springy..

    Also changed them to circles which should help with collisions, but might be fine either way.

    ..You might also want to consider putting these into a family and put the physics behavior on the family, in-case you plan to have multiple sprites/objects using physics together.

  • setting invisible won't draw the object, but if it is set visible and has opacity set to 0, it will still draw it even though you won't see it. Setting it to invisible is better for optimizing.

  • I'm unsure of the purpose of the force though.

    force was just to negate gravity, but I suppose the gravity could be turned off instead. Could probably also use different type of joint if you want it more springy. I don't know what would happen if you have multiple objects trying to pass each other, etc. They would probably bump into each other and try to get around- so a circular shaped physics object would help prevent them getting stuck. You could probably stop the path movement if a physics object gets too far away, to allow it to catch up, or even perform some other operation to walk through other objects, like changing the physics group it is in temporarily.

  • I just tried and found a way to pull the physics object, I posted it in your other thread megatronx

  • You can attach the physics object to another physics object via a joint, and move one like so:

    also make sure the objects don't collide with each other.

    Then you would just move the object that needs to follow a path, and the physics object attached will get pulled.

    edit: the 10*sprite2.mass stuff should be 100 instead of 10.

  • can't check for new posts anymore. just shows spam:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • heh.. look at the graph on the forum main page that shows the number of posts in the last 30 days, and it has skyrocketed the last day. The forum is flooded.

  • , That's why I said make a game that will sell first.

  • Ah cool, thanks for breaking that stuff down, I think I'm grasping the situation a bit more.

    This chipmunk behavior is really great, I have had a lot of fun experimenting with it and I'm looking forward to any new progress you make with it!

  • Just thought I'd mention that you can do loopindex("loopheight") to get the value of a specific loop. That way you won't have to store those values in local variables.

  • I think the implementation of those two lines updates the two objects that collided. I don't think it relates to any joined objects in that case. At least, that is the impression I get.

    A list of situations would be interesting- the only place I've ran into the problem has been when objects are colliding, but I suppose there could be other situations too.

    Maybe I've ran into the problem in other situations but didn't notice it or maybe I overlooked it.

  • Yea, I agree, this would be a useful feature.