Dear TFT devs, here's a CS algorithm to improve your AI pathing
Dear TFT devs,
I have a suggestion which can help improve the AI pathing of champions in TFT. It's called the Hungarian Algorithm.
the tl;dr for your devs is: create a bipartite graph with your champions matching champions with destinations; give each matching a score; then run the hungarian algorithm to maximize the sum of score - that is the optimal way champions should move each turn.
Problem statement
There are times where the pathing messes up in the game. This is usually caused in the following situation: https://imgur.com/RkXtx8X
The optimal way for your green units to move is this: https://imgur.com/3T2Aoho
However, sometimes your units move like this, which causes one guy to get stuck for a bit: https://imgur.com/ilxYeLh
How do you solve this?
Its easy, first convert the hexagon representation of the map into a "graph". A graph is something that creates relationships between objects called nodes. When you see the graph of the map you'll see it makes sense: https://imgur.com/WfuNz6J
You see that every champion is on the left side, and a line matches it to its possible destination on the right hand side. All the edges that connect champions with destinations moving closer to the enemy are marked with 1, destinations where the champion stay still is marked with 0, and destinations moving backwards is -1.
So with a graph like this, you want to match each champion with a destination. If you maximize the SUM of all the edges chosen, you will maximize the number of champions that moved towards an enemy each turn. The optimal assignment becomes this: https://imgur.com/hb0mxND
And what algorithm solves maximizing the sum of edges? Hungarian algorithm.
Not sure if this approach has been considered yet or works for the devs. But maybe this will help you towards an optimal solution.
Best regards