[2021] AI project with cars [Qt+C++]

This project has been made in 2021, and this was one of my worst experiences in group work. Still (like the UE4 project), I was alone working on the main stuff: the AI.

The idea is that you have a generated map with a undetermined amount of cars which need to go to some destinations by optimizing their consumption.
A destination is a random place in the map (which isn’t a wall) a car can access ; so the car needs to go there without ever breaking down or by saving some time by going to a gas station next to him if he considers it necessary.

To do this, we decided to use some C++ with Qt. I made a lot of Swing projects so I wanted to use another language with another graphic library – let’s say this was a really bad idea because this made me losing a looot of time due to a lot of rookie mistakes on Qt, so I haven’t all the time to manage AI stuff.

The AI works by following the Dijkstra algorithm, in a multi-origin type as you don’t have one source but a list of sources (sources are vehicles). So, you have destinations and you need to calculate distances between destinations and vehicles, for the vehicles to go to their nearest destination and the vehicles who don’t have any destination go can be recharged at gas pumps. Obviously, vehicles need to optimize their way based on the road (the more vehicles pass on a road, the more road will be damaged and cause high consumption), the weather (you have higher consumption if there is rain than sun for example), the type of vehicle (car, truck) and a lot of other parameters.

If the algorithm works properly, then vehicles will be able to manage themselves and go to their destinations once possible without ever breaking down.

This was kind of fun, but this was a minimalist project so there is probably much more things to explore.
I would definitely not go with Qt anymore, as this is not something I would like to use in the future.

Some old pictures: