-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove defender weight replay causing issues with dtap
- Loading branch information
Showing
3 changed files
with
47 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import rlgym_sim | ||
# from CoyoteParser import CoyoteAction | ||
from rlgym_tools.extra_state_setters.replay_setter import ReplaySetter | ||
# from rlgym_tools.extra_state_setters.augment_setter import AugmentSetter | ||
# from test_files.test_obs import TestObs | ||
# from test_files.test_reward import TestReward | ||
import numpy as np | ||
from rlgym_sim.utils.terminal_conditions.common_conditions import GoalScoredCondition, TimeoutCondition | ||
|
||
bad_list = [] | ||
index = {} | ||
setter = ReplaySetter("replays/bad_1v1_doubletap_state.npy") | ||
# obs = TestObs() | ||
# reward = TestReward() | ||
terminals = [GoalScoredCondition(), TimeoutCondition(100)] | ||
|
||
env = rlgym_sim.make(tick_skip=4, spawn_opponents=True, state_setter=setter, copy_gamestate_every_step=True, | ||
terminal_conditions=terminals) | ||
|
||
total_steps = 0 | ||
|
||
while True: | ||
obs = env.reset() | ||
done = False | ||
steps = 0 | ||
while not done: | ||
# actions = np.asarray((np.asarray([0]), np.asarray([np.random.randint(0, 373)]))) | ||
# actions = np.asarray(np.asarray([0],)) | ||
# actions = np.asarray([0] * 8), np.asarray([0] * 8) | ||
actions = np.asarray([1, 0.5, 0.5, 0.5, 0, 0, 1, 0]), np.asarray([1, 0.5, 0.5, 0.5, 0, 0, 1, 0]) | ||
new_obs, reward, done, state = env.step(actions) | ||
obs = new_obs | ||
if np.isnan(obs).any(): | ||
print(f"There is a nan in the obs after {steps} steps.") | ||
break | ||
steps += 1 | ||
total_steps += steps | ||
print(f"completed {steps} steps. Starting new episode. Done {total_steps} total steps") | ||
|
||
|