lolpaca's Forum Posts

  • Try this - just uses the built-in pathfinding behaviour set to a grid. Someone with better skills than me might be able to improve it :)

    dl.dropboxusercontent.com/u/106247621/LinearPathfinding.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • This seems to work OK and was quite simple to do - give it a try!

    dl.dropboxusercontent.com/u/106247621/LinearPathfinding.capx

    I thought it would have trouble handling non-45-degree diagonals, but the way I've done the player's movement seems to have taken care of that for me.

  • I'll give that a try now and report back...

  • Seems to be a lot of people asking this lately <img src="smileys/smiley4.gif" border="0" align="middle" /> What was your issue with the Rez's Astar one? I'm about to start a project that uses it, I've heard some people have problems with terrain costs, but that doesn't affect my project - is there anything else I should be aware of?

  • This is what i was originally using for a game i was making a while ago but i found a bug in the way it finds paths, you can check my thread here scirra.com/forum/turn-based-strategy-like-advance-wars-devlog_topic74453_page1.html

    I PM'd the author but didn't get a response.

    I think rexrainbox does another pathfinding object though.

    Sorry to hear you had to stop working on your game, that sucks :( Was the issue only with adding different terrain costs to the pathfinding? Because I don't plan to use terrain costs for my project, I just want grid-based pathfinding.

    Have had a bit of a play with the Rez one and it seems to be working well for what I need, and I'd rather use a plugin if possible (I downloaded yours and Rojohound's example but I'd have no idea where to start tinkering with it!) Did you have any other issues with Astar Pathfinding apart from terrain costs?

  • Thanks everyone - after a bit of looking around I found an Astar plugin which appears to be what I'm looking for. I'll have a play around with it and see how it goes. You can find it here:

    scirra.com/forum/plugins-behaviors-rez-repo_topic51087.html

  • In case that wasn't too clear, here's an example of how that movement would go:

    <img src="https://dl.dropboxusercontent.com/u/106247621/pathfindexample.jpg" border="0" />

    If I'm being stupid and there's already a simple way to do this, please let me know because I'd love to know!

  • Hey hey,

    I'd love to see a pathfinding behaviour that moves on a set 4-directional tiled grid. The current pathfinding behaviour doesn't work too well for that: even when turning off diagonal movement, rotate object and setting the cell side to the grid size etc, the sprite still 'drifts' around a few pixels as it moves. It also doesn't always end up on the exact tiled space it's going to - it'll often stop on the edge of a tile or a couple of tiles before it.

    In other words, a system like the pathfinding behaviour we have now, where it'll find the shortest path from point to point avoiding obstacles, but the sprite only ever moves on either the X or Y axis as it travels, never both at once. The movement nodes should all be set at evenly-spaced points on a grid defined by the user (eg, a 100x100 grid of 16x16-pixel tiles, etc) and the sprite travels precisely between each point.

    Hope I've explained well enough <img src="smileys/smiley4.gif" border="0" align="middle" /> Is something like that possible? This would be a great feature to have for tile-based games like turn-based strategy, roguelikes and other RPGs, as it'd take a lot of the headaches out of moving sprites around automatically.

  • I'm not sure you can with the pathfinding behaviour as it is - as you said, even with diagonals and rotations switched off and the cell size set to the grid size, it still seems to 'drift' quite a bit which just seems to be the way the behaviour's coded.

    You might need to make your own pathfinding behaviour, which is quite easy to do if you don't need any obstacles on your map, and quite complicated if you do :P

    EDIT - If anyone at Scirra's reading, a 4- or 8-direction-only pathfinding system would be ace for grid-based game <img src="smileys/smiley4.gif" border="0" align="middle" />

  • Alternatively, give the pathfinding behaviour to your enemy sprites (you can set it off by default) and when they need to walk aimlessly, set it on have them walk to a random valid point on the layout. When they reach their destination, repeat.

  • Anyone have any ideas? I've been reading through this guy's guide, which seems pretty solid - could anyone give me a hand on how to do this with arrays in Construct?

    roguebasin.com/index.php

  • Hey all,

    I've gone through these tutorials (http://www.scirra.com/forum/procedural-generation-using-the-miner-method_topic49493.html) (which are great, btw) on procedurally generating a 'cave'-type map, and now I want to try making a dungeon map - something with oblong rooms and connecting corridors, similar to the kind you get in Pixel Dungeon and other roguelikes.

    I saw someone had made a generator like this for Construct Classic (sorry, can't find the link right now, but I know it's around here somewhere) so I guess it must be possible in C2. Has anyone made an update for Construct 2, or could please give me some helpful information on where to get started? I'm still pretty new to using arrays to generate maps, but I'm finding it all super interesting and want to know more!

  • Hey, I think what you need is the "Pick by evaluate" condition - I asked something similar yesterday and there's a couple of helpful capx on my thread <img src="smileys/smiley4.gif" border="0" align="middle" />

    scirra.com/forum/test-if-true-for-each-instance-of-an-object_topic81125.html

  • As a PS to this, I found out that it won't set the variable to 0 if none of the objects have the condition; ie I guess it can't 'Pick by X' unless there's at least 1 object that's X. I got around this by adding "Else > Set [variable] to 0" after the event.

  • Brilliant, thanks so much both! <img src="smileys/smiley4.gif" border="0" align="middle" />