-
Notifications
You must be signed in to change notification settings - Fork 7
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
Develop iiag protocol for front-end -> back-end communication #43
Comments
I've looked at this a little before, and came up with the following tasks that need to be serviced by the protocol. Send Tile Update (update display of tile) This is probably the grounds for the most basic protocol, though more could/should be added to support more advanced front ends that may require more information about the game state. |
At least enough to drive the game at a basic level: essentially design the pattern of the protocol, so that other extensions can be added in later sensibly. In other words, once we are satisfied enough that the protocol won't be changed, just extended, then we can start migrating things. On that, I think too that the connection to the server should be abstracted as well (obviously, just wanted to make sure that was mentioned). Dunno, something like
so that the connection can be fielded by either a Unix socket, TCP socket, FIFO, pipe, carrier pidgeon, whatever. |
It would be easiest to force everything to use the same type of connection, I don't forsee any instances where a TCP/UDP socket wouldn't work or would have a significant performance impact. In other words abstracting connections sounds like extra work for no real benefit, except for perhaps the novelty of carrier pigeons. I've had good experiences working with ENet, an rUDP framework. |
The point of the suggestion was to avoid having any networking specific code in the game logic, similar to how the front-end abstraction is being done. Furthermore, we can reduce external dependencies needed if the abstraction is there to support alternate methods, such as simple TCP/UDP sockets, or whatever exists in the standard libs provided by the OS or whatever |
I have similar goals of avoiding network specific code in game logic and portability. I am suggesting we standardize the way that client and server communicate, so that we can reduce the amount we need to code and avoid creating clients that can only communicate with servers that support a specific protocol. Also I'd prefer to avoid talking to the OS directly as it produces much less portable code. |
Not necessarily advocating this, but what about compiling the core game logic into a shared library and then have frontend link into that library and communicate to that library? Client/server protocols could then be independent of this interface. In theory, then only the server would need to know how to speak iiag, and the client could be simple telnet or something similar. |
If not, I agree that we should abstract the communication method such that it can communicate through whatever so the end points need only speak iiag. Besides flexibility it means the game logic devs nor the client devs need care about the protocol. |
Even if we only support one communication method, the abstraction should probably still be there in case there is a reason for adding others. As for linking against a shared library that contains the game logic: that would probably nuke networking entirely, unless I am understanding this incorrectly. For simplicity's sake, I wouldn't really mind that just so at least the core functionality can be done. Unless however, a dummy front-end is written that links against the library the drives the game via network. Dunno. Either way, I would like to keep external dependencies to an absolute minimum, especially after the mess that was Lua support. |
Linking against a shared library has some other problems as well, like sharing state between multiple iiag instances, so it is probably a bad choice. So, core game repo that runs as a daemon and talks to clients through iiag-speak, whatever that may be? Should we make a new repo called |
Also, the Oh man, I can see it now:
|
Just |
Eh, we should maybe move the current one to some I have no strong opinion on the matter, would prefer to avoid cluttering either repo with too much legacy crap. |
Agreed. |
Moved to iiag-legacy |
Created a new iiag repo. |
Front-ends, like the ncurses or SDL ones should communicate with a separate iiag instance that handles the game logic, so that the "clients" need only to handle displaying, and the "server" only needs to handle game logic.
This needs to be fully developed and stable before a lot of the other restructuring can take place.
The text was updated successfully, but these errors were encountered: