New lobby function

Talk about general things concerning Forged Alliance Forever.

Moderators: FtXCommando, Ze Dogfather

New lobby function

Postby Ze_PilOt » 07 Jul 2012, 21:24

The current FA lobby got a new (in beta) function : Best team composition.

If you set a Auto-Team other than manual or none, and if the spawns are random, the function will automatically kick in.

It will take the rating of all the players, and place them in the correct team to have the most even match possible. (this is a crude algorithm, but it will give 75% the best result, and at worst something not that bad if not the best).

The option can't be disabled : If you don't want it, don't set auto-team and/or random spawn.
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt

Re: New lobby function

Postby Duck_42 » 08 Jul 2012, 02:04

Cool feature.

I ran into a slight issue though...

warning: Error running OnRelease script in <deleted object>: ...orever\gamedata\faforever.faf\lua\ui\lobby\lobby.lua(702): attempt to concatenate field `PL' (a nil value)
stack traceback:
...orever\gamedata\faforever.faf\lua\ui\lobby\lobby.lua(702): in function <...orever\gamedata\faforever.faf\lua\ui\lobby\lobby.lua:678>
...orever\gamedata\faforever.faf\lua\ui\lobby\lobby.lua(1142): in function `LaunchGame'
...orever\gamedata\faforever.faf\lua\ui\lobby\lobby.lua(1167): in function <...orever\gamedata\faforever.faf\lua\ui\lobby\lobby.lua:981>
...orever\gamedata\faforever.faf\lua\ui\lobby\lobby.lua(2164): in function `OnClick'
...d alliance\gamedata\mohodata.scd\lua\maui\button.lua(133): in function <...d alliance\gamedata\mohodata.scd\lua\maui\button.lua:122>

Code: Select all
      local ratingTable = {}
      for i = 1, numAvailStartSpots do
         if gameInfo.PlayerOptions[i] then
            LOG("Rating  of player " .. i .. " : " .. gameInfo.PlayerOptions[i].PL)
            rating = gameInfo.PlayerOptions[i].PL
            ratingTable[rating] = i
         end
      end


Problem is at .. gameInfo.PlayerOptions[i].PL

In skirmish mode (using an init file to load faf and phantom-x), the AIs I'm testing with don't have ratings (unless I missed something), so this code bombs out. I can use fixed spawns for testing purposes, but you may want to look at some exception handling for a scenario where there are no player ratings (i.e. AIs).
User avatar
Duck_42
Avatar-of-War
 
Posts: 237
Joined: 29 May 2012, 03:16
Has liked: 5 times
Been liked: 18 times
FAF User Name: Duck_42

Re: New lobby function

Postby Ze_PilOt » 08 Jul 2012, 10:12

Will be fixed soon.
Nossa wrote:I've never played GPG or even heard of FA until FAF started blowing up.
User avatar
Ze_PilOt
Supreme Commander
 
Posts: 8985
Joined: 24 Aug 2011, 18:41
Location: fafland
Has liked: 18 times
Been liked: 376 times
FAF User Name: Ze_PilOt


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest