Skip to content

Commit

Permalink
go back to regular GP, back to regular rocket league
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaiyotech committed Aug 29, 2023
1 parent f30bff7 commit ae441ba
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 72 deletions.
2 changes: 1 addition & 1 deletion Constants_gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
TIME_HORIZON = 16 # horizon in seconds
T_STEP = FRAME_SKIP / 120 # real time per rollout step
ZERO_SUM = True
STEP_SIZE = 1_000_000
STEP_SIZE = 2_000_000
DB_NUM = 4

model_name = "nexto-model.pt"
Expand Down
10 changes: 5 additions & 5 deletions learner_gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@
fps = 120 / frame_skip
gamma = np.exp(np.log(0.5) / (fps * half_life_seconds))
config = dict(
actor_lr=5e-6,
critic_lr=5e-6,
actor_lr=1e-6,
critic_lr=1e-6,
n_steps=Constants_gp.STEP_SIZE,
batch_size=100_000,
minibatch_size=50_000,
Expand All @@ -52,10 +52,10 @@
ent_coef=0.01,
)

run_id = "gp_run_wall_3.02"
run_id = "gp_run_2v2_3.64"
wandb.login(key=os.environ["WANDB_KEY"])
logger = wandb.init(dir="./wandb_store",
name="GP_Run_wall_3.02",
name="GP_Run_2v2_3.64",
project="Opti",
entity="kaiyotech",
id=run_id,
Expand Down Expand Up @@ -162,4 +162,4 @@

# alg.freeze_policy(100)

alg.run(iterations_per_save=logger.config.save_every, save_dir="GP_wall_saves")
alg.run(iterations_per_save=logger.config.save_every, save_dir="GP_saves")
5 changes: 4 additions & 1 deletion setter.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def __init__(self, mode, end_object_choice=None, simulator=False, dtap_dict=None
AugmentSetter(ReplaySetter(replays[i], random_boost=True)),
),
# (0.05, 0.50, 0.20, 0.20, 0.025, 0.025)
(0.1, 0.5, 0.2, 0.1, 0.1, 0, 0, 0, 0)
(0.05, 0.55, 0.2, 0.1, 0.1, 0, 0, 0, 0)
)
)

Expand Down Expand Up @@ -352,6 +352,9 @@ def __init__(self, mode, end_object_choice=None, simulator=False, dtap_dict=None
for i in range(3):
self.setters.append(TestMirror())

else:
print("You didn't choose a setter properly")

def reset(self, state_wrapper: StateWrapper):
# if self.end_object_choice is not None and self.end_object_choice == "random":
# self.end_object_tracker[0] += 1
Expand Down
130 changes: 65 additions & 65 deletions worker_gp.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,35 @@

if __name__ == "__main__":
#actual GP rewards
# rew = ZeroSumReward(zero_sum=Constants_gp.ZERO_SUM,
# goal_w=10,
# concede_w=-10,
# # double_tap_w=5,
# velocity_bg_w=0.075 / 2, # fix for the tick skip change
# velocity_pb_w=0,
# boost_gain_w=0,
# punish_boost=True,
# use_boost_punish_formula=False,
# boost_spend_w=-0.45,
# boost_gain_small_w=0,
# punish_low_boost_w=-0.02,
# demo_w=8,
# acel_ball_w=2,
# team_spirit=1,
# # cons_air_touches_w=2,
# jump_touch_w=4,
# wall_touch_w=15,
# touch_grass_w=0,
# punish_bad_spacing_w=0,
# handbrake_ctrl_w=0, #-0.006,
# tick_skip=Constants_gp.FRAME_SKIP,
# flatten_wall_height=True,
# slow_w=-0.1,
# turtle_w=-4,
# punish_dist_goal_score_w=-10,
# # touch_wall_w = 0.05,
# energy_reward_w=0.015,
# )
rew = ZeroSumReward(zero_sum=Constants_gp.ZERO_SUM,
goal_w=10,
concede_w=-10,
# double_tap_w=5,
velocity_bg_w=0.075 / 2, # fix for the tick skip change
velocity_pb_w=0,
boost_gain_w=0,
punish_boost=True,
use_boost_punish_formula=False,
boost_spend_w=-0.45,
boost_gain_small_w=0,
punish_low_boost_w=-0.02,
demo_w=8,
acel_ball_w=2,
team_spirit=1,
# cons_air_touches_w=2,
jump_touch_w=4,
wall_touch_w=15,
touch_grass_w=0,
punish_bad_spacing_w=0,
handbrake_ctrl_w=0, #-0.006,
tick_skip=Constants_gp.FRAME_SKIP,
flatten_wall_height=True,
slow_w=-0.1,
turtle_w=-4,
punish_dist_goal_score_w=-10,
# touch_wall_w = 0.05,
energy_reward_w=0.015,
)
#demo rewards
# rew = ZeroSumReward(zero_sum=Constants_gp.ZERO_SUM,
# goal_w=10,
Expand Down Expand Up @@ -90,39 +90,39 @@
# use_concede_even_zero_sum=True,
# )
# wall reward
rew = ZeroSumReward(zero_sum=Constants_gp.ZERO_SUM,
goal_w=10,
concede_w=-10,
# double_tap_w=5,
velocity_bg_w=0.15, # fix for the tick skip change
velocity_pb_w=0,
boost_gain_w=0,
punish_boost=True,
use_boost_punish_formula=False,
boost_spend_w=-0.5,
boost_gain_small_w=0,
punish_low_boost_w=0,
demo_w=5,
acel_ball_w=2,
team_spirit=1,
# cons_air_touches_w=2,
jump_touch_w=1,
wall_touch_w=15,
touch_grass_w=0,
punish_bad_spacing_w=0,
handbrake_ctrl_w=-0.004, #-0.006,
tick_skip=Constants_gp.FRAME_SKIP,
flatten_wall_height=True,
pun_rew_ball_height_w=0.02,
dribble_w=-1,
aerial_goal_w=10,
slow_w=0,
turtle_w=0,
punish_dist_goal_score_w=0,
# touch_wall_w = 0.05,
energy_reward_w=0.03,
use_concede_even_zero_sum=False,
)
# rew = ZeroSumReward(zero_sum=Constants_gp.ZERO_SUM,
# goal_w=10,
# concede_w=-10,
# # double_tap_w=5,
# velocity_bg_w=0.15, # fix for the tick skip change
# velocity_pb_w=0,
# boost_gain_w=0,
# punish_boost=True,
# use_boost_punish_formula=False,
# boost_spend_w=-0.5,
# boost_gain_small_w=0,
# punish_low_boost_w=0,
# demo_w=5,
# acel_ball_w=2,
# team_spirit=1,
# # cons_air_touches_w=2,
# jump_touch_w=1,
# wall_touch_w=15,
# touch_grass_w=0,
# punish_bad_spacing_w=0,
# handbrake_ctrl_w=-0.004, #-0.006,
# tick_skip=Constants_gp.FRAME_SKIP,
# flatten_wall_height=True,
# pun_rew_ball_height_w=0.02,
# dribble_w=-1,
# aerial_goal_w=10,
# slow_w=0,
# turtle_w=0,
# punish_dist_goal_score_w=0,
# # touch_wall_w = 0.05,
# energy_reward_w=0.03,
# use_concede_even_zero_sum=False,
# )
frame_skip = Constants_gp.FRAME_SKIP
fps = 120 // frame_skip
name = "Default"
Expand All @@ -136,14 +136,14 @@
non_latest_version_prob = [0.85, 0.1, 0.05, 0.0] # this includes past_version and pretrained
deterministic_streamer = True
force_old_deterministic = True
gamemode_weights = {'1v1': 0.6, '2v2': 0.4, '3v3': 0}
gamemode_weights = {'1v1': 0.4, '2v2': 0.6, '3v3': 0}
visualize = False
simulator = True
simulator = False
batch_mode = True
team_size = 3
dynamic_game = True
infinite_boost_odds = 0
setter = CoyoteSetter(mode="GP-Wall", simulator=True)
setter = CoyoteSetter(mode="normal", simulator=False)
host = "127.0.0.1"
epic_rl_exe_path = None # "D:/Program Files/Epic Games/rocketleague_old/Binaries/Win64/RocketLeague.exe"

Expand Down

0 comments on commit ae441ba

Please sign in to comment.