You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.
Players are so far able to reach disproportionate sizes by continuously eating the same weaker player.
This may no longer present an issue once we have some buffer time between two successive collisions + growth (e.g. #695), but for now it would be best to cap a player's max size to a reasonable* size. Rm later on if appropriate.
*you decide on what's reasonable!
Test
#ifdef FIX_ISSUE_726
// (726) There is a maximum size a player can reach
{
player p;
// How many growth cycles to max size?constdouble init_size = p.get_diameter();
constdouble max_size = p.get_max_size();
constdouble diff_size = max_size - init_size;
assert(diff_size > 0);
constdouble growth_factor = p.get_growth_factor();
constint nb_cycles = static_cast<int>(std::ceil(diff_size / growth_factor));
for (int i = 0; i < nb_cycles; i++)
{
p.grow();
}
p.grow(); // to be sure we should exceed max sizeassert(p.get_diameter() == max_size);
}
#endif// FIX_ISSUE_726
The text was updated successfully, but these errors were encountered:
Context
Players are so far able to reach disproportionate sizes by continuously eating the same weaker player.
This may no longer present an issue once we have some buffer time between two successive collisions + growth (e.g. #695), but for now it would be best to cap a player's max size to a reasonable* size. Rm later on if appropriate.
*you decide on what's reasonable!
Test
The text was updated successfully, but these errors were encountered: