Good day,
I would like to learn more about AI - how to make AI vehicles, ect. Can anyone point me to some resources please?
Best regards
Jakes
Good day,
I would like to learn more about AI - how to make AI vehicles, ect. Can anyone point me to some resources please?
Best regards
Jakes
Not entirely sure what you mean by “AI vehicles”. Are we talking vehicles driven randomly or purposely around by the computer? If so I’d say you need to take a look at how to do pathfinding. Cause essentially, the vehicle will be an NPC.
This video shows the theory behind the A-Star algorithm for computer pathfinding.
Pathfinding is a beast, especially if you are new to it. Personally I’ve been coding for 1.5 years, and I’ve spent the last 7 months perfecting my own pathfinding system - though partially because I got interested in multi-threading along the road. Still, I never thought it would consume me as it did. ![]()
It has less to do with the purpose of the vehicle than the laws the vehicle are governed byr. If you’re using a physically realistic system, then the control system can be as difficult as the pathfinding, and will also inform the pathfinding algorithm used (eg, A* makes little sense for a racing game).
I myself have not really delved into AI so this might not be helpful. But In terms of decision-making I’m pretty sure that a good deal of AI implementations use Behaviour Trees. A behaviour tree implementation in Unity would be Behave. For pathfinding, like Leddy said, A-Star would be good. A good A* implementaion would be This. Remember that google is your friend (Search something like “C# AI” or “Javascript AI Unity”). Beyond that I (really) don’t know much. Hope it helped. ![]()
I’m working on a game now with ai cars test the angle of their target in order to steer and if they become offtrack they raycast out in four directions to calculate their steering. I’ve found it useful as well to keep the function for drive and reverse separate from all other functions. I could give you the code when I’m done writing it if you think it might help.
in Javascript
Good day ![]()
Thanks for all the replies! Really appreciate it!
Ok to start with, I am working on a game that have vehicles that must drive around randomly - It is in the field, so no specific roads. When they are in a certain range of the player, they must drive closer and attack the player.
I will plan my game around what scripting and knowledge is available, as this is ultimately what make or break the game.
@frankrs, It will be most kind of you to share your script. I will really appreciate it.
I will do some research on A* pathfinding. I guess it will be helpful for vehicles as well as any other movable objects, such as enemy characters, etc?
Best regards,
Jakes