Anyway, first "working" version of the next step (choosing the "least unbalanced" combination of focal points to use as starting TCs) is completed.
I only tested in Riverside this time because the logic will have to be changed considerably in regards to distance (more on this later)
Tests:
FFA 2 players, 10 focal points
FFA 3 players, 10 focal points
FFA 4 players, 10 focal points
FFA 2 players, 15 focal points
FFA 3 players, 15 focal points
FFA 4 players, 15 focal points (might take a while to load, I had to spend some minutes compressing this one to fit in the 8MB Discord limit)
Notes:
- Combination score is calculated using an "harmonic-like" mean of the distance's standard deviation, score's standard deviation and the distance factor. The formula is currently this: score = 3 / ( distanceDeviation + scoreDeviation + 1/distanceFactor ). Doing it like this means that none of the 3 factors alone can push the score up too much, but any of them can bring the score down by a lot if they're too bad.
- For 2 players, at least for me, that seems a good choice
- Idk what a good balancing would be for 3 players, so not sure if these are good enough or not. Probably would have to be adjusted for some distance issues.
- For 4 players, it seems a good enough choice, but I still think they might be a little too close? Distance issues etc.
- Haven't tested with teams yet because there's yet no logic that takes that into account, will have to think about how to implement that later.
- Yeah, combination count doesn't scale very well (it scales in a factorial manner, so... ), so I think there should be a limit to amount of focal points, will test the performance to see what that limit should be (considering player count can't get past 6, I think it should be somewhere between 15 and 30, though with 30 the testing script would take ages when trying to make an image of a table with 197295 rows lol). Also this could be improved in larger maps by reducing the amount of focal points required, by changing the measured distance according to the map's size (so focal points would make a larger "score hole" when chosen).
- How to determine which unit should be used to calculate the cost? This one could be passed as an input, like a mix of light cav. and barcha longa, for example (a mix of their trnWalkTerrain, I mean). Probably will need a lot of tweaking too.
- This one is my main problem right now: in other variants (and in the future in AoS too), players can choose their race/country/culture/etc., but afaik the tc generation happens before all players join the match, so it wouldn't be able to account for different races/etc. having different units with different movement costs. @Stratego (dev) is it possible to move TC generation for after all players join, instead of when creating a match?
- After the above problem is solved, how would the algorithm calculate for many different races/etc. in a game? I mean, each of them might have units with completely different movement costs, so how would distances be checked between focal points, or even for finding the focal points themselves?