Currently Online

Latest Posts

StatisticsSavedOnMetaServer

General Idea

All clients and the host should send the same data to the widelands game_server (which checks if all send the same - so cheating will at least be harder). Depending on the win condition and the number of winners / losers, the server will calculate point for the game and save the data for each user.

The send data

The data send to the game server on game start by every player:

Game information

  • mapname and size
  • gametype (endless, autocrat, collectors, territorial lord, wood gnome)

Data for every player

  • playername
  • tribe
  • playertype (normal_ai, aggressive_ai, deffensive_ai, human)
  • widelands player number (start position)
  • team
  • widelands version and build of clients and host

The data send to the game server after the game ends:

  • playernumber
  • whether player is a winner
  • The time of lose/win (player possibly play on for some time after winning) - only the time of the "game end" is reported
  • points - depends on win condition, currently collectors transmit data
  • most of the game statistics:
  • conquered land
  • military buildings lost
  • civil buildings lost
  • buildings defeated
  • military buildings conquered
  • economy strength - to be done (missing information in widelands)
  • military strength
  • number of wares
  • number of workers
  • productivity
  • casualties
  • kills

Out of this data, the game_server calculates the points for each player to be added to the database. These saved statistics should than be visible on the website and (for each logged in user) be shown in the GGZ metaserver lobby.

Calculation of points

General guide line for calculation

The following points should be kept in mind when adding a new game type, to have a similiar amount of points for winners and losers.

  • Points will only be saved on the server, if at least two player were playing (spectators not counting)
  • Computer players should count less than human players.
  • Widelands is an economy based strategy game and is meant to take some time until a working economy is up and running, so there should be a min value of time a game has to take to be counted (30 minutes). This will as well partly work as cheating protection.
  • If the user lost the game, (s)he should get a very small negativ points value (between -1, -2, -3 or -4)
  • If the user won the game, (s)he should get a positive amount between 0 and 100, where 100 should be nearly unreachable (metaserver should check that as well). Give 1-5 points, if it was a short game with less oponents, up to 20 points on longer and/or harder games and up to 75, if the game was really hard with many oponents and took a long time. Everything above 75 should only be reached by special plus points and be reserved for very special stuff, like being the only one in game that started with a small headquarters, while all others started up with "castle village" or like beeing alone against 4 or 5 allied players.

Normal "defeat" games

General calculation -> for winners and losers:

  • points += 1 if the player had the biggest amount of wares (somewhere in the game until final victory).
  • points += 1 if the player had the strongest army (somewhere in the game until final victory).
  • points += 1 if the player had the biggest amount of workers (somewhere in the game until final victory).
  • points += 1 if the player had the most buildings (somewhere in the game until final victory).

For the losers the calculation should further be:

  • points -= (1 + number of hours until final win - number of hours until lose of the player) (but the final value should be >= -4)

For the winners the calculation should further be:

  • points += 1 for each defeated player
  • points += 1 for every 2 hours (round down) played until final victory
  • points -= 1 for every hour, after 2 hours of gameplay and before final victory, where no fights took place. (To avoid "pushing of points")
  • points += x^2 for every oposing alliance size >= 3 players (so + 1 for 3, + 4 for 4, + 9 for 5, + 16 for 6, + 25 for 7)
  • if more than one player is set as winner: multiplicate the points with ((size of owned land)x(size of enemy military site defeats)) / ((size of complete controlled land by any player)x(size of whole defeated military sites in game))

The final points of a winner should be >= 0 and <= 100

Older drafts (kept here as general idea)

The following is a first draft for the calculation:

  • = 0, if the game took less than 30 minutes (widelands is an economy strategy game, none should get points for being the super cool aggressive Blitzkrieg guy) and if only 1 human player was in game.
  • = ((number of human players + (number of computer players / 2)) / number of winners) + (number of hours until win / 2)[rounded down] , if the player is a winner
  • = - (1 + number of hours until win - number of hours until lose of the player) (but should be >= -3), if player is a loser
Tagged with: archived