edbeeching / godot_rl_agents

An Open Source package that allows video game creators, AI researchers and hobbyists the opportunity to learn complex behaviors for their Non Player Characters or agents
MIT License
942 stars 69 forks source link

feat(multi discrete action spaces): added support for multi discrete action spaces #110

Closed visuallization closed 1 year ago

visuallization commented 1 year ago

@edbeeching I added support for multi discrete action spaces so discrete action spaces > 2 can also be used with with stable baselines 3. What's your take on it? Is this alright or will it break anything in terms of rl algorithms?

visuallization commented 1 year ago

This also makes it work with clean-rl :)

edbeeching commented 1 year ago

Thanks for adding this implementation. It would great to also have an example environment to demonstrate and test this implementing on. I understand that this could be a lot of work. What environment would you imagine using multi-discrete space in ?

visuallization commented 1 year ago

I am currently using multi-discrete spaces like this:

https://github.com/visuallization/godot-4-ml-platformer/blob/main/environments/platformer/PlatformerAgent.gd

image

I know that you could also implement it in the way you did with Jumperhard where you used 2 continuous spaces and 1 discrete, but I like to have the flexibility. The cool thing with this is that it should also support then spaces n > 2. But it still needs some testing from my side.

Of course this also just applies if convert option is true. if not we just work directly with the dictionary and can have mixed spaces