Skip to content

Commit

Permalink
Merge pull request #199 from edbeeching/deprecate-gdrl
Browse files Browse the repository at this point in the history
Deprecates the use of gdrl
  • Loading branch information
edbeeching authored Sep 3, 2024
2 parents 5ccfa8e + 9cc946f commit ab8a971
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ You may need to add run permissions on the game executable.
chmod +x examples/godot_rl_JumperHard/bin/JumperHard.x86_64
```

Train and visualize

Train and visualize, first download the [Stable Baselines 3 example](https://github.com/edbeeching/godot_rl_agents/blob/main/examples/stable_baselines3_example.py) script in the github repo:
```bash
python examples/stable_baselines3_example.py --env_path=examples/godot_rl_JumperHard/bin/JumperHard.x86_64 --experiment_name=Experiment_01 --viz
```

Deprecated usage with an entrypoint (to be removed in version 1.0):
```
gdrl --env=gdrl --env_path=examples/godot_rl_JumperHard/bin/JumperHard.x86_64 --experiment_name=Experiment_01 --viz
```

Expand All @@ -54,7 +58,7 @@ You can also train an agent in the Godot editor, without the need to export the

1. Download the Godot 4 Game Engine from [https://godotengine.org/](https://godotengine.org/)
2. Open the engine and import the JumperHard example in `examples/godot_rl_JumperHard`
3. Start in editor training with: `gdrl`
3. Start in editor training with: `python examples/stable_baselines3_example.py`

### Creating a custom environment

Expand Down
6 changes: 6 additions & 0 deletions godot_rl/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"""

import argparse
import warnings

try:
from godot_rl.wrappers.ray_wrapper import rllib_training
Expand Down Expand Up @@ -94,6 +95,11 @@ def get_args():


def main():
warnings.warn(
"This use of gdrl is deprecated and will be removed in version 1.0, please refer to the examples in the github repo",
DeprecationWarning,
)

args, extras = get_args()
if args.trainer == "rllib":
training_function = rllib_training
Expand Down

0 comments on commit ab8a971

Please sign in to comment.