Why not store the cities themselves and query them? All permutations of 50 cities would result in over 1000 results. Any reason you cannot simply ask for this data dynamically? Asking as you may have your reasons, ofc.
What are cities in this scenario? Just coords? No names? No objects?
It will be used a lot for the pathfinding, so I assumed it was better to process the distance calculations one time and store them.
Cities are just randomly placed cubes in the world with x and y coordinates (no z coordinates, but I might add that later for city height!). I can get their x and y coordintes that part is easy, just storing that information with their distance in a way that I can query is the struggle…
You can use actors / tags / names as keys. This can be dynamic and all you need is a list. The list can be a *.csv file imported into a Data Table, a manual Data Table or punch the data directly if you have the patience. Adding a city to such a list at runtime could look like so:
But sure, you can pre-calculate it, too. I’d still use a map - so you can refer to it by name: