Distance to line

@Sploreg said:
Yea as that AI steering class is now, it is really just a prototype. The API should change and the obstacle interface is really just something temporary.
I'm glad this is getting some attention, I think it can grow into something incredibly useful.


I will update with somewhat frequency, from time to time you'll see some news. But I'll make an annoucement when things are more close to be complete.

I have a question, how can steering behaviors solve this problems?

http://img6.imagebanana.com/img/8zhtt7h2/question.jpg

In both cases the vehicle must accept that he cannot reach the target and stop.

@ogerlord you need pathfinding for that. Steering will probably just cause it to walk through the points, but not stop. But that of course depends on the implementation.



@shirkit sweet. If you want help putting it into the AI package let me know. I can probably get you commit access to it too if you would like (if you can’t commit to it already).

@Sploreg

In my examples suddenly other vehicles arrived and block the path. Thus how can I change the steering implementation?

Well from the paper that this system is implemented on, it doesn’t really cover that. If you want options beyond just stopping or plowing through, then you need to re-compute a path. Or possibly turn the group of obstacles into one large one and avoid it as a whole.

@ogerlord said:
I have a question, how can steering behaviors solve this problems?

In both cases the vehicle must accept that he cannot reach the target and stop.


Can't, steering behaviors can't overcome the right problem. I'm developing the algorithm exactly to solve this problem. Let me try to explain the idea:

Steering behaviors are a cheap way of moving multiple units. They require really low resource. A* is a pathfinding algorithm that requires a one time run. In this time, it can calculate a path between 2 points at a high resource cost.

While the pure A* can only deal with the obstacles that are present on the moment it runs, the steering cannot see obstacles that are not "close". So, I'm going to unite them both.

By calculating a path with the A*, I'll find the shortest path between 2 points, avoid static obstacles like the two in the image (if they were avaliable at run time). Combined with steering behaviors, I'll allow to dynamic objects appear in the scene without needing to recalculate the hole path. My job is also to discover at wich point I'm going to need to re-run the A* again, because there may be any kind of dynamic obstacles, like the one presented on the image on the right. Imagine that target is 1000 times bigger than my unit. I need to discover a point to stop the steering (in this case, suposse he will go to the center) and re-run the A*, so he can avoid that obstacle.

@Sploreg I won't commit to the jME repo for now, I'm using a private repo atm. In the future, I think in 2-3 months I'll have something concrete to commit.

@ogerlord I'm doing exactly the work to know when to stop the steering.

Do you check the speed of the vehicle and when it becomes slow → stop?

No, I’m still trying to figure out this part. It’s really hard to guess when it’s time to recalculate the path. I have an idea, but the problem is how to implement it. It’s really difficult to implement it.

I guess the question really is how “foolproof” you want it.



I’d have some sort of threshold which triggers a recalculate and then apply a number of factors (weights and details for those factors needing work of course).



Obvious things to try as factors are:



Time - Re-running the A* in a background thread at regular intervals.

Deviation - If the steering runs you too far away from your previously plotted route

Validation - Do a quick forward scan along the route and look for blockages

? - Add more factors here :slight_smile:



There’s quite a lot of discussion on A* repathing available online - including algorithms for handling blockages on part of the route and replacing segments of it etc. Google should be able to find them.

It’s going to be something like that @zarch. I’m still planning how to do it. Because if I only set thresholds, it may recalculate in not needed times. I’m thinking in maybe a object shape detection and way blocking, but I think that’s going to be really expensive.

Virtually all computers are multi core these days so as long as you keep it away from the main rendering thread having something in the background running pathfinding isn’t going to impact anything.

I don’t want to put parallel processing in this early stage. Not necessary at all. Either way, it independs if it’s going to be multi-threaded or not, the library must work at least in single core, and can be expanded to multi-cores.