SimpleMud/BetterMud

Posted by Trask on Sun 23 Aug 2009 10:47 AM — 13 posts, 57,782 views.

Australia #0
Hi all,

Out of curiosity, did anyone manage to compile either SimpleMud or BetterMud after all those compile errors?

Although I'm happy with using Nicks TinyMud Server, which I'm having a lot of fun with, I thought it might be easier to read through the book and follow examples, if I could actually get it to compile.

Thanks very much
Australia Forum Administrator #1
I had a look at my copy, and under Ubuntu 8.10 it seems to give a lot of compile errors. I think it used to work under earlier versions of g++, they must have tightened up the template code.

My comments from the previous thread mentioned spending "most of the day" trying to fix them, without success, so I am not all that enthusiastic about trying again.
Australia #2
Completely understandable Nick,

At the end of that discussion Robert Powell mentioned fixing the source code, and re-releasing it. This thread was to see if he, or anyone else had undertaken that task successfully.

Thanks for the reply
Australia #3
At one point i did have both working using newer compilers and newer python, however, over the intervening years i have lost or misplaced the disks that contained that code.

About the only thing i could recommend is installing gcc 2.96 and python 2.2, its about the only way to make it work with minimal hair pulling.
#4
Hey,

As luck would have it I was googling for information on Simple and Better mud when I came across this post.

I've currently been trying to bug fix the Better Mud and (I think!) am almost there.

At the moment I am trying to make it work with Python 2.6 but get the error messages below when running "make link"

If I get assistance to get it working I would be more then willing to share the results with members of the forum.

Many thanks.


make link
g++ -I/usr/include/python2.6 -I../Libraries -Xlinker -export-dynamic *.o /usr/lib/python2.6/config/libpython2.6.a -lpthread -ldl -lutil
/usr/lib/python2.6/config/libpython2.6.a(posixmodule.o): In function `posix_tmpnam':
(.text+0x7ca): warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
/usr/lib/python2.6/config/libpython2.6.a(posixmodule.o): In function `posix_tempnam':
(.text+0x8cf): warning: the use of `tempnam' is dangerous, better use `mkstemp'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_decompressobj':
(.text+0x322): undefined reference to `inflateInit2_'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_decompress':
(.text+0x4e8): undefined reference to `inflateInit2_'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_decompress':
(.text+0x4ff): undefined reference to `inflateEnd'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_decompress':
(.text+0x573): undefined reference to `inflate'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_decompress':
(.text+0x5a9): undefined reference to `inflateEnd'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_decompress':
(.text+0x626): undefined reference to `inflateEnd'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_decompress':
(.text+0x6ba): undefined reference to `inflateEnd'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_decompress':
(.text+0x72d): undefined reference to `inflateEnd'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_crc32':
(.text+0x7c0): undefined reference to `crc32'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_compressobj':
(.text+0x8b6): undefined reference to `deflateInit2_'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_compress':
(.text+0xa83): undefined reference to `deflateInit_'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_compress':
(.text+0xab1): undefined reference to `deflateEnd'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_compress':
(.text+0xb0b): undefined reference to `deflate'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_compress':
(.text+0xb58): undefined reference to `deflateEnd'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_compress':
(.text+0xba4): undefined reference to `deflateEnd'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_adler32':
(.text+0xcc0): undefined reference to `adler32'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_unflush':
(.text+0xe74): undefined reference to `inflate'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_unflush':
(.text+0xf4f): undefined reference to `inflateEnd'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_objdecompress':
(.text+0x10c5): undefined reference to `inflate'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_objdecompress':
(.text+0x1155): undefined reference to `inflate'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_flush':
(.text+0x1465): undefined reference to `deflate'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_flush':
(.text+0x14c5): undefined reference to `deflate'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_flush':
(.text+0x15f7): undefined reference to `deflateEnd'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_objcompress':
(.text+0x172b): undefined reference to `deflate'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_objcompress':
(.text+0x178e): undefined reference to `deflate'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `Decomp_dealloc':
(.text+0x18d7): undefined reference to `inflateEnd'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `Comp_dealloc':
(.text+0x1957): undefined reference to `deflateEnd'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_copy':
(.text+0x1a09): undefined reference to `deflateCopy'
/usr/lib/python2.6/config/libpython2.6.a(zlibmodule.o): In function `PyZlib_uncopy':
(.text+0x1bf9): undefined reference to `inflateCopy'
collect2: ld returned 1 exit status
make: *** [link] Error 1
Australia Forum Administrator #5
Looks like it isn't linking against the zlib library.

Check the makefile, you may need to add -lz on the line that does the linking. Also make sure you installed the zlib library.
#6
Thanks for the help!

I needed to install zlibg1-dev and use the -lz flag. Once I'd done that (and made the slight edit for socket connections you added in the post from ages ago) it worked fine.

If Trask or anyone else wants a copy of the code just say.
Australia #7
Yeah toss a copy up somewhere so we can dl it, it would be fun to play with it again from time to time when i am bored of other things, if you dont have a webserver, email it to me and i will put it on mine with a link from this thread.
#8
I'll email it to you.

There is also one other bug in the code that I haven't had a chance to find yet, where randomly it will stop you from walking.
Australia #9
eldhamud at gmail dot com i will be a way for a few days on a field trip, when i get back i will put this on my webserver and link to it from where just incase someone wanders in here in another 2 years looking for it LOL>
#10
simpleMud:
modify file, entitydatabase.h

typedef std::map<entityid, datatype> container;

to:

typedef typename std::map<entityid, datatype> container;


iterator( const container::iterator& p_itr ) // copy constructor
{
container::iterator& itr = *this; // also needed because VC6 sucks
itr = p_itr;
}

to:
iterator( const typename container::iterator& p_itr ) // copy constructor
{
container::iterator& itr = *this; // also needed because VC6 sucks
itr = p_itr;
}
#11
I have a copy of the book, and I am trying to compile simplemud. I made the typename changes listed in the above post. However, I had to add an additional typename:


// internal iterator
typedef std::vector<datatype>::iterator iterator;

to 

// internal iterator
typedef typename std::vector<datatype>::iterator iterator;



to get it to compile, although it does compile with warnings.

Simplemud runs fine up until the gameloop::PerformRegen() is called which calls the following routine in enemydatabase.cpp


void EnemyDatabase::Create( entityid p_template, room p_room )
{
    entityid id = FindOpenID();
    Enemy& e = m_map[id];

    e.ID() = id;
    e.LoadTemplate( p_template );
    e.CurrentRoom() = p_room;

    p_room->AddEnemy( id );
}


When the first line of Create() tries to set the value of id by calling FindOpenID() the server crashes. According to c++.net 2008 it appears to be trying to set the value of id to 3435973836 and it finally says something about map/set being undereferanceable.

entityid is defined as an unsigned int. So, I'm guessing that the variable simply isn't large enough for the value trying to be assigned to it. I'm still not very fluent in c++ but that's my guess.

If anyone can help, I would appreciate it.

I've been trying to stick to simplemud since I haven't even begun learning python yet.

On a side note: I did find a copy of bettermud that someone got to compile at...

https://briandamaged.org/blog/?p=412
Australia Forum Administrator #12
No, that would truncate it, not crash.

I can't even get it to compile. I suspect that his use of templates isn't supported by gcc, which is what I am trying to use.

If I could compile it, I would use gdb. You could still try that:

http://www.gammon.com.au/gdb

Run it under gdb and see what various variables are when it crashes.