View Single Post
Old 06-12-2013, 12:37 AM   #13
Labyrinth
New Member
 
Join Date: Jun 2013
Posts: 1
Labyrinth is on a distinguished road
Smile Re: Wanting to start with the basics

Thagrahn,

First off, I am glad you are exploring programming for a MUD environment. It can be very interesting and at times even quite challenging. Most existing codebases are written in C (or some variant) and since you are already familiar with the language and syntax that is a definite bonus.

Camlorn's post includes a very good method for approaching your goals. While I have a new account on this website, I have been coding and programming since the late 90's. The "path" Camlorn laid out for you is very similar to how I tackled my first "from scratch" project: sockets, chat server, read/write files, rooms and movement, character info, combat, etc. Each step builds on the other (even if the actual code itself gets re-written multiple times) until you have something that resembles a working MUD. I would venture to say that most people have a similar experience with their first "from scratch" project. One of the advantages of using an existing codebase is that this part is already done for you and you can focus on making changes and modifications instead. You can still learn a great deal by dissecting and exploring existing code.

As far as the organization and commenting of existing mud code (or lack of it) ... that is the normal state of things in the mud world. Programmers writing original code only for themselves rarely comment their work, so if that code is then shared with the greater community, it lacks comments. Keep in mind as well, a majority of mud programming is done as a hobby and not as a job, so even if a programmer has professional training (most actually didn't when they first got started) the "professional standards" of always commenting and following a set formal coding style were usually ignored. Also, some of the work was done in a modular fashion, at least partially. Mud programmers who are asked to write a section of code to read/write a character file will most likely write two files: character.c and character.h that are then added to the Makefile and referenced in the base program with a read_character_file() function. Most are unlikely to dig through an existing, all encompassing, read/write file to make their additions. Which brings us to one of the major benefits of writing your own codebase: you can organize and comment (or not) to whatever degree you are comfortable with.

Either way, I strongly endorse Camlorn's suggestion if you decide to write from scratch. I feel it would offer you the best chance at having a rewarding experience and seeing a positive result for your efforts. Best wishes and good luck with your future MUD!

- Labyrinth
Labyrinth is offline   Reply With Quote