SoldjahBoy's Forum Posts

  • Yeah I think the tutorial that mekonbekon linked is probably a good place to start. You can use that fluid idea, coupled with physics behaviour to make a fairly convincing liquid. It's been a popular and clever technique around here for some time now

    ~Sol

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your image link appears to be broken, and points to some weird file with a file extension that's not even an image type.

    Please check that your link is valid.

    ~Sol

  • Ah ok, I will test that out and see if it works. Thanks for the help R0J0hound as always!

    ~Sol

  • It should be something like:

    NWjs.UserFolder & "\example\test\filename.txt"

    make sure you put the quotation marks around the path, and begin with backslash. You should also be able to just straight up put a path in there like "C:\myfolder\whatever.file"

    Hopefully this helps

    ~Sol

  • Hi mahdy

    I think you can just check for the Y position of the ragdoll... if it falls below the bottom of the screen then they player has "missed" it. You will probably want to make some instance variable for the ragdoll, so when the player DOES hit it, you can set a variable to "true" or something like that.

    If the ragdoll Y position is greater than layout.height+ragdoll.height AND the variable equals "false" (or player hasn't touched it) then you can count this as "missed".

    Hopefully this will give you some helpful method to try

    ~Sol

  • > What pathfinding cell size are you using? Is there enough "space" between your objects for the characters to properly and easily fit through? Have you tried running a quick function for "regen obstacle map around sprite.object" to see if that helps?

    >

    > Those are just the first few things I can think of that may be causing an issue.

    >

    > *EDIT*

    > I just watched your video link. The lag doesn't seem super noticable to me but I can see a tiny bit of jank. How many enemies in total are in the layout and how big is your layout? Large layouts will cause jank when using pathfinding because of the sheer amount of calculations gets exponentially increased as the layout size gets larger. Also, lots of objects calculating paths all at one time can cause this.

    >

    > ~Sol

    >

    I'll try those suggestions you have, but I'm not sure if they will do anything considering you mentioned that lag can happen with large layouts and lots of enemies. My game has a layout size of 1708 x 1708 and is a wave / horde survival shooter kind of game. At max there are maybe 30 enemies? And at least there is 9 so I'm not sure if that is what is making the lag so bad but it probably is. Not really sure what qualifies as a "large layout" that is large enough to create lag.

    I'm working on some pathfinding type stuff right now as well, on a layout of 2000x2000 and up to 60 or so pathfinders.... and I don't get this lag. It's possible that I'm doing something differently to you, like offsetting the path calculations for the entities so they aren't all trying to find paths at the exact same time. I'm also using a cell size of 64, so it's also possibly related. I think the key to getting a good setup is the ratio between the actual layout size vs your cell size. Your layout could be 50,000px big if your cell size is say, 500px big.

    I'm not sure what else to suggest exactly, but maybe try playing around with the cell sizes and such - and make sure enemies aren't trying to re-calculate a path all at the same time. I simply made it so if the enemy is already moving along a path, to only calculate a new path every couple of seconds versus if they aren't moving at all to check more frequently (for faster initial response).

    Hope you figure it out.... seems like a bit of a weird problem. Also check the collision boxes for your enemies and objects and make sure they aren't too complicated. Having a complex collision polygon can cause a lot of lag as well when trying to figure out paths.

    ~Sol

  • If I understand your question properly... you should be able to write any file path into the nwjs save function. The only issue will be if you try to save to any system protected folders (like windows directory) but should be fine anywhere else.

    ~Sol

  • I did this before in my cellular automata cave generator. The solution was fairly simple... I did a "for each tile" loop and check for overlap at offset each surrounding tile... and did a comparison of an instance variable for each tile (I used a variable to keep record of the type of tile in that particular place).

    As Oos said, it's called bitwise method. The tricky part happens when you might have tiles next to each other that you want to behave differently than the method would do by default.

    ~Sol

  • Can you post your capx? Or can you produce the problem again in a simple capx example? I think someone will have to look at the exact reason before we can make a solution for you.

    ~Sol

  • What pathfinding cell size are you using? Is there enough "space" between your objects for the characters to properly and easily fit through? Have you tried running a quick function for "regen obstacle map around sprite.object" to see if that helps?

    Those are just the first few things I can think of that may be causing an issue.

    *EDIT*

    I just watched your video link. The lag doesn't seem super noticable to me but I can see a tiny bit of jank. How many enemies in total are in the layout and how big is your layout? Large layouts will cause jank when using pathfinding because of the sheer amount of calculations gets exponentially increased as the layout size gets larger. Also, lots of objects calculating paths all at one time can cause this.

    ~Sol

  • Awesome stuff! Glad that I could be helpful... everyone knows I ask enough questions myself still, lol!

    ~Sol

  • Thanks R0J0hound

    I actually figured out what I was doing wrong but will take a look at your example anyway since you probably do it better

    I am still having one issue though... if I move the canvas at all during runtime, it moves/draws in an unexpected way. I have made an event that simply places the canvas to viewportleft and viewporttop (also tried using my camera obects coordinates as another way) but the canvas sems to move *beyond* the intended location... as in, when i move down, the canvas seems to move down (or right) as well but PLUS extra distance. The further I move, the more out of whack it gets. Any idea why it's not setting the position to viewport? I'm clearing the paths and lines every tick and redrawing on it, so I don't think it's a case of misaligned buffer.

    ~Sol

  • R0J0hound

    I'm actually having this same issue... I'm not using the latest beta of C2 though. Can you confirm that canvas is still working from R242 and up?

    I tried drawing a line, and filling a path... and nada. Just blank :/

    Cheers

    *EDIT*

    I removed the anchor behaviour I had on the canvas and the line started drawing... path still not filling but maybe I'm doing something wrong there. Well, using anchor certainly causes an issue at least, lol. I'll try moving it manually and see if the problem returns or not.

    ~Sol

  • A tip I can give you for using boids, is to use the boids behaviour on a "ghost object" - and then get it's coordinate data, or whatever else you need from it, and apply that to your actual object.

    In my current protoytpe, I have made a group of "dudes" follow the main player "dude". I have some ghost boid objects that flock with the player constantly, and use pathfinding to reach the desired boid location. Each "dude" has his own instance of a boid "node" that is always following the player. In this way, I get the flocked-style "formation" while using path finding, while avoiding having everything pile up in a pixel perfect mountain of identical sprites.... BUT still have the ability to navigate intelligently.

    I have found boids a little... constraining to work with. I have also had some issues implementing rex's boids behaviour as well... but in the end I found the original one a little more straight forward to use, and by using "ghosts" I was able to do exactly what I wanted while maintaining direct control over my actual sprite "dudes".

    ~Sol

  • You may find it easiest to use physics with joints. You can spawn each rope section where you want it, and pin the joints together in a single function call.

    It depends how detailed you want these ropes to be, and how many you want to have on-screen at once... but you should easily be able to have quite a few ropes doing it just with physics. If you want to try IK chains, that's a fair bit more difficult - but there are tutorials on the forums for IK solvers.

    ~Sol