From 3512739f0aad02485d95bf8d8c93cb3ccc721bfb Mon Sep 17 00:00:00 2001 From: Edward Beeching Date: Thu, 29 Aug 2024 15:30:30 +0200 Subject: [PATCH 1/2] deprecates the use of gdrl --- README.md | 10 +++++++--- godot_rl/main.py | 4 ++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 145ea4a8..cf3be648 100644 --- a/README.md +++ b/README.md @@ -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 ``` @@ -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 diff --git a/godot_rl/main.py b/godot_rl/main.py index 3de3027d..d63d0f0b 100644 --- a/godot_rl/main.py +++ b/godot_rl/main.py @@ -21,6 +21,7 @@ """ import argparse +import warnings try: from godot_rl.wrappers.ray_wrapper import rllib_training @@ -93,7 +94,10 @@ def get_args(): return args, extras + 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 From 9cc946f765e809b2b5cbdd33525b75aa3f7e6789 Mon Sep 17 00:00:00 2001 From: Edward Beeching Date: Thu, 29 Aug 2024 15:57:08 +0200 Subject: [PATCH 2/2] style --- godot_rl/main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/godot_rl/main.py b/godot_rl/main.py index d63d0f0b..b1658883 100644 --- a/godot_rl/main.py +++ b/godot_rl/main.py @@ -94,10 +94,12 @@ def get_args(): return args, extras - 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) - + 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