• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by wharris84 · Feb 27, 2014 at 04:56 PM · 2dpathfindingtiles

Pathfinding solutions for 2D Dungeon Keeper style game

I'm working with a small team on a dwarf fortress/dungeon keeper style game. We have some experience writing A* algorithms for other projects. We have not been 100% happy with the results and would like to use something built in to Unity or code that is available on the web.

The game map is a grid exactly like dungeon keeper where grid squares are made dynamically walk-able by being mined or dug out. This seems to rule out Unity's navmesh because it is baked at design time and not run time (unless the nav mesh can be applied to an individual grid square and agents can pass over a network of different nav meshes).

Is A* Pathfinding Project overkill for this? Does anybody know of an example or tutorial that covered a very similar example?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Keith_C · Oct 21, 2016 at 03:23 AM 0
Share

@wharris84 did this game ever go anywhere? Just curious how far you guys got. I'd love to know.

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by KrisSchnee · Mar 13, 2014 at 04:15 AM

Seconding Levocakes. The A* algorithm is pretty simple to implement. Here's my code for it in Python (public domain):

http://kschnee.xepher.net/code/080721a_star_pathfinding.zip

The code uses the Pygame library to draw graphics, but you can ignore that and just look at the AStar class. Should be possible to adapt that to Boo or just copy the concept of it.

A* assumes complete knowledge of the terrain, but you can pass that info along to the algorithm whenever you want to run it, even during run-time.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Levocakes · Feb 27, 2014 at 06:54 PM

I have never used NavMesh before because it is only available in Unity Pro like DubStepDragon said. I had to implement A* into my FPS just a couple days ago. I think A* would be a perfect idea for your game and it would not be overkill. At the start of your game you would have defined nodes and when a block gets removed it would add to the node list of walkable area.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by DubstepDragon · Feb 27, 2014 at 05:02 PM

Perhaps you can use the NavMesh pathfinding system. It's built for Unity Pro only though :/

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Maxwell.deangelis · Feb 27, 2014 at 05:37 PM 0
Share

I don't have much experience with the Nav$$anonymous$$esh, but my understanding is that it cannot be modified dynamically while the game is running. Is that correct?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

26 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Enemy Movement AI in top-down, 2D, tile & turn based game 1 Answer

How do I implement A* pathfinding to my 2d game, without tiles? 4 Answers

Array of Tilemaps misbehaving 1 Answer

Making 2D Tilemap Areas Impassible During Runtime? 0 Answers

Make Tiled Sprite expand in all directions 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges