Skip to content

Commit

Permalink
Take into account AI rating for estimated game quality (FAForever#5872)
Browse files Browse the repository at this point in the history
  • Loading branch information
maudlin27 authored Feb 3, 2024
1 parent d0d62d8 commit 6fef74c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lua/ui/lobby/lobby.lua
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ function GetAIPlayerData(name, AIPersonality, slot)
aiLobbyProperties = entry
end
end
local iRating = ComputeAIRating(gameInfo.GameOptions, aiLobbyProperties)

return PlayerData(
{
Expand All @@ -550,7 +551,9 @@ function GetAIPlayerData(name, AIPersonality, slot)
PlayerColor = AIColor,
ArmyColor = AIColor,

PL = ComputeAIRating(gameInfo.GameOptions, aiLobbyProperties),
PL = iRating,
MEAN = iRating,
DEV = 0,

-- keep track of the AI lobby properties for easier access
AILobbyProperties = aiLobbyProperties,
Expand Down Expand Up @@ -2326,6 +2329,8 @@ local function UpdateGame()
if playerOptions then
if not playerOptions.Human then
playerOptions.PL = ComputeAIRating(gameInfo.GameOptions, playerOptions.AILobbyProperties);
playerOptions.MEAN = playerOptions.PL
playerOptions.DEV = 0
end
end
end
Expand Down Expand Up @@ -2568,7 +2573,7 @@ function ShowGameQuality()
local playerOptions = gameInfo.PlayerOptions[i]
if playerOptions then
-- Can't do it for AI, either, not sensibly.
if not playerOptions.Human then
if not playerOptions.Human and (playerOptions.MEAN or 0) == 0 then
return
end

Expand Down

0 comments on commit 6fef74c

Please sign in to comment.