mohsenph69 / Godot-Neural-Networks

Provide a fast way to create neural networks for game ai in godotengine
MIT License
67 stars 15 forks source link

Building experience on Windows10 with minGW and Godot 3.5.1, incompatibility found #10

Open DeRobyJ opened 1 year ago

DeRobyJ commented 1 year ago

Just here to decument the steps I did to compile the library, and what didn't work

First off, for godot-cpp, I chose the 3.5 branch, followed the tutorial and used this command in the end: scons platform=windows generate_bindings=yes use_mingw=True target=release Notice the target=release: this has to be the same you will use when building the library. You may also add "-j 1", to limit compilation to 1 thread, as the main time bottleneck for me was the file saving at the end for some reason. It doesn't take much time anyway.

Then, for the library itself, I cloned from this fork: https://github.com/Tianmaru/Godot-Neural-Networks because of the godot-headers folder name update that happened somewhere after Godot 3.2. Making sure that godot-cpp is in a subfolder of the library folder ("gnn" in the video), I had to delete some flags in the SConstruct, specifically -W3, -GR and -EHsc when targeting "release", and probably -MDd in debug, maybe change that with -MD that is used in release. These flags are all specific to windows, I didn't find a documentation, bug hopefully they were not important.

But in any case, it didn't work, once trying to load the libraries with Network.new() in godot, I run into an exception right away telling me that the .dll lacks the nativescript_init handle. I guess it's an incompatiblity, and I'll revert back to Godot 3.3

DeRobyJ commented 1 year ago

3.3.4 didn't work either (I rebuilt godot-cpp and the library), I got the same error 3.2.3, still using the fork with the header folder name update. I got the same error again

So at this point I just try 3.1.2, and I clone the main repository of gnn, since godot_headers has the old name there. For 3.1.2, when building godot-cpp for windows, an additional argument is required, bits=64 (or 32). On later versions it seems to be automatically defined. Compilation of godot-cpp failed because the last command is too long (there's a limitation on windows of 8191 characters in a single command).

I don't really know what to try :/