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"

Vehicle AI avoidance

I'm making a racing game for a school project. I implemented a decent vehicle AI using waypoints and such. Basically it's working fine, except when there are multiple vehicles. They just collide with one another. What I want is to have them avoid/overtake each other as much as possible, just like in real racing.

How do I go about doing this? I'm using Blueprints, btw. Thanks!

Product Version: Not Selected
Tags:
more ▼

asked Jan 16 '15 at 11:21 AM in Blueprint Scripting

avatar image

Jujaswe
90 11 16 23

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

You could try a NavModifier for your Cars. If you increase the entering cost to something really high they will move around them unless there is no other way. You add those under the components tab and decide which type of Area modifier they have. Implement a new one suiting your needs and select it.

This will only cause your cars to not crash anymore. If you want cool races with somewhat intelligent drivers you will need to do a whole lot more work on the AI itself.

I hope this helps.

Cheers

more ▼

answered Jan 16 '15 at 11:46 AM

avatar image

Erasio
6k 291 86 293

avatar image Jujaswe Jan 16 '15 at 01:33 PM

Hi Erasio, thanks for the reply. Sorry but do NavMeshes work for vehicles? I tried adding a nav mesh and nav modifiers but the vehicle isn't navigating around the obstacle or car for that matter.

avatar image Erasio Jan 16 '15 at 02:52 PM

...wait... how are your cars moving right now?

I expected you to use a nav mesh (which is very much possible for cars as well). You will need to tweak the settings quite a bit and do a bit additional work but in general the navmesh is nothing but an area which is set up for an AI on top of that to use. Basically indexing the area and saving all points one could walk on. What the AI does on top of that is implementation dependent.

avatar image Jujaswe Jan 16 '15 at 03:13 PM

I have target points laid along a track and my cars just move to those points accordingly. I didn't use nav meshes as I was under the impression that they only worked for character pawns.

Thanks for the insight. I'll look into using nav meshes for my vehicles. Marked as correct answer for now. Thanks!

avatar image Poeticodes May 04 '16 at 09:10 PM

I know this question is pretty old, but this blog post gives a good overview of how to accomplish what Erasio is talking about.

http://zombpir8ninja.blogspot.com/2015/09/basic-moveto-behavior-for-vehicles-in.html

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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