Advertisement

MUD Game Programming from Premeir Press

Started by June 29, 2004 03:26 PM
4 comments, last by InterGeek 20 years, 6 months ago
I made the mistake of buying this book. While the content of the book is fairly pleasing, the included code is down right horrible. I've managed to hack most of it into working, but I'm still encountering some linker problems with the second, more advanced MUD, that comes with the book. I'm running linux, gcc3. Has anybody else had similiar experiences?
/*Joe DiMichele C/C++/VB Programmer, A+ Certified Technician AIM:Krawling Khaos, ICQ:332871787 joedimichele@hotmail.com oderint dum metuantExcuse my spelling, programmers can't spel*/
I gave up on running code from books a few years ago. Seems nobody (publisher/writer) every really checks the stuff out to see if it works. I dunno if its a case of the writer saying "Well it works on MY pc!" or what.

I usually just read the book and get ideas and stuff from it, then go off and code my own stuff.

-=[ Megahertz ]=-
-=[Megahertz]=-
Advertisement
In BetterMUD/Exception.h, add

virtual ~Exception() throw() {}

to the Exception class definition. And in BetterMUD/scripts/Script.h, add

#include <iostream>

at the top of the file, and the whole thing compiles.

If you have python 2.3 instead of 2.2, you'll have to change that in the makefile.

All in all, it's not too bad for "book code".

"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
You should email the book's author he was very helpful and responded quite quickly when I had problems with the book.
But yeah you should expect most books are going to have errors or programs that won't compile.
It's the nature of the business look at microsoft they don't even guarantee that their code,etc will be 100% correct.
What you don't expect is a prompt response and assistance like I said I got from the author.
And you got to hand it to him for trying to made the code as portable as possible when 99% of the other game programming books out there focus soley on windows since 99% of the market runs it!
If God played dice, He'd win.—Ian Stewart, Does God Play Dice? The Mathematics of Chaos
It's a damn sweet mud engine. I still haven't found a thing it can't do.

You should be nice to Ron. He has pies.
I've tried modifying the BetterMUD database by typing in the information, then rerunning the game, or rerunning the script. For some reason, the text writes over itself, no matter what I change.

For example, if I add a room to the region, and add a portal to the region for access to the room, I get this:

- Pretty Garden.

When it used to be this:

Directions: North - Pretty Garden.

It does the same thing with items. Before, it would be this:

Inventory:
-------------------------
NOTHING!!!

After adding an item to the database, rerunning the game, and spawning the item, I get this:

Inventory:
----------------------------------------
, razy Sword,

When it should have been Crazy Sword. What the heck am I doing wrong? Did he describe this in the book? How do you guys edit the databases?

Sorry, kinda clueless here.

Patrick

EDIT: Figured it out. When I open it and save it through VC .NET, it works. I think it has something to do with the format that notepad saves it with.

[Edited by - InterGeek on August 2, 2004 11:45:26 AM]
We are the music makers, and we are the dreamers of dreams. - Willy Wonka.

This topic is closed to new replies.

Advertisement