Skip to content
This repository has been archived by the owner on Dec 29, 2024. It is now read-only.

Move to GDExtnension #54

Closed
Trey2k opened this issue Jan 12, 2023 · 10 comments · Fixed by #79
Closed

Move to GDExtnension #54

Trey2k opened this issue Jan 12, 2023 · 10 comments · Fixed by #79

Comments

@Trey2k
Copy link
Member

Trey2k commented Jan 12, 2023

GDExtension looks great! And will allow for much easier inclusion of our api in games. It seems to be pretty flashed out now and works closely to how modules do. This should be done before v2.

https://godotengine.org/en/article/introducing-gd-extensions

@Trey2k
Copy link
Member Author

Trey2k commented Jan 13, 2023

This may not actually be very feasible. Currently GDExtension does not support CallableCustoms which means we would lost the LuaCallable type. On top of that it appears to not support protected calls on any callable. Which means we would not get error handling for lua calling GD functions.

@Trey2k Trey2k added wontfix This will not be worked on and removed enhancement labels Jan 13, 2023
@Trey2k
Copy link
Member Author

Trey2k commented Jan 13, 2023

For the time being we will remain a module.

@Trey2k Trey2k added enhancement and removed wontfix This will not be worked on labels Jan 19, 2023
@Trey2k
Copy link
Member Author

Trey2k commented Jan 19, 2023

I'm going to take another look at this. I think I can find a suitable work around. Main issue right now is there does not seem to be away to create our own callable type. We could look for alternative methods but this has made connecting Lua functions to signals very easy. So it would be a shame to lose them.

@Fran6nd
Copy link

Fran6nd commented Jan 20, 2023

IIt would be awesome especially now that updates are coming frequently, because recompiling each time for each platform... That's painful.
Il I am used to work with modules... I am pretty new to GDEXTENSION as it's new too... So it is not clear to me how to do it yet.

@Trey2k
Copy link
Member Author

Trey2k commented Jan 20, 2023

IIt would be awesome especially now that updates are coming frequently, because recompiling each time for each platform... That's painful. Il I am used to work with modules... I am pretty new to GDEXTENSION as it's new too... So it is not clear to me how to do it yet.

Here is my current plan regarding this, once we finish bringing the documentation up to date, finish writing the tests as well as #63 / #64 I am going to ask in the godot rocket chat if it is possible. because like you I am very new to GDExtension and there is very little documentation for it right now.

If it turns out its not possible I will create the best work around I can come up with. At that point we will determine if it is worth it or not. I understand the pain of recompiling so I really would like to make the move.

@Trey2k
Copy link
Member Author

Trey2k commented Jan 24, 2023

Small update. I'm almost done wrapping up #63 and #64. I have asked in the godot rocket chat if a method exists, however after looking again I'm fairly confident one does not.

So the best work around I have come up with would be to change the type of LuaCallable from CallableCustom to RefCounted. Then we can return a Callable with the object set to the "LuaCallable". This would work but does not feel the cleanest. If anyone had other ideas I am all ears.

@Trey2k
Copy link
Member Author

Trey2k commented Jan 25, 2023

One other thing. I also do not want to drop module support. We can use compiler defs so it will build for both. Similar to how godot_voxel does it.

@Trey2k
Copy link
Member Author

Trey2k commented Jan 25, 2023

This probably wont be worth looking into much more until godotengine/godot-cpp#802 is resolved.

@Trey2k
Copy link
Member Author

Trey2k commented Jan 28, 2023

We can work around 802. I'm waiting on this PR then I think it should be possible.

@Trey2k Trey2k linked a pull request Jan 29, 2023 that will close this issue
@Trey2k Trey2k closed this as completed in #74 Feb 4, 2023
@Trey2k Trey2k removed a link to a pull request Feb 4, 2023
@Trey2k Trey2k reopened this Feb 4, 2023
@Trey2k Trey2k linked a pull request Feb 4, 2023 that will close this issue
@Trey2k
Copy link
Member Author

Trey2k commented Mar 28, 2023

In order to get the ball rolling on this, I am going to maintain a fork of godot-cpp with #1017 applied. As well as any other patches we may need. As GDExntension its self seems to work fine. But godot-cpp is getting not love at all since the release of godot 4.0

@Trey2k Trey2k moved this to Testing in v2 for godot v4 Mar 29, 2023
@Trey2k Trey2k moved this from Testing to Done in v2 for godot v4 Jun 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants