Feed neural network raycast vision or map data

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Vekepihvi

I’m making a top down car game in Godot. I need car A.I for the game, but I’m not so good with maths and handbuilt car A.I isn’t really that good. I found this awesome new Youtuber “mohsen zare” (youtube channel) who made a neural network library for Godot in C++.

I plan on using this library and mohsen zare’s Youtube videos taught me mostly enough to do so, but here’s the question:

Which should I use for neural network input: Raycasts to track edges of road or map data?

Here’s an example of map data:

The reason I’m thinking about using map data is, that I think using raycasts to track walls doesn’t tell the neural network all the same information the player gets. The player can, for example, safely cut a corner if the player sees that the road continues behind the corner.

Edit: By the way there are no walls when exiting the road, but the car will slow down outside the road.

Thanks for sharing this AI lib. Have you watched Godot Recipe: AI - Context-based Steering
by KidsCanCode? It uses RayCast. It’s handcrafted AI did a nice job. In 2D mine did not like small roads and his 3D did not like hills it seems to me.

I’m not sure what your map data contains. And how big it will be in your application.

clemens.tolboom | 2021-03-20 12:09

:bust_in_silhouette: Reply From: Vekepihvi

An AI car fed with map data doesn’t seem to learn it’s job. I recommend using raycasts for car AI.