godotengine / godot-cpp

C++ bindings for the Godot script API
MIT License
1.57k stars 471 forks source link

Curve.add_point has changed and has no compatibility function #1512

Open fire opened 5 days ago

fire commented 5 days ago

Godot version

https://github.com/godotengine/godot/tree/4ab8fb809396fa38ba929fec97cfcb7193f1c44d

godot-cpp version

https://github.com/godotengine/godot-cpp/tree/99926d8e2027f6bfdc66e341a1c735b20eda61e4

System information

Windows 11, Nvidia 3090, Vulkan forward+

Issue description

We are trying to upgrade to 4.3 and loading with godot double precision crashes when using the gdextension.

https://github.com/Vahera/godot-orchestrator/pull/450

Also, I noticed that execution of the game doesn't crash, but the editor does.

Steps to reproduce

  1. compile godot engine precision=double
  2. load project
  3. load gdextension for orchestrator
  4. open a orchestration file

344434483-7831078d-c271-4f44-a5c0-b04e606e5655

Minimal reproduction project

godot-orchestrator-demo-windows-release(3).zip

dsnopek commented 3 days ago

Compatibility methods are something that needs to be added on the Godot side, so this issue should probably be moved there.

Also, you should make sure that you're compiling your GDExtension with precision=double and using an extension_api.json that was generated from a Godot that was built with double precision. The method hashes can be different between single and double precision builds, so you need to make sure to have those aligned.

Naros commented 3 days ago

@dsnopek in that case, I bet its the extension_api.json issue then, because I believe Fire and I were using the single precision file that was included in the godot-cpp checkout by default.

I wonder if it would be helpful to have extension_api_single.json and extension_api_double.json be something that can be maintained in godot-cpp's repository and then have the bindings generator base which gets used off the build configuration?

This would certainly make it easier for plug-in maintainers to actually generate a double and single precision build without having to fiddle with the export dumps on CI imo.

dsnopek commented 3 days ago

It would be nice to have something in the extension_api.json to identify whether it was generated with a single or double precision build, so we could detect and error out if someone is trying to make a precision=double build with a bad extension_api.json.

I don't know that we should be including the double precision JSON file in godot-cpp, though. Godot doesn't distribute official double precision builds, and so I don't know that we want to include extension_api.json files from non-official builds in godot-cpp. If folks are making their own Godot builds (which is required for double precision), they should be using their own extension_api.json.

fire commented 3 days ago

Yes! An error would be great so I didn’t need to go a wild goose chase.