Re: Newbies to the list read this.

From: Michael Cunningham (malice@exit109.com)
Date: 04/17/99


(Maybe this will help newbies a bit)
(or maybe not.. either way I am spewing it out:)

How I learned to code in C and code circlemud..

Way back in the early days of my college experience I was a
undergrad computer sci major.. I learned pascal pretty well
but never touched C. A few years later when I was tired of comp
sci and moved on I decided that running a mud would be neat..
I have been playing one for about 6 months at that point.

Here's how I figured it all out:

I researched mud code bases on the net and played a few different ones
After deciding on circlemud I downloaded the source code
and installed it in my pc that was running linux.
After reading all the docs that came with it I figured out
how to compile it for the first time and I logged into it.

Thats where all the fun began....

I of course wanted to change the log on screen so I used
grep to search for some words in it. After a few searchs
I found what I was after. GREP is your best friend.. learn
to use it and use it well.

I looked at the file that had the screen in it.. But I didnt
understand what the heck all these other things around the
greetings was. I figured that the only way I was gonna learn how to
code this thing was to pick up a couple good books on C and every time
I saw something I didnt understand in the code I looked it up in the
book. I started out with your basic C for dummies book and picked
up more advanced books over time.

Understanding the statements and all was good... that made me an okay
coder and I began to write some basic things. Nothing more then
single functions. At that point I figured the only way to progress
further was to figure out how this mud really works. I went out
and found myself a nice size laser printer and printed out the
entire mud code.. (of course not my printer:). Once I had my hands
on the complete source and I could flip around that pages very easily
bouncing from file to file I was able to start tracing how things worked.
Over time.. probably 3-4 weeks I slowly figured out how every function
in the game interacted and how it loops and accepts new connections..etc.

Of course when I was coding something I introduced lots of bugs and made
plenty of mistakes.. I learned to use GDB very well... GDB is your second
best friend when coding:) If I couldnt see the bug.. and gdb couldnt find
it then I usually did it the hard way and began putting in log statements
all over the suspect code logging everything to a file so I could look
at variables and such and see when the code does funny things.
I added all sorts of features to the code.. Many from reading the faq's
there were avaliable and playing with snippets from the ftp site.

If you know C well... then coding a mud is a matter of learning how
the code works and making your changes..

If you dont know C but know another programming language then coding a mud
is a matter of learning how to code in C with all it pecularities and
learning how the code works..

If you never touched a programming language before the you have a LONG
road ahead. You need to learn to think logically.. step by step..
How many steps does it take to make a pb&j? Then start out with a higher
level language then C if possible.. play with basic or pascal for a
month.. once you have the basics of that language down then figure out
what the differences between C and basic/pascal are. Then.. play with
circlemud.. and learn everything you can about how the code works.
Noone i know these days really enjoys playing a stock mud anymore..
I you dont have bunch of time to invest in your game then maybe
you should try another mud code base like smaug which is more
feature rich. But if you want to work with a good solid platform to
build you dream mud from and have the time to invest in it... then
Start making pb&j's and let me know how many steps you can come up with:)

Of course.. this is all JMHO

Mike..
--
Speed of Lightning, Roar of Thunder!
Fighting All Who Rob and Plunder...
UnderDog.. Ahhahah UnderDog!


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST