Please check out Ancient Anguish !

Member Discussions

terms



[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]


1. Ruby port of TinyMUD Sat Jun 2, 2012 [6:37 AM]
MangledMe
mangledme@btinternet.com
member since: Apr 30, 2012
Reply
Hi,

I have ported (an early version of) TinyMUD to ruby: https://github.com/mangled/MangledMud

It has a few daft bots and a new world in which we held a small party in last week. Its fully unit/regression tested and a good base for extending and/or refactoring - The code is pretty much as per the original (intentionally so, as it was painstakingly ported from the original c-code as an act of preservation).

Hope someone finds it of use.


2. RE: Ruby port of TinyMUD Sun Jun 3, 2012 [12:50 AM]
animlcrkrs
Email not supplied
member since: Jun 3, 2012
In Reply To
Reply
How much smaller is your version?


3. RE: Ruby port of TinyMUD Sun Jun 3, 2012 [3:14 PM]
MangledMe
mangledme@btinternet.com
member since: Apr 30, 2012
In Reply To
Reply
Its actually about the same size!

It could be made smaller though - not sure by how much. I suspect re-writing it using a rules engine might make a major difference. Reverse engineering the logic to make such a state machine would be an interesting exercise. I like the idea of externalising the logic, similarly the idea of progammability introduced in later versions e.g. TinyMUSH. I think a possible next step would be to adapt it to support injection of ruby scripts to allow flexible programming. Possibly injecting the current behaviour.

Also, although I could have tried to squeeze its size - For the first version I wanted to faithfully reproduce the code in ruby before any major refactoring. With really good unit tests in place it would be possible to change it now.



4. RE: Ruby port of TinyMUD Sun Jun 3, 2012 [4:42 PM]
Tyche
Email not supplied
member since: Apr 4, 2000
In Reply To
Reply
Very interesting. :-)

I released something called TeensyMud a few years back. I approached it from a different angle. Writing the smallest mud in ruby...

require 'socket';require 'yaml';def q x;$m.find{|o|o.t==2&&x==o.n};end
def a r,t;$m.find_all{|o|t==o.t&&(!r||r==o.l)};end;def g z;a(nil,2).each{|p|
p.p z};end;class O;attr_accessor :i,:n,:l,:e,:s,:t;def initialize n,l=nil,t=0
@n,@l,@i,@t=n,l,$d+=1,t;@e={};end;def p s;@s.puts(s)if @s;end;def y m
v=$m.find{|o|@l==o.i};t=v.e.keys;case m;when/^q/;@s.close;@s=nil;
File.open('d','w'){|f|YAML::dump $m,f};when/^h/;p "i,l,d,g,c,h,q,<exit>,O,R"
when/^i/;a(@i,1).each{|o|p o.n};when/^c.* (.*)/;g "#{@n}:#{$1}"
when/^g/;a(@l,1).each{|q|q.l=@i};when/^d/;a(@i,1).each{|q|q.l=@l}
when/^O (.*)/;$m<<O.new($1,@l,1);when/^R (.*) (.*) (.*)/;$m<<d=O.new($1)
v.e[$2]=d.i;d.e[$3]=v.i;when/^l/;p v.n;(a(@l,2)+a(@l,1)).each{|x|
p x.n if x.s||x.t==1};p t.join '|';when/(^#{t.empty? ? "\1" : t.join('|^')})/
@l=v.e[$1];else;p "?";end;end;end;if !test ?e,'d';$d=0;$m=[O.new("Home")];else
$m=YAML::load_file 'd';end;$d=$m.size;z=TCPServer.new 0,4000;while k=z.accept
Thread.new(k){|s|s.puts "Name";s.gets;l=$_.chomp;d=q l;$m<<d=O.new(l,1,2)if !d
d.s=s;while s.gets;d.y $_.chomp;end;};end

And adding from there. :-P

It's a couple of flags and commands away from being a complete clone of a TinyMud server. It does supports TinyMud's boolean expressions and TinyMud's player/room/object/exit model. I released it along with YAML versions of the both the original TinyMud small.db and the original DikuMud zones (sans mobiles).

You can find the project here:
http://sourcery.dyndns.org/svn/teensymud/
The Sourcery - http://sourcery.dyndns.org
TeensyMud - http://teensymud.kicks-ass.org
"A man can receive nothing, except it be given him from heaven."


5. RE: Ruby port of TinyMUD Mon Jun 4, 2012 [2:34 PM]
MangledMe
mangledme@btinternet.com
member since: Apr 30, 2012
In Reply To
Reply
Interesting... The TinyMUD code is around 140kb (w/o using ruby space saving constructs), the teensymud source looks to be double that? I suspect it has further extensions (from a quick glance). As said, the intention was to faithfully port the original code as an archiving activity. I don't have the mental energy to try to shrink it - Unit testing the original code almost drove me mad (that said I was mad to unit test it) :-)

If I was starting from scratch I think your approach would be the direction I would have gone in - That said it's the first MUD I have looked at, so its been a good learning experience.

I will have a deeper look at your code, especially the smallest mud link - It looks really neat. Thanks for the links and feedback. Btw, is your svn repo. down? The web link returns an empty page.

Have you looked at LambdaMoo? I'm intrigued by its approach (from the little I have read)? I also have another MUD related development (entirely new and possibly commercial) I'm starting on. I'm interested in finding someone to help code it...



6. RE: Ruby port of TinyMUD Mon Jun 4, 2012 [8:22 PM]
Tyche
Email not supplied
member since: Apr 4, 2000
In Reply To
Reply
I ported a number of servers, mostly in the Tiny family, to modern C compilers. You can find them on MudPortsProject. My criteria was that they weren't being maintained, and I found them interesting for historical reasons. I happened to port three versions of TinyMud, they range from around 4000 to 8000 lines of code.

AFAIK, LambdaMOO is still being maintained. While I've looked at it, I've paid more attention to servers that expanded on the design, like CoolMud, ColdMud, Mica.


The Sourcery - http://sourcery.dyndns.org
TeensyMud - http://teensymud.kicks-ass.org
"A man can receive nothing, except it be given him from heaven."


7. RE: Ruby port of TinyMUD Tue Jun 5, 2012 [7:48 AM]
animlcrkrs
Email not supplied
member since: Jun 3, 2012
In Reply To
Reply
That link and the 2 links in your signature don't load for me right now, so I guess I'm waiting for heaven to give me the opportunity to view those pages. :)


8. RE: Ruby port of TinyMUD Tue Jun 5, 2012 [1:07 PM]
MangledMe
mangledme@btinternet.com
member since: Apr 30, 2012
In Reply To
Reply
I saw your recent post regarding CoolMud and read the contained pdf's - It looks interesting. I would like to take it and remove the built in language, replacing it with ruby directly and using the same concepts. Suspect it would result in a small ruby equivalent, given the bulk of the code is the internal language.

Will look at your other ports too. Thanks.


9. RE: Ruby port of TinyMUD Tue Jun 5, 2012 [2:13 PM]
MangledMe
mangledme@btinternet.com
member since: Apr 30, 2012
In Reply To
Reply
I saw your recent post regarding CoolMud and read the contained pdf's - It looks interesting. I would like to take it and remove the built in language, replacing it with ruby directly and using the same concepts. Suspect it would result in a small ruby equivalent, given the bulk of the code is the internal language.

Will look at your other ports too. Thanks.


10. RE: Ruby port of TinyMUD Tue Jun 5, 2012 [8:47 PM]
Tyche
Email not supplied
member since: Apr 4, 2000
In Reply To
Reply
Looking it over, I think you did a pretty fine job with this. I doubt I'd have the patience to do the test cases.

If you're looking for old sources for bots, I've got some here. ftp://sourcery.dyndns.org/archive/servers/tiny/robots/

There's an ruby Moo project on source forge (rbMoo?), although I don't think they got too far, and I know I've seen a Ruby Mush written for something called AmberVM, but I can't find a link anymore.
The Sourcery - http://sourcery.dyndns.org
TeensyMud - http://teensymud.kicks-ass.org
"A man can receive nothing, except it be given him from heaven."


11. RE: Ruby port of TinyMUD Fri Jun 8, 2012 [3:50 PM]
MangledMe
mangledme@btinternet.com
member since: Apr 30, 2012
In Reply To
Reply
Thank-you.

Sorry for the delay in replying - I'm new to this site and find the threading system confusing.

By the end I found high level regression tests to be the best approach (i.e. inject commands, log output) and to be honest more robust against lower level implementation details. Lesson learned when porting :-)

I will have a peek at the bots. The one bot I wanted to get my hands on was the chatterbot by Michael L. Mauldin - I considered e-mailing him, but didn't - Suspect he wouldn't release it. I did get the blessing of James Aspnes for the port though.




[Previous] [Next] [Post] [Reply] [Topics] [Summary] [Search]