Hi. I am making an AI that has its own needs and goes to points to satisfy them. I would like it to take the shortest route through the points where it can satisfy these needs. I have the points stored in a structure as an array because there can be many of each type, each point is an actor with a collision field, I have a queue made on the map which refreshes depending on the value of the needs (e.g. food - 1, energy - 3, money - 2) that is, it determines to which point as 1 I should go to which as 2 and so on. The problem I have is finding the shortest route, because the number of points on the map can vary and they are of different types, as each renews a different value of need. I don’t know how I can go through all the cases to determine the shortest path, since I can’t predict what the queue of needs will look like and I can’t predict how many points of a given type there are (unless I define it permanently, but I would prefer it not to be predetermined and I could add, for example, 1 point of food, 3 for work at any time and everything will still work and the shortest path between these points will be calculated correctly on the basis of this queue).
Any ideas would be helpful!
Thanks in advance for your help.