Latest Posts

Changes in StatisticsSavedOnMetaServer

Editor Comment

update


Revision Differences of Revision 2

## General Idea ¶

Depending on the win condition and the number of winners / losers, 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). The game server will than save the data for each user. ¶



### The send data ¶

The data send to the game server should be a list with entries for each human player, containing: ¶

* playername ¶
* whether player is a winner ¶
* The time of lose/win (player possibly play on for some time after winning) ¶

The widelands game_server (running as module on the metaserver) should than already know: ¶

* How long the game took ¶
* How much players and computer players are playing (should be send by the host at game start) ¶

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
10 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 lousers: ¶

* points += 1 if the p
layer had suthe biggest amount dioffe warents (scomewhemre

-
1in (orthe ga smale until finumberal victofry). ¶
*
points) for+= de1 if theating a player (had the strongest army c(sonnqumewhere in thqe forgame suntimpl ficnal victory).
*
evepoints if+= it1 isf the supplayer had the bliggestz. maybemount sof worketrs (some wherequ irn the game until final victonry). ¶
*
mpoints += 1 imumf mthe player hapd the most buizldings (some/whqere disn the gancme suntil final victory). ¶

F
or ithe dlosersn' the jcalcuslat ionv shoulved further be: ¶

* po
inyts -= (1 + numapsber withof hq'ours until final swight ¶
n - numbextra poif hours until florse of the placyer) (but the mfinalit varylue bshouild be >= -4) ¶

For the w
ingners the calculationq should further bed: ¶

- extra* points += 1 for each soldierfeated upgrladyedr
- extra* points += 1 for eacvery 2 hours b(rouilnd diowng) bplayed untild ¶
-
final exvictoray ¶
*
points -= 1 for every hour, achfter x2 nhoumbers of wgares crmeplated ¶

y and dbefore final vidctory, where byno figamehts timook place. (Tor eaveoid "pushing beof points") ¶
* poin
ts += 1^2 for every thoposing alliance squize >= 3 plaryers (so + 1 for game3, + t4 for 4, + 9 for 5, ...) ¶
*
if more) thisan wone player is set as willnner: actmualtiply enicourage peoplte to work harde and fpoinitsh withe gam((size. youf wouldwn'ted wlant d)x(somize of enemy militoary jusite ldefeavts)) / ((size hisof compuleter controlled land getby poiantsy foplayer refu)x(singze tof cwhonquler defeathed military sites sin glame)) ¶

Th
e barrfinakl points/w of a winner shodcuttld ber >= 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