Jump to content
  • Advertisement
Sign in to follow this  
Tomolia

2D Tilemap pathfinding

This topic is 2591 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone!

May not be the right subforum so sorry if its not.

Anyways Im working on a little game of mine with a 2D tilemap.

I've implemented "click to move" and A* for pathfinding on my map.

Problem is that I dont want movement to be from tile to tile.

I would like to be able to click a few pixels from my character and move him there without him always going to the center of the tile I clicked on.

I guess one solution would be dividing my tiles into several smaller nodes for the pathfinding and thus making it less notisable but this would slow down the pathfinding I guess.

Anyone have any theory on how I could acomplish this or perhaps any links to share?

Thanks for any help!

/TL

Share this post


Link to post
Share on other sites
Advertisement
You could define offsets that they should move to within the tile. When you determine your path, just set the last way point to use the offset of where the mouse clicked within the tile. This could also be helpful, especially if you have objects that overlap portions of a tile, but not enough to make it impassible. That way they will move around the objects.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!