[bfprog] autobalance
ScratchMonkey
ScratchMonkey at MatureAsskickers.net
Tue Jun 21 12:40:37 PDT 2005
--On Tuesday, June 21, 2005 1:25 PM -0600 Forrest Thiessen
<thiessen at cyberscapearena.com> wrote:
> That's an interesting idea to balance based on score; seems like it
> might be unstable, though (lots of team switching) early in games, but
> then would stabilize later on. Maybe some hysteresis could be added to
> stabilize it, so that score-based switching only takes effect when the
> *difference* between the scores of the two teams exceeds some threshold?
Right. The same applies to player count, but the threshold can be lower. I
think it's either 1 or 2. (I'm finding it hard to read the decision part of
the code.)
Actually, the balancing needs to be a combination of the two. The idea is
that you can always switch to the underdog, even if there's more players,
and balancing only kicks in if the underdog has fewer players (after
accounting for the permitted ratio).
> I haven't tried this (and haven't given it much thought, either, so
> there's probably a better way to to do it), but something like this
> probably does what you want:
>
> for player in bf2.playerManager.getPlayers():
> playerCount[player.getTeam()] += 1
Does playerCount need to be declared before the loop starts? Can it be
returned from a function?
More information about the BFProg
mailing list