Top Mud Sites Forum Return to TopMudSites.com
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Reply
 
Thread Tools
Old 04-07-2013, 05:25 PM   #1
SelfCoded
New Member
 
Join Date: Oct 2012
Posts: 11
SelfCoded is on a distinguished road
How do Diku .are files work?

So I have all of these Diku .are files that I want to move over to a different codebase. Before I get started writing any kind of conversion script, the first thing I need to do is understand how the rooms work. If anyone can point me to some documentation on this, or something that converts Diku areas to SMAUG or MUSH, or give me quick rundown on detecting n/e/s/w, I'd be very grateful =D! I did a lot of googling and I tried out a list of area editors, but either a) I couldn't get them installed, B) They didn't support Diku, C) Broken link/no longer exists/other.

Here's an example from a very small area file. I'm hoping that the codebase wasn't modified from original Diku in regards to how the .are files work.

#AREA Delerak Random Treasure Zone~
random~
Delerak Xione Jakahri Anira~
9500 9999
0 1


#MOBILES
#0


#OBJECTS
#9500
new newobj~
the new object~
The new object lies here reminding you to change it's description.
~
The new has no description.
~
~
'wood'
13 0 0 0
0 0 0 0
10 0 100 1 101
1 1 1000 2
L 1
#9501
silver silk gown flowing~
a flowing gown of silver silk~
A gown of silver silk lies crumpled here, shimmering delicately~
This gown shimmers and glows slightly, its fabric seeming to emit its
own light. The silver silk is smooth and soft, and flows in a breeze
that seems to radiate from its wearer. Its bodice is form-fitting, the
neck coming down into a V shape, and off of it drape two long, loose, and
freely-moving sleeves. The skirt of this gown tumbles to cover the
wearer's feet, the shimmering fabric resembling a waterfall.
~
~
'silk'
9 1 1024 256
0 0 0 0
10 0 100 1 101
1 1 1000 2
L 1
#9502
ring entwined silver glint~
a ring of entwined silver~
A glint of silver on the ground catches your eye.~
This ring is comprised of five thin strands of silver, woven together to
create an elegant, slender band.
~
~
'silver'
9 0 2 0
0 0 0 0
10 0 100 1 101
1 1 1000 2
L 1
#9503
floating canopy bed silver white satin~
a floating canopy bed of silver and white satin~
A canopy bed draped in white and silver satin floats here, surrounded by a sheer white curtain.~
This bed is hovering above the ground. It is draped in silver and white
satin, and a pile of decorative pillows adorn one end. A sheer white
curtain has been hung from its canopy.
~
~
'wood'
12 0 0 0
0 0 0 0
10 0 100 1 101
1 1 1000 2
L 1
#9504
floating disc silver chair~
a floating silver disc~
A disc of silver floats here, large enough to sit upon.~
This disc of silver has a slight indent in its surface as though it were
meant to be a chair. It floats above the ground, its surface glinting
gently in the light
~
~
'silver'
12 0 0 0
0 0 0 0
10 0 100 1 101
1 1 1000 2
L 1
#0


#ROOMS
#9500
The Treasure Room~
This room is so that the random treasure zone can be saved manually.
~
~
'inside window'
4 0 0
0 0 0
S
#0


#RESETS
S


#$

Last edited by SelfCoded : 04-07-2013 at 08:47 PM.
SelfCoded is offline   Reply With Quote
Old 04-07-2013, 10:21 PM   #2
camlorn
Member
 
Join Date: Aug 2011
Posts: 144
camlorn is on a distinguished road
Re: How do Diku .are files work?

There is documentation available, but I do not have a link. What codebase is this?
Personally, I'd not write a parser. You've already got a parser that can convert it to the format of the codebase that they were written for, that is diku itself. I'd just rip out everything except the saving code and use that to load the files into the structs that diku uses and read those. What codebase are you trying to go to?
If these are the stock areas, I'd suggest considering not using them at all. Having original areas will make your mud much, much more appealing in my opinion.
camlorn is offline   Reply With Quote
Old 04-07-2013, 11:00 PM   #3
SelfCoded
New Member
 
Join Date: Oct 2012
Posts: 11
SelfCoded is on a distinguished road
Re: How do Diku .are files work?

They aren't stock areas. The area I used above doesn't give it much credit; I just used it because it's the smallest .are file. They are awesome and I want them . The MUD isn't around anymore. I'm hoping to make a stab at it on a newer codebase (I want to program in Python, not C).

The codebase I want to move them to is Evennia. The good news is that people have converted area files for different codebases and moved them to it. It doesn't look like anyone has done it to Diku yet though.

I don't actually have the codebase that I'm trying to convert the rooms from running, so " I'd just rip out everything except the saving code and use that to load the files into the structs that diku uses and read those" might be a little difficult, but it could be easier than parsing what's currently there.

Last edited by SelfCoded : 04-07-2013 at 11:12 PM.
SelfCoded is offline   Reply With Quote
Old 04-07-2013, 11:29 PM   #4
Ide
Senior Member
 
Join Date: Feb 2006
Location: Seattle
Posts: 361
Ide will become famous soon enoughIde will become famous soon enough
Re: How do Diku .are files work?

Tyche (Jon Lambert) wrote a converter. In his own words, "I wrote a convertor that converts TinyMud, Diku, Merc, Rom, Smaug and PennMush files to YAML format for TeensyMud". (see ).

I looked around a little for it but didn't see a link, but I'm sure he could hook you up.
Ide is offline   Reply With Quote
Old 04-08-2013, 03:54 AM   #5
Orrin
Member
 
Join Date: Jul 2008
Name: Matt
Posts: 141
Orrin is on a distinguished road
Re: How do Diku .are files work?

from the DikuMud distribution which outline the world file format.

The best way to understand the format of the area files is to look at the source code where they are read/written.
Orrin is offline   Reply With Quote
Old 04-08-2013, 03:45 PM   #6
SelfCoded
New Member
 
Join Date: Oct 2012
Posts: 11
SelfCoded is on a distinguished road
Re: How do Diku .are files work?

Just what I was looking for, Orrin and Ide. Thanks a lot, I appreciate it
SelfCoded is offline   Reply With Quote
Old 04-08-2013, 05:14 PM   #7
camlorn
Member
 
Join Date: Aug 2011
Posts: 144
camlorn is on a distinguished road
Re: How do Diku .are files work?

Firstly, in the worst case, extracting the descriptions themselves is trivial, if tedious. The descriptions are obvious, and you could extract them yourself without a script.
Secondly, if this is standard diku, you can download that. If this is not standard diku, good luck. I think that you're biting off more than you think, but perhaps I'm wrong; the stats probably don't transfer directly, so you have to convert that, too.
Third, you *may* eventually run into performance problems with python. Note the may, as this may not necessarily happen, but i've looked into it for all of my make a mud ideas and determined that the memory overhead is a lot and the gil is a problem (yes, yes, pypy).
Fourth, you will almost certainly have to recode all mobprogs from scratch, if the mud these are from used them. This basically means rewriting them by hand.
camlorn is offline   Reply With Quote
Old 04-08-2013, 06:15 PM   #8
SelfCoded
New Member
 
Join Date: Oct 2012
Posts: 11
SelfCoded is on a distinguished road
Re: How do Diku .are files work?

Very true, the descriptions are easy to find of course. But yes, very, very tedious. Even if trying to program something to do this is time consuming enough that it doesn't save me 'work', at least I'll learn something rather than merely reinforcing how much I hate Data Entry.

I don't think I'm going to run into performance issues with Python. MUDs have been around for an extremely long time (well, relative to when I was born and to computers in general), and their requirements have far from kept up with the hardware. That's actually one of the reasons I think that more codebases should take advantage of powerful scripting languages instead of C++; take advantage of the extra hardware that we have now. Yes, it's not as fast or as memory friendly as C++. But it is much more memory efficient than Java ( ) , which has been used for MUDs for quite some time (and yes, it is worth noting that those MUDs sometimes run into memory problems, but again, much more memory efficient). The server that's hosting my MUD for cheap also has an SSD hard drive that can be relied on via pagefile if the memory falls short, which should work fine for this. But if I do run into memory problems, I'll embed Lua and have it do some of the more frequent chores or something, especially anything math intensive (That benchmark showed Lua at being worse at everything than Python. I think that's because those tests seem to focus on strings, as I think Lua is generally considered to be faster and more memory efficient than Python). Evennia is very flexible. That and pypy, as you mentioned.

I'm not concerned about moving over mobprogs, so I guess that's good heh.

You're right that I could be biting off more than I can chew, but it's looking a lot more plausible now than it did when I started this thread. Now I have documentation and an area editor someone started from Kline. Hopefully Tyche will let me use his, though. Even if it doesn't work out of the box for me, it'd be a lot easier to modify it than create my own from scratch

Last edited by SelfCoded : 04-08-2013 at 06:41 PM.
SelfCoded is offline   Reply With Quote
Old 04-08-2013, 11:11 PM   #9
camlorn
Member
 
Join Date: Aug 2011
Posts: 144
camlorn is on a distinguished road
Re: How do Diku .are files work?

Well, sort of. There's a tradeoff for decreased complexity. I can think of 4 or 5 muds that have done something "new", that is pushed the boundaries of the genre, and at least two of them would probably have some sort of problem if implemented in python or similar.
One of these is lost souls, which uses multiple gigabytes of memory to provide, I kid you not, an entirely subjective experience, based on what your character knows (it really is, and they don't use strings for game messages for starters). Whether or not this is impressive, or whether or not lost souls is even a fun mud, is subjective. This is LPC, which is more efficient (or so I think) than python, for the simple reason that it started when we only had 64mb of ram. Issue here of course is running out of ram.
Another is godwars2, which doesn't even have rooms and is doing at least some realtime collision detection. I'm not sure how much--I doubt everything has a polygon, but players and everything else moves in realtime.
My personal idea is this. We don't need ascii maps. I could apply heuristics in realtime to generate meaningful descriptions of the mud equivalent of the overworld. That's my personal favorite. Taking an average of two hundred numbers every time the player moves, let alone doing more complicated things that involve many calls to trigonometric functions...yeah, processor intensive, as soon as players leave brief off and enter a hundred-room speedwalk, well, enough said.
I think that python and such is fine for any normal run of the mill room-based mud, but that it will prevent adding processor intensive features of any sort without unnecessary artificial limits. I remember playing a python mud, cloktown I believe it was, and being impressed with their features but not impressed with the fact that the entire thing felt unresponsive. I could tell that commands weren't happening instantly, even simple ones, and to my programmer's eye, it looked like some of the game restrictions were restrictions imposed by python. Perhaps they weren't, but that is what it felt like to me.
I'm not going to argue the point, not beyond the above. This is not the place, and python is fine for 75% of mud projects. To me, my language of choice would be java, possibly (well coded java, i.e. not coffeemud java, is actually fast these days) or something that compiles.

For lua, there's luajit, as well. I've not seen the benchmarks. The truth is that if you're going to go that low for a performance gain--well, write it in c and use the FFI of your language of choice and have all the benefit, instead of just some.
camlorn is offline   Reply With Quote
Reply


Thread Tools


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 05:03 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud Sites.com 2022