Could I create a separate module from the new multiplayer system for version 2.1.3?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By PerduGames
:warning: Old Version Published before Godot 3 was released.

I need to integrate multiplayer with my game, I read recently:

And I liked it, I was starting to study enet to create a module, and to come across it was good, and I thought if it is already done, it is not necessary to recreate, I just create a separate module and add it to 2.1.3, since it uses Enet, I could “create” with the same names that will be in the new version, and would create a new module, which would be enet + the c ++ files for the multiplayer functions, could I do this?

Up 1:

I thought here, maybe do what I said above even if instead of creating my own module from scratch from enet (I had decided), but only if it is really simpler, what I think is the “new-high- Networking”, it uses enet, creates its functions to abstract enet, and it is implemented in the “scenetree.cpp” file, as it speaks in the godot documentation, so I took a look at the git source, A class, called “networkedmultiplayer_peer” that is in core/io/, summarizing what until now I know what needs to be done, or create these separate files in a module, or just add them inside the project and recompile the godot, that If you do not interfere in anything else, which I’m not sure yet. To compile a separate mode would do this:

0 - Create a folder for the module “net”
1 - Copy the files “networkedmultiplayerpeer” that is in core/io/ to the “net” folder
2 - I would create a new class, and would copy the functions that are in the “scenetree” file (when I say file, I am referring to the declaration and implementation, ie two files) for my new created file
3 - I would copy the enet files from the modules/enet/ folder to my “net” folder and set the include to the file “networkedmultiplayer_peer” which is now in the “net”
4 - Compile the module
5 - I would use the module and create my multiplayer game

Am I forgetting something? I’m traveling a lot? Or would that really work?

:bust_in_silhouette: Reply From: volzhs

Yes, you can.

Here is how to make a custom module.

Here is how to compile tools and templates.

I’ve read the documentation of enet and found it simple, I think I will use enet directly, I mean I will create a module that will abstract the enet a little, something simple and straightforward, because what I want in logic is just a game of pong.

PerduGames | 2017-07-18 18:27