-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement socket communication via protocol buffers #49
Comments
Hi Douglas, yes! I am very familiar with protobuffs, as I use them regularly in my everyday work at Google. That would be great! As I mentioned on the Gradle-related pull request, if we go with this, I'd like to do it in a way that we do not depend on an external package, so I need to think about how to do this. But yes, it's something I'd definitively be interested in! |
I haven't used protobufs before but I believe that, once the classes derived from the protos are generated, you actually don't need any dependencies. All the methods necessary to serialize and deserialize objects are contained inside the classes. It would be good to add the protos to the repo, though. |
Yes, I agree. That would be a good solution. Add the protobuffs to the repo (and maybe a build script for whoever wants to rebuild), but include the result of compiling them in to a Java class! |
OK, I'll investigate this further in a fork. |
Awesome, thanks a lot! (apologies for rejecting your other pull request concerning Gradle, but that was something I really didn't want to do). |
That pull request was not mine! |
oh, true! got confused, since you replied there, my bad! :) |
Hello @santiontanon . You have mentioned to me in another medium that, when communicating to and from MicroRTS using sockets, building and passing XML and JSON messages creates a bottleneck in simulation time.
I have seen a tendency in the community to opt for protocol buffers (protobuf) when communication time is a priority over human-readability.
Basically, you create a
.proto
text file which dictates the message format, compile it using a tool that generates classes in multiple languages, and use these classes to create interchangeable objects, which can be serialized in byte arrays, for example.I have found this comparison between JSON and Protobuf which indicates that the later is up to 5x times faster.
I was working through the tutorials and ended up creating a
.proto
file for a MicroRTS game state and was thinking about testing it sometime soon.If successful, would there be interest to include something like this into MicroRTS?
The text was updated successfully, but these errors were encountered: