I'm trying to make a Multi User Dungeon (MUD) game, and obviously a pre-requisite to that is a server.
I've seen stuff like this:
┌───────────────────────────────────────────────────┐
│ │
│Game Logic Implementation │
└────────────▲──────────────────────────┬───────────┘
│ │
│ ┌───────────▼───────────┐
│ │ │
Server │ │Event Router │
│ │ │
│ └───────────┬───────────┘
│ │
┌────────────┴───────────┐ ┌───────────▼───────────┐
│ │ │ │
│Parser │ │Event Translator │
│ │ │ │
��────────────▲───────────┘ └───────────┬───────────┘
│ │
───────────────────────┼──────────────────────────┼───────────────────────────
│ │
│ │
Clients │ │
┌────────────┴────────────┐ ┌───────────▼───────────┐
│ Client │ │Client │
│ Input │ │Output │
│ │ │ │
│ │ │ │
└─────────────────────────┘ └───────────────────────┘
(Credit to stack exchange user Phillip on the Gamedev Stack Exchange)
But that's relatively advanced. Is there some way to structure my project more like this?
┌───────────────────────────────────────────────────┐
│ │
│Game Logic Implementation │
Server └────────────▲──────────────────────────┬───────────┘
┌────────────┴──────────────────────────▼───────────┐
│ │
│Function or Library │
│ │
└────────────▲──────────────────────────┬───────────┘
│ │
───────────────────────┼──────────────────────────┼───────────────────────────
│ │
│ │
Clients │ │
┌────────────┴──────────────────────────▼───────────┐
│ Client Client │
│ Input Output │
│ │
│ │
└───────────────────────────────────────────────────┘
To put that more complex stuff under the hood? That way I can focus on developing the game and not setting up a complex server system that basically carries two variables from the client to the server and two variables from the server to the client.
I've tried tutorials, pre-built (public domain) code, and even books but I still can't seem to make it work from scratch.