• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Aspirer

Advice to someone learning pathfinding?

6 posts in this topic

Just found out Unity's NavMeshes, etc. aren't available in the free edition, so I'm going to have to take to pathfinding the old fashion way--coding it myself.  This is going to be an entirely new endeavor for me. 

 

Any advice?  Like things to avoid doing, what topics are basics/which are advanced pathfinding topics, what I should definitely have an understanding of before jumping into it (theories, programming aspects, etc.)?

 

 

 

Also, just out of curiosity, is this the hardest part of AI programming? If not, what do you think is?

0

Share this post


Link to post
Share on other sites

All depends on how much performance/precision you need.

 

Notice that a pathfinding algorithm is one thing and navmesh is another entirely different thing.

The most popular pathfinding algorithm (and the fastest known) is A*, you may find a very detailed tutorial of how it works here:

- http://www.policyalmanac.org/games/aStarTutorial.htm

 

A* algorithm is a little complicated, but you will be able to code it yourself without any major issue if you dedicate some time to it. You will also find it coded in a lot of places (my own blog has a C version of it). Most versions are not top optimized, but they may be fast enough for your needs.

 

About the navmesh, A* works on any graph and navmesh is just a graph very well known for being efficient in the representation of game spaces. It is also pretty complicated to create. There is an opensource program that creates navmeshes, its name is recast, you may find it here:

- https://github.com/memononen/recastnavigation

 

And a great study of how it works here:

- http://www.critterai.org/book/export/html/2

 

You should keep in mind that you can use much simpler approachs, such as A* with a grid (which is a matrix telling where your character can move and where it can't). It is a very simple solution that may be fast enough for your needs.

 

Of your last question, depends on what AI/pathfinding you want to implement. If your AI is a monster that walk to a character, attacks and use a spell with 30% chance per second, and you want to use Heap optimized A* with navmeshs then yes, this will be the worst part. If you want your monster to adapt to 30 different character behaviors, analizing possibilities with heuristics and you plan to use a simple A* implementation with grids, then no, it won't be.

1

Share this post


Link to post
Share on other sites

Ooo nice. The previous poster all had great stuff for your pathfinding problem. What I'd mention for advice is that Unity has LOTS of stuff in the asset store for pathfinding (You are NOT the first person to have this problem). And the most difficult AI I've ever had to learn about and use in games is probably neural networking.

 

http://en.wikipedia.org/wiki/Artificial_neural_network

 

Ps. If you want some AI Tutorials we actually did a huge AI tutorial (Using the Strategy AI pattern) for promoting our project whose goal is to teach people game development. Myself and one of my lead programmers focused on AI in school and in the industry so it's something we really enjoy =). 

 

Edit: I thought Unity supported NavMesh obstacles for the free version. Can you not use these: 

 

http://docs.unity3d.com/Documentation/Components/class-NavMeshObstacle.html

Edited by colonycapture
0

Share this post


Link to post
Share on other sites

Basic pathfinding is actually fairly easy, and mostly agnostic to what you are navigating on (Navmesh, grid, hexes)

 

If you're worried about it being complex, or just want to get something running and have it be fairly fast, just use aron granberg's stuff.  I was able to get it running really quickly with the documentation and samples he has, and had 30+ things pathfinding in real time without issue.  You may find that the tile/grid stuff will work just fine for you.

 

If you end up wanting a more complicated motion planning scheme (Directional or turn radius, physics constrained, etc), you'll end up needing to do it yourself.  But that's probably way more than you need, depending on what you're doing.  (I've done this too, and if you want me to expand on it I can)

Edited by ferrous
1

Share this post


Link to post
Share on other sites

Well, honestly, unless you really want to have an object with a turn radius, I would shy away from it, as the code is much more complex than other stuff out there.

http://www.gamasutra.com/blogs/MatthewKlingensmith/20130907/199787/Overview_of_Motion_Planning.php has a good overview of the various methods, but if you just want to do a game like Final Fantasy Tactics, or X-com, that's all overkill.  Heck, even a lot of RTS games don't go that far.  (Notably, SupCom uses flow fields, and the Relic vehicles use a form of Dubin's Car I believe.)  But Starcraft, for example, doesn't do anything fancy beyond a tilegrid.  EDIT:  Not to imply that the pathfinding and AI in SC is simple.

 

A directional component, on the other hand, isn't all that bad.  For example, in Space Hulk (Tabletop or recent PC/iOS release), the direction that the character faces matters, and turning a square facing costs a point.  To add that, all you really have to do is add that to the cost function, and keep track of what facing the character would be in at a tile/node in addition to the position.   

Edited by ferrous
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0