A better ENet module for high performance multiplayer games with godot

About

The benet module for Godot is a fork of NetworkedMultiplayerPacketPeer (although it stays compatible) to allow access to multiple channels and the ability to run multiple clients/servers in the same scene.

The module is composed by two parts:

  • ENetPacketPeer: The fork of NetworkedMultiplayerPacketPeer

    • create_server: Add parameter to specify max channels (default 1)
    • create_client: Add parameter to specify max channels (default 1)
    • put_packet_channel: New method, allow to put a packet in the specified channel
    • send (_unreliable, _ordered) allow to send to specific client in reliable, unreliable, ordered way whlie selecting the channel
    • broadcast (_unreliable, _ordered) allow to broadcast a packet in a reliable, unreliable, ordered way while selecting the channel
  • ENetNode: Act like SceneTree:

    • Poll on idle/fixed time (must be in tree to work!)
    • Emit signals on idle/fixed time (must be in tree to work!)
    • Emit additional server_packet and client_packet signals when receiving packets
    • Allow kicking clients by unique id.
    • Will hopefully support RPC in the future

Installation

Being a module you will need to recompile godot from source. To do that:

  1. Clone the godot engine repository
  2. Copy the benet folder from this repository into the godot modules folder
  3. Recompile godot (see http://docs.godotengine.org/en/latest/reference/_compiling.html )

Usage

For usage examples please refer to the project in the demo folder.

The methods should be self explainatory.

Disclaimer

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Owner
Fabio Alessandrelli
Computer scientist, traveller, life hacker.
Fabio Alessandrelli
Comments
  • ENetPacketPeer and ENetNode locks the node in which it is or is called

    ENetPacketPeer and ENetNode locks the node in which it is or is called

    I'm having another problem, I can not do this:

    Var enetNode = ENetNode.new ()

    or

    Var peer = ENetPacketPeer.new ()

    When testo in the editor works, but when I compile (tested X11 64 and 32, and android) does not work, it hangs the script in which one of these lines is, whether in singleton script or not. Specifically I tested putting the line on a button or calling some variant of a global script in the button script, and it happens to hang, the button is like it did nothing.

  • Compiling error with Godot 2.1.3

    Compiling error with Godot 2.1.3

    I get the following error when trying to compile the 2.1 branch with Godot 2.1.3:

    modules\benet\enet\godot.cpp(111): error C2039: 'set_blocking_mode': is not a member of 'PacketPeerUDP'

    If I remove that line, instead of tinkering with the Godot core code, I get the following error trying to compile:

    modules\benet\enet_packet_peer.cpp(622): error C2440: '=': cannot convert from 'void' to 'int'

  • Benet and Scenetree.

    Benet and Scenetree.

    From the looks of it, the channels are merged into one buffer.

    I presume I would have to make changes to Scenetree to allow different channels for personal uses in order to use godot high level networking

    https://godotengine.org/article/godots-new-high-level-networking-preview

    Otherwise, I would have to roll my own networking solution.

  • About create_server and create_client

    About create_server and create_client

    I am confused with the module, you create a server with ip that is taken from the machine ip, then on the client you have the option to put the address, which is to create the client at that address, right, but it arrives in the part to connect , And you connect it to the variable "host", but "host" is in your machine, not able to view it between two or more machines, I will have to create one server, and the other two clients, But how would it connect it to the server, if the "host" gets the ip of the machine?

    If I want to do a P2P, can I create multiple servers and connect to each other and just send broadcast between them?

  • Building against master with mono

    Building against master with mono

    Hi,

    Is it meant to be possible to build against godot master with mono? Once I attempt to compile (post generating glue code) I run into errors: (CoreCompile target) -> ObjectType/ENetNode.cs(63,55): error CS1003: Syntax error, ',' expected ObjectType/ENetNode.cs(63,56): error CS1003: Syntax error, ',' expected ObjectType/ENetNode.cs(63,70): error CS1001: Identifier expected ObjectType/ENetPacketPeer.cs(78,38): error CS1003: Syntax error, ',' expected ObjectType/ENetPacketPeer.cs(78,39): error CS1002: ; expected ObjectType/ENetPacketPeer.cs(78,55): error CS1003: Syntax error, ',' expected ObjectType/ENetPacketPeer.cs(78,56): error CS1003: Syntax error, ',' expected ObjectType/ENetPacketPeer.cs(78,69): error CS1001: Identifier expected ObjectType/ENetPacketPeer.cs(78,82): error CS1003: Syntax error, ',' expected ObjectType/ENetPacketPeer.cs(78,83): error CS1003: Syntax error, ',' expected ObjectType/ENetPacketPeer.cs(78,86): error CS1001: Identifier expected ObjectType/ENetPacketPeer.cs(80,120): error CS1525: Invalid expression term 'int'

⚡High Performance DICOM Medical Image Parser in Go.
⚡High Performance DICOM Medical Image Parser in Go.

dicom High Performance Golang DICOM Medical Image Parser ?? v1.0 just released! This is a library and command-line tool to read, write, and generally

Jan 4, 2023
The imghdr module determines the type of image contained in a file for go
The imghdr module determines the type of image contained in a file for go

goimghdr Inspired by Python's imghdr Installation go get github.com/corona10/goimghdr List of return value Value Image format "rgb" SGI ImgLib Files

Oct 10, 2022
Human-friendly Go module that builds and prints directory trees using ASCII art

Human-friendly Go module that builds and prints directory trees using ASCII art.

Oct 11, 2022
A golang wrapper module to interact with `fit-statUSB` device over serial.

go-fitstatusb A golang wrapper module to interact with fit-statUSB device over serial. This is experimental at best, not ready for production. Backgro

Feb 4, 2022
Go package for fast high-level image processing powered by libvips C library

bimg Small Go package for fast high-level image processing using libvips via C bindings, providing a simple programmatic API. bimg was designed to be

Jan 2, 2023
Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing

imaginary Fast HTTP microservice written in Go for high-level image processing backed by bimg and libvips. imaginary can be used as private or public

Jan 3, 2023
Go bindings for libVLC and high-level media player interface
Go bindings for libVLC and high-level media player interface

Go bindings for libVLC 2.X/3.X/4.X and high-level media player interface. The package can be useful for adding multimedia capabilities to applications

Dec 31, 2022
Efficient moving window for high-speed data processing.

Moving Window Data Structure Copyright (c) 2012. Jake Brukhman. ([email protected]). All rights reserved. See the LICENSE file for BSD-style license. I

Sep 4, 2022
An iterative algorithm to generate high quality triangulated images.
An iterative algorithm to generate high quality triangulated images.

Triangula uses a modified genetic algorithm to triangulate images. It works best with images smaller than 3000px and with fewer than 3000 points, typically producing an optimal result within a couple of minutes.

Jan 8, 2023
Generate high-quality triangulated art from images.
Generate high-quality triangulated art from images.

An iterative algorithm to generate high quality triangulated images.

May 26, 2021
Dedicated Game Server Hosting and Scaling for Multiplayer Games on Kubernetes
Dedicated Game Server Hosting and Scaling for Multiplayer Games on Kubernetes

Agones is a library for hosting, running and scaling dedicated game servers on Kubernetes. Agones, is derived from the Greek word agōn which roughly t

Jan 6, 2023
Keeps track of Steam Deck Verifications. On first run, it reports all games with their respective Steam Deck Verification status. On subsequent runs, the tool will report newly tested and updated games.

Keeps track of Steam Deck Verifications. On first run, it reports all games with their respective Steam Deck Verification status. On subsequent runs, the tool will report newly tested and updated games.

Feb 2, 2022
Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.
Gin is a HTTP web framework written in Go (Golang). It features a Martini-like API with much better performance -- up to 40 times faster. If you need smashing performance, get yourself some Gin.

Gin Web Framework Gin is a web framework written in Go (Golang). It features a martini-like API with performance that is up to 40 times faster thanks

Jan 2, 2023
🔑A high performance Key/Value store written in Go with a predictable read/write performance and high throughput. Uses a Bitcask on-disk layout (LSM+WAL) similar to Riak.

bitcask A high performance Key/Value store written in Go with a predictable read/write performance and high throughput. Uses a Bitcask on-disk layout

Sep 26, 2022
the pluto is a gateway new time, high performance, high stable, high availability, easy to use

pluto the pluto is a gateway new time, high performance, high stable, high availability, easy to use Acknowledgments thanks nbio for providing low lev

Sep 19, 2021
go-fasttld is a high performance top level domains (TLD) extraction module.

go-fasttld go-fasttld is a high performance top level domains (TLD) extraction module implemented with compressed tries. This module is a port of the

Dec 21, 2022
Dec 28, 2022
Tigo is an HTTP web framework written in Go (Golang).It features a Tornado-like API with better performance. Tigo是一款用Go语言开发的web应用框架,API特性类似于Tornado并且拥有比Tornado更好的性能。
Tigo is an HTTP web framework written in Go (Golang).It features a Tornado-like API with better performance.  Tigo是一款用Go语言开发的web应用框架,API特性类似于Tornado并且拥有比Tornado更好的性能。

Tigo(For English Documentation Click Here) 一个使用Go语言开发的web框架。 相关工具及插件 tiger tiger是一个专门为Tigo框架量身定做的脚手架工具,可以使用tiger新建Tigo项目或者执行其他操作。

Jan 5, 2023
go-fastdfs 是一个简单的分布式文件系统(私有云存储),具有无中心、高性能,高可靠,免维护等优点,支持断点续传,分块上传,小文件合并,自动同步,自动修复。Go-fastdfs is a simple distributed file system (private cloud storage), with no center, high performance, high reliability, maintenance free and other advantages, support breakpoint continuation, block upload, small file merge, automatic synchronization, automatic repair.(similar fastdfs).
go-fastdfs 是一个简单的分布式文件系统(私有云存储),具有无中心、高性能,高可靠,免维护等优点,支持断点续传,分块上传,小文件合并,自动同步,自动修复。Go-fastdfs is a simple distributed file system (private cloud storage), with no center, high performance, high reliability, maintenance free and other advantages, support breakpoint continuation, block upload, small file merge, automatic synchronization, automatic repair.(similar fastdfs).

中文 English 愿景:为用户提供最简单、可靠、高效的分布式文件系统。 go-fastdfs是一个基于http协议的分布式文件系统,它基于大道至简的设计理念,一切从简设计,使得它的运维及扩展变得更加简单,它具有高性能、高可靠、无中心、免维护等优点。 大家担心的是这么简单的文件系统,靠不靠谱,可不

Jan 8, 2023
LinDB is an open-source Time Series Database which provides high performance, high availability and horizontal scalability.
LinDB is an open-source Time Series Database which provides high performance, high availability and horizontal scalability.

LinDB is an open-source Time Series Database which provides high performance, high availability and horizontal scalability. LinDB stores all monitoring data of ELEME Inc, there is 88TB incremental writes per day and 2.7PB total raw data.

Jan 1, 2023