godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.89k stars 20.16k forks source link

MessagePack support #12134

Closed RiverMesa closed 4 years ago

RiverMesa commented 6 years ago

MessagePack is a binary data interchange/serialization format, similar to something like JSON (which Godot already supports), except (as its website claims) it's fast and small - at the cost of human-readibility when encoded (as, again, it's a binary format).

I'm no expert on the subject (and I'd gladly appreciate opinions of people who are more educated in that regard), I do think that something like this could be a useful addition to the engine, especially with regards to networking and compiled code (ie. when working with C++/C#/GDNative).

While I am trying to implement this myself (over here) using the MPack C implementation (as all the C++ implementations seem to require C++11 and/or Boost, which IIRC are less than ideal for Godot, and the reference C implementation seems a bit bulky and isn't suited towards embedding, or at least isn't advertised as such, unlike MPack), I'd appreciate others' thoughts on this (and perhaps some help with the module work, I'm...uh, not very good at it) - maybe there actually isn't a need/desire for this and I'm just doing it for nothing.

ghost commented 6 years ago

@RiverMesa definitely a good desire.

crystal lang, for example has https://github.com/crystal-community/msgpack-crystal msg bindings. also: crystal works pretty nice with godot (very easy to setup to communicate messages over TCP). especially since godot sends the unsigned bit prefixed before the string. which makes it super easy to read from crystal's read_bytes(Int32) method.

also, msgpack has binding for ton of server-side languages as well (nodejs, etc). so the game developer from godot can choose whatever server side language they want, and if msgpack was supported by godot, it would pair beautifully.

a lot less bandwidth over the pipes compared to regular json as well.

jonbonazza commented 5 years ago

Has there been any more talks about this? Would be super handy!

Benoit9 commented 5 years ago

I was wondering about the same thing. Godot already has a binary serialization format: https://docs.godotengine.org/en/3.1/tutorials/misc/binary_serialization_api.html So are non-godot servers reimplementing the Godot packet format? I can't find much info about this topic.

jonbonazza commented 5 years ago

@benoit9 non-godot servers usually don't use tge high level multiplayer api and implement their own SerDe on both client and server.

Benoit9 commented 5 years ago

@jonbonazza I see. That makes sense, thank you.

So this issue is still relevant: a MsgPack module for Godot would be useful. It doesn't look like it (or something similar) exists yet.

toboRlivE commented 4 years ago

I was also hoping to find support for msgpack in the core. I think integrating things like neovim in the editor would require it, but it would make linking workflow from other tools possible with python plugins(blender, gimp). I'm looking at putting msgpack blobs into an in-memory sqlite db. Also looking at using msgpack to define tasks for a task queue. Anyone making games that need custom net protocols could benefit.

Calinou commented 4 years ago

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!