football
football copied to clipboard
high pass randomness bug
When executing a high pass there are two manifestations, one is that the ball will kick into the air and land at the teammate's position(higher one), and the other is that the ball will kick into the air and land on the ground midway through the approach to the teammate and bounce up to the teammate's position(lower one).
I thought that the two manifestations of the high pass were meant to add randomness to the high pass. However, I found that when starting a game where one team's high pass manifestation is one of the above two, and it will remain the same for the entire game. At the same time, the other team's high pass performance will be the other one and will remain the same for the entire game too. This will affect the balance of the game.
Here is some screen records.
higher one:
lower one:
test code i am using as below. you can continually execute this script to see both manifestations.
import gfootball.env as football_env
env = football_env.create_environment(
env_name="test_custom",
number_of_left_players_agent_controls=2,
number_of_right_players_agent_controls=2,
render=True,
other_config_options={
"real_time": True,
},
)
o = env.reset()
while True:
a = [10, 0, 0, 0]
o, r, d, info = env.step(a)
if d:
break
scenario:
from . import *
def build_scenario(builder):
builder.config().game_duration = 3000
builder.config().right_team_difficulty = 1
builder.config().left_team_difficulty = 1
builder.config().deterministic = False
if builder.EpisodeNumber() % 2 == 0:
first_team = Team.e_Left
second_team = Team.e_Right
else:
first_team = Team.e_Right
second_team = Team.e_Left
builder.SetTeam(first_team)
builder.AddPlayer(0.000000, 0.000000, e_PlayerRole_GK)
builder.AddPlayer(0.9, 0.0, e_PlayerRole_CB)
builder.SetTeam(second_team)
builder.AddPlayer(-1.000000, 0.000000, e_PlayerRole_GK)
builder.AddPlayer(0.9, 0.0, e_PlayerRole_CB)