• Please review our updated Terms and Rules here

How to code a TCP based rogue-like for 8088 class & linux?

ajrossnz

Member
Joined
Dec 30, 2019
Messages
19
Location
Wellington, NZ
For many years now, I've always fancied making an open source rogue-like game, but I want it to be multi-player, across the internet. Perhaps as a BBS Door too.

I would have a centralised server that I host, and end users can either be 16-bit MS-DOS users, or Linux users (and probably by inference MacOS, maybe even Windows).

I'm really not much of a programmer, so I wouldn't know where to start. I thought about using C because it's common across all platforms, but I noticed that mTCP uses C++ with a bit of ASM, so that wouldn't be portable, so would I need to come up with my own TCP stack then, rather than using Michael Brutman's TCP stack?

Any thoughts on the approach?

Cheers,
Alistair
 
Portability is only an issue if you want to run it on multiple platforms. So, what platform do you want to run the server on?

If your target is DOS then WATTCP or mTCP are the two libraries to look at. If you want something that runs on multiple operating systems then you are going to need to target operating systems with TCP/IP sockets, and you are still going to have lots of #ifs to make it truly cross platform.

mTCP is C++, but mostly as a better C - it doesn't use inheritance or polymorphism. And the assembler code can be rewritten as generic C code, but at the cost of performance. The only assembler code that is needed is the lower level interface to the packet driver.
 
Hi Michael,

The old 8088/286 may not have enough grunt for multi-stream input after a few users, so I was expecting the server to be Linux based (but if it could be ported to DOS, that would also be great).
The scenario I imagined in my head (whilst not the ideal), would be:
* Server running in x64 Linux on internet. Lots of sockets to listen for multiple game users.
* Client running on DOS but ideally also in Linux

The game could use UDP instead of TCP if TCP would be too much of a processing overhead for the client end? I guess I want to envisage the game with say, up to 30 players online and visible at any one time on the client.
 
I've stuffed a pretty full featured FTP server and an HTTP server onto a 4.77Mhz machine. And they both support concurrent users.

A text adventure game using TCP/IP sockets acting as a Telnet server would support any Linux, Windows or DOS machines that can run TCP/IP and Telnet. You should not be thinking of writing a custom client for this.

Telnet can be heavy to process because it is a packet for every keystroke, but humans only type at 80 or 90 words per minute, which is about 540 characters per minute or 9 characters per second assuming 5 letters per word and a space. And remember, that's a peak typing speed - most people don't sustain that, and certainly not while playing a text adventure game.

30 online clients might be a bit much for an 4.77 Mhz machine but it would not be out of the question on a faster 286. Depending on the session size and buffers you might be running up against memory limits, not CPU limits.
 
Back
Top