Hi @all,
I have 2 questions about the networking implementation and usage:
1. Is there a documentation for the Networking protocol and System according to sent data, asynchronous commands etc.
2. Is it possible to use the implemented networking features with my own protocol? We defines our own protocol or exactly our purposes, so we would really like to use it here
Greetings,
Haimi
Network Protocol
Project Status: Code architecture definition
6 Programmers, 1 Photographer, 1 Architect, 1 Game designer
6 Programmers, 1 Photographer, 1 Architect, 1 Game designer
Re: Network Protocol
Hi Haimi,
Probably the best (most accurate and most up-to-date) documentation is the source code that implements it.
Depending on what exactly you want to know, I can however browse my archives and see what I can come up with.
That might work, but I doubt that it's easy, because the current implementation has many features (delta compression, client prediction, reliable and unreliable message queues) that are hard to replace (while keeping the playing experience).
What exactly do you want to do?
Generally, the current network protocol was written years ago, and from todays point of view it is somewhat awkward and complicated. Oh, but it works very well.
My "secret" plan though is to rewrite it one day, employing SCTP as a base, improving the code design (e.g. to make the game code much cleaner), and many other things...
The current network protocol is, at this time, not very well documented.1. Is there a documentation for the Networking protocol and System according to sent data, asynchronous commands etc.
Probably the best (most accurate and most up-to-date) documentation is the source code that implements it.
Depending on what exactly you want to know, I can however browse my archives and see what I can come up with.
I'm not entirely sure if I understand this question: Do you want to replace the existing Cafu network protocol with your own?2. Is it possible to use the implemented networking features with my own protocol? We defines our own protocol or exactly our purposes, so we would really like to use it here
That might work, but I doubt that it's easy, because the current implementation has many features (delta compression, client prediction, reliable and unreliable message queues) that are hard to replace (while keeping the playing experience).
What exactly do you want to do?
Generally, the current network protocol was written years ago, and from todays point of view it is somewhat awkward and complicated. Oh, but it works very well.
My "secret" plan though is to rewrite it one day, employing SCTP as a base, improving the code design (e.g. to make the game code much cleaner), and many other things...
Best regards,
Carsten
Carsten
Re: Network Protocol
Hi Carsten, thanks for your information.
Well, yes, I am thinking about changing the existing network protocol. I am sure that your implementation might be a lot more secure, but our main goal is to keep it very small and easy to parse for the clients, so we made an RPC-like JSON Protocol.
If it is really that complicated, is it possible to use your protocol as transport and just send the JSON-Data in the data body?
Well, yes, I am thinking about changing the existing network protocol. I am sure that your implementation might be a lot more secure, but our main goal is to keep it very small and easy to parse for the clients, so we made an RPC-like JSON Protocol.
If it is really that complicated, is it possible to use your protocol as transport and just send the JSON-Data in the data body?
Project Status: Code architecture definition
6 Programmers, 1 Photographer, 1 Architect, 1 Game designer
6 Programmers, 1 Photographer, 1 Architect, 1 Game designer
Re: Network Protocol
Hi Haimi,
in the implemented protocol, the contents of the network messages that the Cafu clients and server exchange are binary coded. At that level, it's a relatively simple protocol, as typically the first byte in the message indicates the type of the message, and the following bytes describe the contents.
Of course, it would be possible to replace this part of the messages, e.g. expressing the same meaning with JSON string messages.
Note however that this would make the protocol more verbose, and neither smaller nor simpler. You'd just express the same with a different sequence of bytes.
The higher level of the protocol is concerned with exactly when and how the messages are sent from one station to the other, so that reliable packets that possibly got lost in transit are re-sent, etc. This is defined in class
Rewriting this layer of the protocol or tunneling it through another connection is probably doable as well, at the risk of introducing latency or inadvertently changing other characteristics of the network communication.
Hope this helps. You're best reference is really the source code, as indicated in my previous message.
in the implemented protocol, the contents of the network messages that the Cafu clients and server exchange are binary coded. At that level, it's a relatively simple protocol, as typically the first byte in the message indicates the type of the message, and the following bytes describe the contents.
Of course, it would be possible to replace this part of the messages, e.g. expressing the same meaning with JSON string messages.
Note however that this would make the protocol more verbose, and neither smaller nor simpler. You'd just express the same with a different sequence of bytes.
The higher level of the protocol is concerned with exactly when and how the messages are sent from one station to the other, so that reliable packets that possibly got lost in transit are re-sent, etc. This is defined in class
GameProtocol1T
that you can find at http://trac.cafu.de/browser/cafu/trunk/Libs/NetworkRewriting this layer of the protocol or tunneling it through another connection is probably doable as well, at the risk of introducing latency or inadvertently changing other characteristics of the network communication.
Hope this helps. You're best reference is really the source code, as indicated in my previous message.
Best regards,
Carsten
Carsten
Re: Network Protocol
Thanks for the detailed description. I think we will try to use the internal protocol instead
Project Status: Code architecture definition
6 Programmers, 1 Photographer, 1 Architect, 1 Game designer
6 Programmers, 1 Photographer, 1 Architect, 1 Game designer
Who is online
Users browsing this forum: No registered users and 28 guests