Skip to content

Conversation

@Faless
Copy link
Collaborator

@Faless Faless commented Jun 8, 2022

We can finally ditch that ugly mess that's the chromium WebRTC library thanks to a sane implementation: libdatachannel.

This PR also adds GDExtension (godot 4) support. See the updated README.

Draft status:

See here for prebuilt binaries (current master as of writing, but might break before Godot 4 is released).

See here for Godot 4.0 alpha-10 and Godot 3.5 builds.

@Faless Faless added enhancement New feature or request Upstream An issue that is due to Godot Engine and not (just) the plugin itself. labels Jun 8, 2022
@Faless Faless requested a review from dsnopek June 8, 2022 22:05
@Faless Faless marked this pull request as draft June 8, 2022 22:06
@dsnopek
Copy link
Contributor

dsnopek commented Jun 9, 2022

I compiled the Godot 3 version per your instructions on Twitter (scons godot_version=3 arch=x86_64) and it worked in a couple minutes of testing with a real game! It's nice not to see the see console spam that the Google implementation generates. :-)

I'll try to test the Godot 4 version soon as well.

@dsnopek
Copy link
Contributor

dsnopek commented Jun 9, 2022

I haven't managed to do a really solid test of the Godot 4 version yet, but I just wanted to point out that the paths are mostly wrong in the *.gdextension files in the binary release linked in the issue description. It's got them all with "x86_32" in their filenames, rather than the correct architecture:

linux.x86_64 = "res://webrtc_debug/lib/libwebrtc_native.linux.debug.x86_32.so"
linux.x86 = "res://webrtc_debug/lib/libwebrtc_native.linux.debug.x86_32.so"
osx.x86_64 = "res://webrtc_debug/lib/libwebrtc_native.osx.debug.x86_32.dylib"
osx.arm64 = "res://webrtc_debug/lib/libwebrtc_native.osx.debug.x86_32.dylib"
windows.x86_64 = "res://webrtc_debug/lib/libwebrtc_native.windows.debug.x86_32.dll"
windows.x86 = "res://webrtc_debug/lib/libwebrtc_native.windows.debug.x86_32.dll"
android.armv7 = "res://webrtc_debug/lib/libwebrtc_native.android.debug.x86_32.so"
android.arm64 = "res://webrtc_debug/lib/libwebrtc_native.android.debug.x86_32.so"
android.x86_64 = "res://webrtc_debug/lib/libwebrtc_native.android.debug.x86_32.so"
android.x86 = "res://webrtc_debug/lib/libwebrtc_native.android.debug.x86_32.so"
ios.arm64 = "res://webrtc_debug/lib/libwebrtc_native.ios.debug.x86_32.dylib"
ios.x86_64 = "res://webrtc_debug/lib/libwebrtc_native.ios.debug.x86_32.simulator.dylib"

My system is Linux 64-bit, so when it tried to load the GDExtension I got this error: Can't open dynamic library: /home/dsnopek/games/godot4-nakama-webrtc/webrtc_debug/lib/libwebrtc_native.linux.debug.x86_32.so. Error: /home/dsnopek/games/godot4-nakama-webrtc/webrtc_debug/lib/libwebrtc_native.linux.debug.x86_32.so: wrong ELF class: ELFCLASS32

After I corrected the path, it appears to be loading correctly.

@Faless
Copy link
Collaborator Author

Faless commented Jun 9, 2022

Thanks for trying out the PR!
The paths should be fixed now.

@dsnopek
Copy link
Contributor

dsnopek commented Jun 10, 2022

The paths should be fixed now.

Awesome, thanks!

I've started porting a small-ish WebRTC project to Godot 4. I was hoping to get it done today, but that may have been a little optimistic. :-) I'll come back to it on the weekend, and let you know how it goes!

@dsnopek
Copy link
Contributor

dsnopek commented Jun 12, 2022

I ported my "WebRTC and Nakama addon" to Godot 4:

https://gitlab.com/snopek-games/godot-nakama-webrtc/-/commits/godot-4

... and, using the binary builds linked above, got the demo game actually working!

Skimming the code changes, everything seems fine to me. It's very clever how you have it supporting both GDNative and GDExtension :-)

@fire
Copy link
Member

fire commented Jun 13, 2022

godotengine/godot#61839 merged

@Faless Faless force-pushed the libdatachannel_pr branch 5 times, most recently from f813acd to 764f253 Compare June 15, 2022 19:13
@Faless Faless marked this pull request as ready for review June 15, 2022 19:13
@Faless Faless force-pushed the libdatachannel_pr branch from 764f253 to e19b370 Compare June 15, 2022 19:37
@Faless
Copy link
Collaborator Author

Faless commented Jun 15, 2022

Updated the test release Now released as alpha with both GDExtenstion (4.0-alpha10) and GDNative (3.5) version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Upstream An issue that is due to Godot Engine and not (just) the plugin itself.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants