How Could I Integrate Armory With Enet?

Continuing the discussion from [FAQ] The Top Things I Wish I Knew When Starting With Armory:

I don’t know anything about how Enet works, but here are my thoughts:

It might be possible to write and Enet client in Haxe, but I’m not sure how that would work, especially when you need an Armory game to host the server. It might not work at all.

If you wanted to integrate Armory with Enet, instead of writing a Haxe client for it, you would probably have to get it worked into Kore which is the C++ core of Armory ( see Armory Architecture for more details on how the different pieces of Armory fit together ). That means that you would have to get @RobDangerous to buy into integrating Enet with Kha, the framework that Armory is built on.

If @RobDangerous didn’t want to make Enet a part of Kha, then it is still possible to include Enet as a native library for Armory C/C++ builds if you write the Haxe bindings for it ( which are kind of like C++ headers except in Haxe ). That still doesn’t cover getting Enet working in Krom for dev builds of the game, though. In order to do that, you would have to write JavaScript bindings for Enet as well and put those in your own fork for Krom. Its a little bit involved.

Kha does have some networking stuff built in right now, but I don’t know what state it is in ( @RobDangerous ? ) It has an automated setup for building a networking server for your game deployed to NodeJS. In the future, I’m pretty sure we would want to use Kha’s builtin networking when it is ready, unless Enet looks like a good fit for Kha.

Thanks, I guess I better just wait until everything matures a little more, but still is great to know that if I want it I can integrate both.

I like Enet because back in the day when I was bored of playing Quake 3, I liked to try some free arena shooters like Warsow, Open Arena or Sauerbraten which is the one who uses Enet.

And it worked really well so I have a good impression of it, but I don’t know the technicalities and maybe is better to just use what it comes with Kha and forget about it completely.

As long as I can have my 1337 hardcore 125fps servers I’ll be happy :laughing:

1 Like

The networking in Kha is not ready for general consumption. The network protocol is the easy part of that though (it’s at https://github.com/Kode/Kore/blob/master/Sources/Kore/Network/Connection.cpp) so I have zero intentions of integrating any third party lib for that.
If you however want to integrate some C/C++ lib yourself, that’s easy to do and you can find examples of that at https://github.com/Kode/Kha/wiki/Libraries - integrating it in Krom is similarly easy and you can have a look at the Krom sources themselves for plenty of sample code.

PS: Just in general, getting @RobDangerous to buy into integrating any libraries in Kha at all is bound to fail. He likes to do everything himself.

5 Likes

That’s just what I wanted to know, thank you.

1 Like