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

Steering behavior and grid AStar pathfinding

9 posts in this topic

I want to make a RTS geme use steering behavior and grid astar pathfinding, but I don't know how to handle the wall avoidance. For example, path following behavior, how to avoid the wall? There are many blocked grids, they may be the wall.
Thanks! Edited by xiongyouyi
0

Share this post


Link to post
Share on other sites
[quote name='xiongyouyi' timestamp='1341986673' post='4957903']
I want to make a RTS geme use steering behavior and grid astar pathfinding, but I don't know how to handle the wall avoidance. For example, path following behavior, how to avoid the wall? There are many blocked grids, they may be the wall.
Thanks!
[/quote]
The first idea is, that the path is not blocked. But this is often not the case (i.e. some other unit standing on the path), but at least it should not be blocked by static objects.

I have the following approach to solve navigation:
1. Calculate a path using A* .
2. Steer your entiy along the path using a [i]combination [/i]of different [url="http://www.red3d.com/cwr/steer/"]steering behaviours [/url]like path following, obstacle avoidance, flocking etc..
3. Use some problem tracker to check if your entity runs into problems (i.e. velocity dropped to a creep for several seconds). If an issue occurs then start an emergency behaviour (recalculate path and try again, spawn to closest valid waypoint, kill unit etc.)
0

Share this post


Link to post
Share on other sites
[quote name='Ashaman73' timestamp='1341990896' post='4957916']
[quote name='xiongyouyi' timestamp='1341986673' post='4957903']
I want to make a RTS geme use steering behavior and grid astar pathfinding, but I don't know how to handle the wall avoidance. For example, path following behavior, how to avoid the wall? There are many blocked grids, they may be the wall.
Thanks!
[/quote]
The first idea is, that the path is not blocked. But this is often not the case (i.e. some other unit standing on the path), but at least it should not be blocked by static objects.

I have the following approach to solve navigation:
1. Calculate a path using A* .
2. Steer your entiy along the path using a [i]combination [/i]of different [url="http://www.red3d.com/cwr/steer/"]steering behaviours[/url]like path following, obstacle avoidance, flocking etc..
3. Use some problem tracker to check if your entity runs into problems (i.e. velocity dropped to a creep for several seconds). If an issue occurs then start an emergency behaviour (recalculate path and try again, spawn to closest valid waypoint, kill unit etc.)
[/quote]

How to avoid the wall? Because the wall is grid cell, there are so many cells, check them all?
0

Share this post


Link to post
Share on other sites
Maybe my question is not clear. I want to implement Crowd path following behavior, like this [url="http://www.red3d.com/cwr/steer/CrowdPath.html"]http://www.red3d.com/cwr/steer/CrowdPath.html[/url]
So, first i need use Astar to find a path with width, then use steering behavior to avoid other agents and the wall. The question is, how could I find a path with width?
0

Share this post


Link to post
Share on other sites
Maybe you want the agents to follow a path without getting too far from the segments of the path that connects the nodes, is that it?
The example you posted shows a behaviour that seems just to perform a clamping of the agents positions against walls.
If you need the agents to follow the path having their distance from the current path segment be less than an amount,
you need just to define which is the current path segment and the distance from the agent.
Compute the closest node to the agent
find the graph links _in the path_ that share that node
have the distance of the agent be less than an amount for one or both of the graph link just found and beware of "corners" as shown in this figure
[url="http://i.imgur.com/jmpPK.jpg"]http://i.imgur.com/jmpPK.jpg[/url]
(the red lines are the path segments normals, the blue lines are the imaginary walls that define your path width, the red ugly circles are the wrong agents positions, as you can see those agents in the corners shall compute their distance from the walls carefully)
Just kindly check this strategy because I am not 100% sure it will find the correct path segments from which to measure the agent distance.

Let me know if I understood correctly.
0

Share this post


Link to post
Share on other sites
In steering behavior, it need avoid collision from other agents and walls, the question is i don't know how to define the [color=#ff0000][b]wall [/b][/color]in grid map.
0

Share this post


Link to post
Share on other sites
Are these walls defined when an agent computes the path?
Are they defining the maximum distance from the path that an agent must follow (path with a width)?
If yes,
you shift the path segments alongside their normal (both ways) and then change the extreme of these segments using the intersection with the lines passing through the extremes of the adjacent segments in order to roughly fill the gaps that creates (like the picture I posted before).
Does this help?
0

Share this post


Link to post
Share on other sites
Thank you! Please take a look at this picture
[url="http://postimage.org/image/borep2zz3/"]http://postimage.org/image/borep2zz3/[/url]

When a crowd agents move from red point to yellow point, the agent need avoid collision from the wall(the black block), should i raycast all the black blocks?
0

Share this post


Link to post
Share on other sites
I guess you will need to.
Actually I think ( I am not 100% sure ) you should cast a circle (or a box) which is slightly more complicated. What you do in this case however, is enlarge the walls by the agent radius obtaining a sort of rounded walls (the corners of the inflated walls will be filled with arcs), and then cast a ray against them; the ray shall have length = distance_of_wall_detection (which could be current_velocity * time_of_prediction). You will need segment to segment intersections and segment to circle intersection
( [url="http://www.gamedev.net/topic/304578-finite-line-circle-intersection/"]http://www.gamedev.n...e-intersection/[/url] )
By the way, (I am saying this just not to let anything out) do you connect the node of the graph based only on the criterion that two adjacent cells are passable?
If yes you should instead cast a box as large as a gridcell (or as large as an agent bounding box) towards an adjacent cell and connect them only if no intersection with any static obstacle occurred. In this way the smoothed path you showed might not be computed: the agent will go up to the cell with the value = 2 and the steer by 90° towards the goal.
I hope this helps. Edited by Tannerd
0

Share this post


Link to post
Share on other sites
It's so complicated! I will think about NavMesh, NavMesh return the result triangle channel, the edge of the channel will be wall, so it will be easier to integrate with steering behavior. And we use lockstep simulation in our rts, there will be thirty units request pathfinding in a single logic frame, 512X512 grid Astar maybe inefficient.
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