Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUDs
➜ MUD Design Concepts
➜ best data storage way
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Serenity
(18 posts) Bio
|
Date
| Tue 06 Oct 2009 12:52 PM (UTC) |
Message
| I'm currently storing my data in the following way on the filesystem:
areas/demo_area/demo_area.xml
areas/demo_area/script1.lua
..
Each area xml file contains: rooms, items, creatures
So everything for a single area is contained in one file.
This seemed handy, because builders dont have to switch between many small files.
However, these files tend to get large (1000+ lines), so one of my builders asked for a split into multiple files.
What i could do is split each area into subdirectories like items, creatures, rooms, etc
OR have multiple files per area like items.xml, rooms.xml etc
What would be the best option? Since i'm a coder and not a real builder, i dont know. Any input/ideas are welcome.
| Top |
|
Posted by
| Wjmurdick
(13 posts) Bio
|
Date
| Reply #1 on Tue 06 Oct 2009 01:17 PM (UTC) |
Message
| The great thing is that you are using Lua so you can have lots of flexibility for how to handle it..
My suggestion would be to do the following:
1. Split the XML up into parts (items, mobs, rooms, resets, progs, what-have-you).
2. Create a "master" lua script that handles the loading of each xml. loadfile(blah.xml) basically.
What this method does is gives your builders FAR more flexibility for what files to have. In fact, you could almost let them choose their own files if your system was flexible enough, since the lua script would handle the loading.
Thats how I do it on my own code... area_name.lua sets up the rooms and exits, then calls mobs.lua, items.lua, and so forth. | Top |
|
Posted by
| Serenity
(18 posts) Bio
|
Date
| Reply #2 on Tue 06 Oct 2009 02:01 PM (UTC) |
Message
| I let my C++ core do the loading. Lua is used for all sort of builders' scripts.
My preference is to keep everything as simple as possible, but builders must of course feel comfortable with the engine. Is a file per item/creature too much? Or do builders prefer that? | Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #3 on Tue 06 Oct 2009 05:30 PM (UTC) |
Message
| I take it that you have an assumption that building is done on the file directly, as opposed to with a tool of some sort? (In-game building, separate building application, etc.) Having a tool would make the file size more or less irrelevant.
But, if you want everything to be in files, I think that having a file per entity can actually make a lot of sense. For example, it makes it very easy to share entity definitions across places. I have never liked how many MUDs tie objects/mobs to specific areas. I much prefer having some sort of general catalog of game entities, and you just refer to those identifiers when placing things in your locations. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Serenity
(18 posts) Bio
|
Date
| Reply #4 on Wed 07 Oct 2009 07:23 AM (UTC) |
Message
| What i do with room/creature/item identifiers:
- areas are central in the design and are manager by a single builder/domain of builders.
- rooms/creatures/items all have an unique identifier within an area (= string) like goblin_soldier
- to address something, use the full path: area_id/object_id
eg. goblin_cave/goblin_soldier (=creature)
goblin_cave/goblin_sword (=item)
goblin_cave/main_room ( = room)
- all rooms/items/creatures can be private/public. This determines whether other area builders can use the object or in case of rooms, can use it as destination.
I also have special 'common' areas like 'effects', 'items' and 'creatures', so that some common stuff has id's like:
effects/drunk
items/longsword
creatures/human
...
This works really well. What i also use in that in area X, you dont have to say X/item_id, but can just use item_id.
| Top |
|
Posted by
| David Haley
USA (3,881 posts) Bio
|
Date
| Reply #5 on Thu 08 Oct 2009 03:36 AM (UTC) |
Message
| That works too. It would work best (IMO) coupled with a policy that whenever possible, builders should push items to the general, shared areas, and if not possible, they should re-use existing items, and only after trying these two should they make their own copy of the item. It gets silly when every area has its own wooden table, iron longsword, etc.
Anyhow, since you have this breakdown, why not just explicitly represent it in the filesystem? That way, moving a file is just changing its directory (but you'd have to fix references, of course). You can easily distribute individual files without having to distribute the entire area alongside it. |
David Haley aka Ksilyan
Head Programmer,
Legends of the Darkstone
http://david.the-haleys.org | Top |
|
Posted by
| Serenity
(18 posts) Bio
|
Date
| Reply #6 on Thu 08 Oct 2009 05:28 AM (UTC) |
Message
| Matching the filesystem structure to the id structure seems like a nice thing to do indeed... I'll get on it. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
21,942 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top