-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exporting A Game. How it works? #1
Comments
Thanks for such a positive comment and first issue. Regarding model export, currently the model is always hosted in python, which means python is a dependency. But this is one of the key changes that will be made in v0.2.0 (in around 1 month, see the roadmap for other changes due). I am currently testing using the C# library TorchSharp for loading and running the trained model inside Godot, which will remove the python dependency (once the model is trained). |
You may also take a look at ONNX export: https://stable-baselines3.readthedocs.io/en/master/guide/export.html#export-to-onnx |
hmm thanks for the response! Wel When I was looking for How to implement Reiforcement Learning, I was looking for a C++ implementation, because then I could make as a GDExtension (for godot 4) then this would not require any dependencies for end-users, I found some here on gitrhub but no documentation others abandoned! I really want to use this in my project but at the end it needs to be exported, so I can help in the project, (like porting to godot 4) I just wanted a way to do it in c++... |
Do you need to perform the training inside Godot, or just the model inference? A word of caution from someone who has learned this the hard way, implementing (Deep) RL algorithms can be a good learning experience, but is challenging, slow, frustrating and hard to debug. In additional I am not sure if there is a GDNative Neural Network library available, so that would need implementating as well. This is the reason I have chosen to perform training on the python side and eventually inference will be available inside Godot. There is also the benefit of running several parallel executables to speed up training. |
Nope I dont want to implement it! I was just looking for a library, the thing is that seems that python is the only way out. The problem now is: how can we export a game with pre-trained models? |
Currently Microsoft is organizing a hackathon for 1 week starting NOW!!!!. They need someone to introduce Godot and Machine learning. If you have some example, please join and share at least one Godot RL example. If you can give us some help, please check this Basically, we are trying to use this Godot RL example, but attempting to remove python dependency |
looking forward to your great work! gdrl is already an amazing tool, potentially providing endless possibilities of game enviroments for testing varing RL algorithms. But, integrating the trained model into Godot engine for inference is much more attractive to us game developers anyway ^_^. |
Is there any progress on this? Would be great to be able to use a trained model to do inferencing on a mobile device. |
Hello, it is possible to export to onnx and run inference in Godot: There's some more info about using the sb3 example file: However, I have only tested this on Windows so far. An additional note is to make sure to copy the onnx file to the same relative path from the exported .exe file as specified in the In Godot 4.1.2, if I try to select the Android export template, I get an error message that says: |
Hi. Yes I think in Godot 4 C# is not supported yet for mobile and web export. It works for 3.5 and is it on the 4.x roadmap. So we are waiting for Godot on this one. I will leave this open until they add the support. |
Experimental support for web exports is available in this repo: https://github.com/TechnoLukas/godotrl-web/tree/main |
So, First of all, this is an awesome project, thanks for that!
Did you tested on exported games? I took some read and seems to exist pre-trained models, so how is the approach to have an exported game which doesnt need dependencies (like python or so)?
The text was updated successfully, but these errors were encountered: