Page 1 of 1

Player with a -1 value

Posted: Sun Apr 09, 2006 6:56 pm
by idcarlos
Hi.

With this savegame
I have play the match and when finish one of the players are with a valued as -1.

I'll try to debug... but I need some ideas...

Posted: Mon Apr 10, 2006 12:02 pm
by idcarlos
Ok.

I'm debuging what happened with my player.
the id of the player is 6167

File: player.c
Function: player_update_fitness(Player *pl)
line 758

when try to calc the new fitness value

Code: Select all


    pl->fitness += (((pl->peak_age - pl->peak_region - pl->age) *
             const_float("float_player_fitness_increase_younger_factor") +
             const_float("float_player_fitness_increase_add")) *
            variance * streak_factor);

pl->peak_region value is -214748.359 :shock:

peak_region value it's from savegame, I don't know why have this value.

One question... this function it's for players that no participate in the game?

Code: Select all

if(pl->participation)
{
    pl->participation = FALSE;
    return;
}
Un saludo
Carlos Garcés

Posted: Mon Apr 10, 2006 6:45 pm
by gyboth
idcarlos wrote:pl->peak_region value is -214748.359 :shock:

peak_region value it's from savegame, I don't know why have this value.
i'm sorry, i don't have the time currently to debug. i hope i'll be able to do it in a few days. i have no idea where this value comes from :-P
One question... this function it's for players that no participate in the game?

Code: Select all

if(pl->participation)
{
    pl->participation = FALSE;
    return;
}
yes, this is for players who played in the last match. the fitness of those doesn't get increased.

gyözö

Posted: Mon Apr 10, 2006 10:11 pm
by idcarlos
It's happend with player from academy.

In youth_academy_add_new_player peak_region not is set ¿it's ok?

And... ¿what is peak_region?

Posted: Tue Apr 11, 2006 6:06 am
by gyboth
idcarlos wrote:In youth_academy_add_new_player peak_region not is set ¿it's ok?
oh. no, it's not ok. it's a bug. let's add

Code: Select all

new.peak_region = math_gauss_dist(const_float("float_player_peak_region_lower"), const_float("float_player_peak_region_upper"));
to the code after peak_age then (copied from player.c, player_new()).
And... ¿what is peak_region?
peak_region determines how long a player maintains his highest skill. the range for peak_region is in the constants file (as you can see in the code above), i think it's around 2-4 years or so.

gyözö

Posted: Tue Apr 11, 2006 10:02 am
by idcarlos
peak_region determines how long a player maintains his highest skill. the range for peak_region is in the constants file (as you can see in the code above), i think it's around 2-4 years or so.

gyözö
Maintains his highest skill? It's to let youngers players grow faster?

Bug is fixed in CVS. Please review it before the next release.

Posted: Tue Apr 11, 2006 5:49 pm
by gyboth
idcarlos wrote:Maintains his highest skill? It's to let youngers players grow faster?
no, it's got nothing to do with young players. it's an attribute for all players. it just expresses that different players stay on their peak level for different time spans. there are players who play on a high level for 8 years, and there are also ones who can only maintain their level for 3 years.

gyözö