Jump to content

Phaser dynamic pathfinding demonstration


ForgeableSum
 Share

Recommended Posts

Dynamic pathfinding demonstration for a browser-based RTS game I'm working on called "Feudal Wars:"

 

wfYPnpI.gif

 

A separate grid/matrix is re-created each time a unit tries to find a new path. However, to save memory, the grid size is only as big as the distance between the units origin and destination. So two things are dynamic: the grid size and the possible walkable/unwalkable nodes which are different each time the grid is recreated.

A grid size that was only as big as it needed to be (instead of a grid size in proportion to the entire world) was necessary because the map sizes will be huge (like 10K x 10K huge). Also, the walkable/unwalkable nodes change frequently since the units move frequently, hence the grid needed to be recreated each time.

 

Color version without healthbars and debugging lines removed:

 

HardtofindHealthyDikdik.gif

 

If you're interested in the project, subscribe to the newsletter!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...