x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Pathfinding for Horizontal+Vertical Spline-Based Race Tracks

Hello everyone. Sorry if it's the question that has already been answered somewhere on the forum, but I really couldn't find any more-or-less complete answer to this. So I'm working on Trackmania-style racing game, but with anti-gravity physics (meaning that there's no gravity for a vehicle while it's on track, only a magnetic connection between the track and the vehicle itself). It is a C++-based project, with majority of complex components like the track constructor and anti-gravity vehicles implemented in C++. And now I'm collecting various info I need for vehicles' AI implementation. Based on other posts here on forum, I do know that NavMesh generator volume does not support vertical surfaces - or rather, as I've discovered, surfaces with more than 45 angle to the 'Z' plane. But in the case of my project, the race track may have many vertical/diagonal sections. NavMesh is not generated for them, apparently because Recast algorithm operates on flat surfaces, which these segments are oblviously not. Examples: Screenshot 1 Screenshot 2

Moreover, navmesh generated on some track sections is disrupted: Screenshot

So from searching through the forum I've found out that my best bet would be to ditch the NavMesh and write something custom instead. Like a custom waypoint system. But I just can't find enough info on how to even approach this task in this specific case. I realize this is kind of super-noob question, but please bear with me and help me put together all the available info on this matter, which may be also be useful for anyone else attempting to implement something similar. Thanks in advance.

Product Version: UE 4.19
Tags:
scr-1.png (1.4 MB)
scr-2.png (1.0 MB)
scr-3.png (811.9 kB)
more ▼

asked Nov 06 '18 at 02:21 PM in Using UE4

avatar image

Singularius
1 1 1

avatar image Singularius Nov 06 '18 at 02:31 PM

Forgot to mention that there will be static obstacles on the track, so even between waypoints at least a simple way to do pathfinding may be required.

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

I've approached this problem with a different perspective. I found a solution which works for me, and if someone ever encounters a problem like this, I thought it would be useful to share my solution for such people. So obviously a built-in NavMesh is not compatible with such surfaces, which is why I instead have come up with custom path resolution, completely relying on checkpoint markers, which are placed relatively densely (about 100 points for a middle-sized track). Each time a vehicle AI tries to guess which direction to go, it looks for next target checkpoint's location, and then steers directly towards it, as if it was on the same flat plane along with the vehicle itself. And all this while performing nessessary turning/acceleration/braking, as well as obstacles avoidance and other interaction with other vehicles, as it goes towards it. This is a base logic, and it can be customized with custom "smart" behaviors, like race goals, priorities, and so on. Densely placed markers (which are also placed in adequate places) also make sure that when AI makes decisions about heading direction, it does not need to count in the track's surface curve. At least in my case this is more than enough.

more ▼

answered Dec 19 '18 at 09:43 AM

avatar image

Singularius
1 1 1

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question