Pathfinding Stepping Stones

0 favourites
  • 13 posts
From the Asset Store
In 2D realistic stones are included high quality realistic 18 stones/rocks.
  • Howdy,

    First off i want to say that this was a much more thorough explanation of my issue before my login session expired and i had to come back here and type it again <img src="smileys/smiley7.gif" border="0" align="middle" />.

    So my issue is that I am trying to have the player build a dynamic bridge from one island to another, as the bridge is built i want the sprite to search for a path from one island to the other treating the tiled background beneath like a solid obstacle and only crossing bridge pieces placed over the bridge, and their z-index was higher than the backgrounds. The issue is that the tiled background stops the sprite from moving at all.

    -edit

    I have gone ahead and attempted to include a picture as an example of what I am talking about below.

    <img src="http://i763.photobucket.com/albums/xx279/revap121/Example_zpsa4690c4b.png" border="0" />

    Any help would be Greatly appreciated, Thanks.

  • Anyone Got any ideas?

  • Tiled background set to solid?

  • Yep, i set the background as solid and it just stops the Sprite from finding any path, if you delete the background he will find a path.. but not using the blocks.

    here is an example

    dropbox.com/s/0oqg8f0d5j4ndh8/Bridge%20Example.capx

  • It shouldn't be set to solid is what I meant. Have you checked pathfinding when it isn't a solid?

  • Without it set as solid he just moves across the water, ignoring the path the player has made.

  • You could create a grid of invisible solid sprites over the water and when the player puts down a bridge tile you destroy the solid tile under it.

  • You could create a grid of invisible solid sprites over the water and when the player puts down a bridge tile you destroy the solid tile under it.

    agree. the solid blocks work well as obstacles so just have them invisible and then destroy when a path block is built.

  • Hmm.. Ill give it a try, Would a bunch of invisible blocks consume a ton of memory on a mobile device?

  • I have heard that it's more the number of events that fills memory and it doesn't matter how many layouts you have so if you have a large number of blocks across multiple levels it should be fine. You can always export for mobile to test.

    Also it was not really mentioned how the building will work but if it's one bridge instantly built then you could always set up some logic to create invisible blocks around the bridge once it's built.

  • I'm not an expert, but wouldn't a 2px x 2px transparent PNG work nicely? It's small in size, you can upscale it to whatever size you want and the quality won't matter because you can make it invisible to the player.

  • Well the basic principle is the blocks slide in from the top kinda like tetris, so as they are falling they are going to go over a bunch of the invisible blocks and destroy them all :/

    I'm not an expert, but wouldn't a 2px x 2px transparent PNG work nicely? It's small in size, you can upscale it to whatever size you want and the quality won't matter because you can make it invisible to the player.

    • Yeah that definitely seems like an easy way to do it. And if i can figure out a way to automatically fill the map with them it would be even better.
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ramones solution is what i would have suggested as well

    Solid disables if obstacle is overlapping grid :D

    (always regenerate obstacle map after you change something)

    so, actually whats dynamic is not the bridge, but the obstacles =)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)