Deep Space 36: Code Building

Coding: In His Own Words

Deep Space 36 is based on NUTS 2.3.0. As such, it had some very painful limitations. The original talker, which contained part of the sign-on world (the station) along with UTM, quickly ran out of rooms, even after a small rewrite to expand this limit to 94. This I was forced to take more drastic measures.

By rewriting a large percentage of the talker's code, I was able to lift the 94 area limit. First, there was BSDnuts, a series of changes (1) to make it compile on NetBSD systems (2), as it had previously been running under Linux (x86) (3). Then, the "Worlds Patch" as I called it, was going to be a handful of changes to allow multiple worlds, each with 94 areas.... It looked easy at first.... In the end, I don't think there's a _single_ function that didn't have to be partially or completely rewritten.... (4)

To sum up the talker's code history, every time I "almost had all the bugs worked out", I decided to start down a different road and rewrite something I didn't like, or add something that I saw on a MUD, or whatever. The result is Worlds.

The Difference

WORLDNUTS, and hence, DS36/GC contains a complete rewrite of the mail routines to create a pine-like interface (sorry, no full-screen editor, I only have so much time, you know). Not only can you send mail messages of a reasonable length, unlike NUTS 2.x, you can also select, view, delete, forward, reply, etc. to individual messages. In addition, since only registered users can use mail, and since a valid email address is required for registration, I decided to allow full internet email sending from the talker. It can't receive mail, simply because I'm unwilling to play with procmail that much, but it can send it. The user's email address is used in the from line.

Many changes are on the way, with some already in preliminary testing. For instance, after a week of pounding on the code (at the ocean's side in Florida on my NetBSD-mac68k laptop), I managed to get the addressbook "module" (5) working. This module attempts to create a pine-like addressbook for use in talker mail for sending to lists of users. Of course, there's a master addressbook with things like coder (Jkurtz) and admin (a list of the admirals) defined.

To give you a good comparison between this and the old NUTS 2.x mail code, the mail module alone is approximately 61k, and the addressbook is an additional 31k -- the entire NUTS 2.3.0 talker was only 80k. In total, the WORLDNUTS sources (including all modules plus the validation program and the keepalive program) occupy approximately 600k, plus or minus.(6)

In addition to the mail improvements, I also added a fairly rudimentary room editor. Again, since full screen editing is impossible, any ascii-art descriptions must basically be written offline and pasted in. The mere existence of a room editor, however, is unusual for NUTS-based talkers.

Soon to come

My initial plans to code a web interface for the talker are on hold pending java to mature sufficiently. Basically, the initial plan, to use forms and streaming, doesn't seem to work with my web server, and I can't even find a single java telnet applet that works acceptably, at least on Macs, so forget a mud client type applet.

But I haven't stopped coding things, by any means. I've recently added ANSI color support, ported from NUTS 3.3.3. In addition, we now have some support for user time zones and daylight savings time adjustments, both for user mail and for prompts. That may seem trivial, but even that required several days of coding and numerous requests for help, mainly because there aren't any standards for anything related to time (something that works on linux might not work under NetBSD, and the reverse was true twice as often). Therefore, that was not fun, but it's working.

In addition, DS36 now sports the framework for game support, including two games initially: chess and tic-tac-toe. Tic-tac-toe can be played against another user or against "Hal", the talker itself. Chess can only be played against a user (though this might change eventually).

Currently, however, my development efforts (beyond bug fixes) are focused on the porting of the NUTS netlink protocol. This protocol allows NUTS 3.x-based talkers to link to each other, thus making it possible for a user on one talker to basically walk into another talker seamlessly. Due to differences in password encryption, our implementation will not be entirely seamless, however, we are planning to implement a superset of the protocol, which I am helping to write. See our (in-progress) netlink rfc pages for more information on this protocol.

Notes

1.
NetBSD unix did not like many of my changes to the source code, and complained about the lack of a type declaration for the crypt function. I also added some basic signal traps to catch SIGQUIT and shut the talker down. Later, I borrowed the SIGTERM and SIGSEGV traps from NUTS 3.x. (Much later, I set the SIGTERM trap to behave like SIGQUIT, since Linux boxes send this at shutdown.) There may have been other changes as well, but if so, they are not documented.

2.
NetBSD is a unix clone (un*x for the paranoid) that runs on many different varieties of hardware, in this case, a Mac PowerBook 145 (68030 / 25MHz) running NetBSD-mac68k.

3.
Linux is another unix clone that runs on substantially less platforms, but, at least on the x86 platform, is the most popular, and is what our school happened to be running on the student box. (It has since been replaced by a Sun Sparc, I think, because it crashed _way_ too much.) Ironically, after all it's been through, the talker is now running on a PowerMac 7600/120 running MkLinux DR2.1 Update 3, or sometimes Linux-pmac, though I still do testing on both a 7100/80AV running MkLinux and my NetBSD-mac68k Laptop (see #2 above).

4.
Well, okay, maybe not nospeech(char *str).... The changes involved modifying every function that referred to astr[area], since the new astr is a doubly subscripted array (i.e. astr[area][world]);

5.
A module is, in this case, defined as a larce block of source code that's in its own file and is nearly standalone, with the exception of functions from the baseline.c module.

6.
The source code currently totals 600k, not including all the external support programs. Compiled, the binary takes aprox. 834k. These numbers were current as of Dec. 31, 1997, and tend to change a bit from week to week.


Back to the Deep Space 36 Home Page

Colophon

Disclaimer: This document in no way represents the University of Tennessee at Martin. All opinions and errors are mine alone.
ds@globegate.utm.edu