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

Calculating arrival with soft turn (help!)

13 posts in this topic

So, we have a mobile that behaves very much like a car, with some rules simplified.

 

The mobile has a maximum turning speed and a turning acceleration, this goes to both directions of the car relative to its forward vector.

It also has a top forward speed, which is limited to a linear interpolation between the maximum in straight line and the maximum while using top turning speed.

In order to reach this top speed and to stop it has an acceleration as well, considered to be constant.

Unlike a car, we are not meant to move backwards.

 

For the purposes of this task we are in a wide open empty parking lot, so room to move and manouver is plenty, we start in a given position facing a given angle and we are given the goal of arriving at another specific spot at another specific orientation.

This goal may very well be to end up standing in the same spot but facing the opposite direction.

Acceleration and speeds for both translation and rotation will make the beggining of our movement process look very nice, but arrival is more complicated, we need to arrive from a specific direction in order to end up looking in the angle we were given.

 

My first instinct is to try to extrapolate the arrival turn from the goal backwards, but I have no idea how to do this mathematically. Formulas? hints? alternative solutions? it needs to look soft and obey the rules stated above.

Acceleration and deceleration may have different magnitudes.

0

Share this post


Link to post
Share on other sites

Oh, I forgot to post a link to [url="http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-832-underactuated-robotics-spring-2009/video-lectures/lecture-5-numerical-optimal-control-dynamic-programming/"]this lecture on the subject[/url]. It's hard to get through the notation at the beginning (perhaps watching the previous lectures would help with that). But then there are some neat examples where the state is 2D and the actions are 1D (so you can make neat images to represent both the optimal policy and the value function).

0

Share this post


Link to post
Share on other sites

I just came up with an idea that has potential, Given a starting linear velocity, angular velocity and their respective accelerations, if the mobile were to turn and decelerate (regardles of a target) it would descrive an inward spiral, which has a center (that must be aligned with our target) and an entry radius, if I can calculate that radius based on the mobile's current kinematic parameters and steer it towards the center offseted by the radius in a perpendicular direction to the mobile's heading, it would enter by the tangent of the spiral.

Once the mobile reaches the entry tangent, it changes its behavior from seek to arrive, steering and decelerating towards the target, it should reach it with a very small margin of error that can be compensated easily.

Any idea what would be the formula of the radius? I know that for linear movement with a final speed of 0 the traveled distance is d = (So * So) / (2 * a)
d being distance, So being initial speed at the moment of evaluation and a being constant acceleration, I'm looking up angular movement to see if I can figure out a similar formula that gives me the entry tangent radius.

0

Share this post


Link to post
Share on other sites

Hmmm, though this will make the mobile arrive at the target from a spiral, it doesn't solve heading arrival (arriving to the target position from a specific heading as well), but if we can calculate the entry spiral, we can force it to be oriented in such a way that the final heading is as desired, and then force the entry tangent and radius to satisfy that condition as well, question is how.

0

Share this post


Link to post
Share on other sites

Another way to do this my coleagues and I thought of, that aproximates the previous idea well enough and might even take other things into consideration (obstacle evation and other movement rules) is to simulate an anti-mobile, that starts at the target and tries to get to our mobile, with the same parameters our mobile should use on arrival, deceleration speed, turning angle and so on, each frame our mobile moves towards the anti-mobile instead of the final target, and the anti-mobile moves toward the mobile.

 

Once the path of the mobile towards the anti-mobile requires no steering (both mobiles are moving in a colinear fashion), we stop moving the anti-movile, and once the mobile catches up with the anti-mobile, our mobile tries to move to the target, but from a state that favors a good arrival trayectory.

 

Does this make sense?

0

Share this post


Link to post
Share on other sites

A couple of ideas, if it helps:

 

- How would you steer the vehicle yourself to reach the goal? If you analyze the steps you would take when steering the vehicle, your reasoning behind it, it could be a guide to modelling this behaviour.

 

- Resort to AI: http://www.red3d.com/cwr/steer/

Look for the "arrival" sample. It doesn't take as many parameters as you want, but it's a start.

It's part of the OpenSteer library, and the logic behind the "arrival" sample is described here.

0

Share this post


Link to post
Share on other sites

I already have arrive implemented, and the mobiles do arrive and slow down at target, the problem is when you want them to end up looking with a specific direction and you don't want them to reorientate after arriving, but rather come softly from behind the desired heading.

 

I'm already using steering behaviors for this.

 

The target ghost boid as I've come to call it seems a promising approach, though it still needs tweaking.

0

Share this post


Link to post
Share on other sites

I think this is similar to the "Piano Movers Problem".  It is motion planning / pathfinding with lot's of degrees of freedom. 

 

This article touches on some of the methods (See configuration space part).

http://www.gamasutra.com/blogs/MattKlingensmith/20130907/199787/Overview_of_Motion_Planning.php?print=1

 

Beyond giving you some search terms and links, I can't be much more help as this is kind of over my head, though...

 

Good luck.

0

Share this post


Link to post
Share on other sites

The target ghost worked quite well, its not perfect and its subject to a fine tuning of the kinematic parameters of the mobiles, but gives out a nice effect for what I wanted,
A more precise method would probably exist but I don't need to dig deeper at this moment.

For reference, the idea is to create a ghost mobile starting on the target position and orientation and having it move backwards based on the same logic used to move forwad with some reversed signs and considerations, the positive and negative boids are aligned you can move on to follow the target directly and arrival should do the rest quite nicely.

0

Share this post


Link to post
Share on other sites

Interesting stuff, I started digging into a similar issue, and it really is quite complicated.  If you get a sample working, I'd love to see a video.

0

Share this post


Link to post
Share on other sites

I'm thinking of putting together an article for flocking and steering behaviors, the working code I have now I cannot share due to contractual obligations but I can make something on the outside and get a working demo of the technique.

1

Share this post


Link to post
Share on other sites

Would it be possible to spawn more of the ghosts and have them follow different paths? This might let you find an optimal path in less time but will of course be slow.

0

Share this post


Link to post
Share on other sites

Would it be possible to spawn more of the ghosts and have them follow different paths? This might let you find an optimal path in less time but will of course be slow.

 

I believe that's how several research papers do it for motion planning.  (the gama article links to them)

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