• 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
piterh1

A* Pathfinding and Collision Detection

5 posts in this topic

Hi,

I am currently working on a project for university and I have a couple of questions regarding collision detection. I am trying to change the A* algorithm so that instead of walking around obstacles it will be able to jump over the ones that can be jumped over. If you can't answer all the questions then please atleast answer the ones you know, it would help me greatly. Ok so here are the questions:

How is collision detection usually processed in games, do the objects all have bounding boxes for quick checks and more complex shapes for more accurate collision detection?

How do you check for collision with terrain, things like steep hills or a terrain wall?

How do you check for collision against invisible walls, are those just simple if < or > statements?

I need to know those things because if I am going to integrate the jumping ability into the pathfinding algorithm I need to check the trajectory of the jump so that the character doesn't collide with anything. Possible obstacles include holes, small objects, high objects, thin walls and obstacles on the jumping path.

Since I have no experience in writing AAA games I would really appreciate any information on how collision detection is done in those games so that I can make my project as professional as possible.

Thank you for your time :)
0

Share this post


Link to post
Share on other sites
As Dave Mark said, you want to put as much of that connectivity information in your A* graph as possible. That means that your AI will rarely pick bad paths that can't be completed. It also potentially makes the game run faster because you did the checking in advance of runtime. It also allows you to easily handle things like ledges that you can jump off but not climb back up (one way edges), ledges that you can climb (you can traverse it, but the cost of climbing is higher than the cost of walking), etc.

The more physics and collision related stuff can be a pain, e.g. technically you can jump somewhere but in practice the character's head would hit a projection on the ceiling. There's a fine line between what belongs in pathfinding vs steering, and also between what glitches you allow and which you care about. I'm sure many games allow a character animation to momentarily pass through solid objects, even though the core of the character never does. The last thing you want is for a character's limb to get stuck on something and leave the game unplayable. That's one reason why simple collision shapes such as capsules are often used.
0

Share this post


Link to post
Share on other sites
First of all, thank you for the replies. I am focusing on static obstacles but maybe I should look into dynamic ones aswell to add some value to the project.

As Dave mentioned marking the points where the character can jump is the best option and I've already thought about it. However, if I just state that on my report I doubt I would get a good mark so I want to research other methods that find the jumping points without supervision. With this I would be able to say that, "I've looked at different ways of doing that such as this, this and this and I've concluded that this one is the most efficient...".

Jeffery, thank you for the information, I didn't think about things like allowing the character to pass through objects up to some extent but this will definitely help me with the project.
0

Share this post


Link to post
Share on other sites
You could start with creating automatic links by making basic assumptions from the character's capabilities. For example, is the height difference between two cells <= the max height a character can climb? Would the fall from one cell to another cause the loss of less than all of the character's health? Using simple parabolic equations is it possible for the character to jump from one cell to the other at max speed and jump?

Once you have fulfilled the raw physical constraints you can start getting fancy. Reduce the level to a heightfield or voxels. For the jump situation is the lowest point between source and destination lower than the highest point of the character's jump? You can come up with lots of rules of thumb to whittle down the possibilities. They can err on the side of optimism or pessimism. If you err on the side of optimism, it may be an idea to dynamically alter the weights of edges every time you attempt a traversal which fails, e.g. you miss the jump. Otherwise your character will merrily leap off that cliff again and again and look like a broken robot.
0

Share this post


Link to post
Share on other sites
@jefferytitan The thing is I want the character to always be able to follow the path my algorithm finds so I can't have him fall or something. So in order to check whether the obstacle or hole can be jumped over I need to do collision detection on the path of that jump (apart from checking terrain height on both sides). I can't think of any other way to find out whether there is another obstacle on the jump's trajectory.

Well moving on, I have another question.

Is it possible to open new threads from within a thread?

I am thinking about running the A* and when it finds an obstacle that can be jumped over it will spawn another A* search on the other side (to see if it's not a dead end) while continuing with the first one. I know this will probably be useless because of the speed but I still want to try it.
0

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