If you want game quality and Best team composition inside FA

Talk about general things concerning Forged Alliance Forever.

Moderators: FtXCommando, Ze Dogfather

If you want game quality and Best team composition inside FA

Postby Ze_PilOt » 13 May 2012, 21:54

I'm not expecting someone doing it, but you can convert Trueskill this to LUA. This is the only way.

Here is the source code in python :
https://bitbucket.org/thepilot/python-trueskill/src

If you decide to do it, you can ask any question about the code here (like, where to start ? :)
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: If you want game quality and Best team composition insid

Postby FunkOff » 13 May 2012, 21:56

Trueskill is THAT many files?
FunkOff
Supreme Commander
 
Posts: 1863
Joined: 26 Aug 2011, 17:27
Has liked: 14 times
Been liked: 43 times
FAF User Name: FakeOff

Re: If you want game quality and Best team composition insid

Postby Ze_PilOt » 13 May 2012, 21:58

There is a 1v1 version without the factor graph that I'm not using. (give the same result with or without, and the speed gain is not significant).
So that file doesn't need to be converted : https://bitbucket.org/thepilot/python-t ... culator.py

There is a also a PHP version if you are more at easy with PHP.

Yes, it's a lot of code. Microsoft sell it for a reason :)
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: If you want game quality and Best team composition insid

Postby Ze_PilOt » 14 May 2012, 09:26

Hm actually I don't need to convert trueskill entirely, just the part that compute game balance, and that doesn't requires the factor graph, so it can be quickly done..

If someone want to know what is precisely needed, it's all the functions used here :

Code: Select all
    def calculateMatchQuality(self, gameInfo, teams) :

#        // We need to create the A matrix which is the player team assigments.
        teamAssignmentsList = teams



        skillsMatrix = self.getPlayerCovarianceMatrix(teamAssignmentsList)
       
       
        meanVector = self.getPlayerMeansVector(teamAssignmentsList)

        meanVectorTranspose = meanVector.getTranspose()

        playerTeamAssignmentsMatrix = self.createPlayerTeamAssignmentMatrix(teamAssignmentsList, meanVector.getRowCount())
       

       
        playerTeamAssignmentsMatrixTranspose = playerTeamAssignmentsMatrix.getTranspose()


        betaSquared = square(gameInfo.getBeta())

        start = Matrix.multiply(meanVectorTranspose, playerTeamAssignmentsMatrix)
       

       
        aTa = Matrix.multiply(Matrix.scalarMultiply(betaSquared,
                                               playerTeamAssignmentsMatrixTranspose),
                                                playerTeamAssignmentsMatrix)
        aTSA = Matrix.multiply(
                    Matrix.multiply(playerTeamAssignmentsMatrixTranspose, skillsMatrix),
                    playerTeamAssignmentsMatrix)



        middle = Matrix.add(aTa, aTSA)


        middleInverse = middle.getInverse()

        end = Matrix.multiply(playerTeamAssignmentsMatrixTranspose, meanVector)

        expPartMatrix = Matrix.scalarMultiply(-0.5, (Matrix.multiply(Matrix.multiply(start, middleInverse), end)))
        expPart = expPartMatrix.getDeterminant()

        sqrtPartNumerator = aTa.getDeterminant()
        sqrtPartDenominator = middle.getDeterminant()
        sqrtPart = sqrtPartNumerator / sqrtPartDenominator

        result = exp(expPart) * sqrt(sqrtPart)

        return result


So, basically, coding some matrices functions in lua.
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: If you want game quality and Best team composition insid

Postby Ze_PilOt » 14 May 2012, 10:41

And of course, it's done already :

http://lua-users.org/wiki/LuaMatrix
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: If you want game quality and Best team composition insid

Postby Ze_PilOt » 14 May 2012, 10:48

Oh god, okay, I will do it :)
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: If you want game quality and Best team composition insid

Postby Gowerly » 14 May 2012, 11:11

<3
Gowerly
Evaluator
 
Posts: 507
Joined: 30 Aug 2011, 10:52
Has liked: 0 time
Been liked: 0 time
FAF User Name: Gowerly

Re: If you want game quality and Best team composition insid

Postby Pavese » 14 May 2012, 11:36

i'm not sure if this is the best place for feedback:

when the people ingame become an uneven Number (7/8 i.e.) the game quality drops to 0% levels allthough all players inside are fairly equal and are just waiting for someone to join.

The low number might irritate people about the actual game balance.

Is it possible to create a "phantom" player, when the numbers are uneven, that has the average rating of all players inside? This way your formula will always calculate from an even numbers, or how it will be if another evenly matched player would join.
Pavese
Avatar-of-War
 
Posts: 186
Joined: 19 Oct 2011, 18:39
Has liked: 0 time
Been liked: 0 time

Re: If you want game quality and Best team composition insid

Postby Ze_PilOt » 14 May 2012, 11:44

It's about how you think people are dumb.

If they see 7 players on a 4vs4, they can assume that the low rating is due to a player missing.

If you don't believe that anybody is capable of understanding that, do you REALLY want them in your game ?
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: If you want game quality and Best team composition insid

Postby Gowerly » 14 May 2012, 11:46

Possibly instead of that, remove the average of all players on the larger team (so the game assumes there's one fewer player on the larger team), which will then be compared against the opposing team.

However, a 4v3 should never be 0% anyway. It's unlikely to be THAT unbalanced. Even in HoN, 5v4s are always like 83 - 17 for unmatched sides.
Gowerly
Evaluator
 
Posts: 507
Joined: 30 Aug 2011, 10:52
Has liked: 0 time
Been liked: 0 time
FAF User Name: Gowerly

Next

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron