There seems to have been a Dwarf Fortress frenzy in the channel these past few days (which of course pushed me to fall in the DF trap once again. Already 2 all nighters lost to it…) and necessarily I wondered about some of the technical aspects. And of course I started coding.

After a few hours, there I am, with an OpenGL powered virtual terminal, that displays a 256 glyphs bitmap font, has 16 colors, has background and glyph coloring, and is actually just a network terminal.
Yeah. The only thing it can do is connect to a server, get text and color information from it, and send keypresses.
It’s kinda like OnLive, but for 8bit text 2*4bits indexed color games. Awesome. In fact the original idea was that since keypresses and a few letters are quite light with modern connections, why bother duplicating the game world in each player’s client? It brings lots of annoying things like synchronisation, world updates, distributed computing, cheating, etc.
My legendary laziness suggested that any game could in fact regroup world data, game logic, input and output in a single place. Exactly like a local multiplayer game. But over a network. It gives interesting ideas like very cheap “observer” mode (just broadcast some player’s screen to anyone who wants), transparent join/leave (after a deconnection or a local crash, find the game as it was, assuming the server paused, or rejoin a persistent multi experience), etc.
Now a cool thing would be to apply that for this MiniLD. I’m still not sure I’ll have time to enter, but who knows. It will depend on the theme I guess.
EDIT: oh and needless to say, there is some Lua involved. The main app with the OpenGL drawing is in C, but the config and the network code is Lua. Manipulating text and sockets is much easier there.
And about the protocol, it couldn’t be simpler: client->server is “SDL_Key code (as decimal text) and newline”, server->client is “char, 4bit background color, 4bit glyph color” for all cells, topleft to bottomright, followed by a newline.
The client also sends “tsize w h” to announce its size to the server at connection. That’s about all control messages I’ll use.