-
Notifications
You must be signed in to change notification settings - Fork 0
Godot 4 version ? #1
Comments
Yes, it's planned when GDExtension is stable. |
I know there are reasons to use C extensions. C# side of things seems to be working.
|
Hi there, super noob here. First of all, thanks for working on this project, it's way above my paygrade. Could someone please tell me if my assessment of the current situation is correct? I'm still very new to this so please forgive my ignorance.
-BUT if I can figure out how to add the GDExtension to Godot 4, then I can use it to add the C# script above, and it will work? -AND if I can't figure out how to do that, then this functionality is planned when GDExtension is merged into a future stable release of Godot 4.x? Do I have all that right? I love the idea of being able to use MQTT to link Godot with my Home Assistant environment, and be able to feed sensor data in and trigger switches from a custom Godot dashboard, but I don't currently have the base knowledge or skills to figure it out the MQTT link by myself and can't find a addon/script for MQTT support that is out-of-the-box compatible with Godot 4. Thank you!!! |
My understanding is that GDExtensions are the glue into C++ libraries. You would use C++ for speed and compatibility across multiple build targets/platforms. Using C# on the other hand, limits the compatibility to desktop builds (?), but allows you to leverage C# and everything .NET in your projects. The code posted above would work out of the box by referencing the MQTTNet .NET libraries. I typically use JetBrains Rider for .NET development and like with any .NET IDE, you would reference MQTTNet library from Nuget. |
Hello, Godot3 use system called GDNative for C++ plugins. In Godot4 the system was completely rebuild from scratch and called GDExtension. The problem is : GDExtension is not currently mature and the API is susceptible to change one day to another. So I decide to let the Godot4 version in standby for now. About C#, there is no relations between GDNative/GDExtension and C#. Codes from Godot3 should works in Godot4. |
But if it's really necessary, I can create a prototype using GDExtension. By the way, this plugin is part of a collection of plugins called GDWired (https://github.com/GDWired), I've created another plugin for MQTT using Paho called GDPaho (https://github.com/GDWired/GDPaho) also only for Godot3. |
That is all very helpful, thank you for your clear answers and all your hard work! The BLE support would be really fun to play with as well. I don't really NEED any of this functionality, and I probably wouldn't know how to use most of it anyway, I'm just excited to start playing with realworld data in Godot, and I've only ever used Godot 4. I'll be standing by for Godot 4 support whenever that happens, and following along as the GDWired project develops, thank you! |
OK, so I decided to just download 3.5 (and 4.1, which apparently came out last week) so that I could see if that unbreaks some the 3.5 projects I've downloaded and had trouble with in 4.0.3. I was able to load the sample scene with no errors, but I'm not sure what to do with it from there. If I just open the project and run the debug, I see the interface, but the buttons don't seem to do anything and there is no input fields to put in credentials. It seems like I have to put in my MQTT host address, port, username, password, and MQTT topics somewhere in this code, but I can't figure out where. I see this bit in GDMosquito.gd
And I'm guessing this has something to do with setting the password but I don't understand what to do with it, if anything. And now that I'm looking at it again, there is also a reference to a certfile, which makes me think this is maybe for setting up a new MQTT broker? Is that necessary if I'm already running a Mosquito Broker through my Home Assistant server on my local network? Is it possible to subscribe a topic (like /homeassistant) and then receive/print MQTT updates from Mosquitto/Home Assistant within the game environment? Hope these aren't dumb questions, I appreciate your help! |
Mosquitto version 2+, by default, binds to 127.0.0.1 on port tcp/1883 and allows anonymous connection (no user, no password). Certificate is only required if you configure Mosquitto for TLS (encrypted communication). If Mosquitto is running on a different computer than your client (eg. Godot) then you need to modify your Mosquitto configuration to bind to 0.0.0.0 (or a specific host IP address) and enable tcp listener (eg. port 1883). |
Looks like here is where the connection actually happens.
|
The discution is moved here #2 because no more related to Godot4 |
Is it possible to port this plugin to Godot 4 format?
The text was updated successfully, but these errors were encountered: