ChuchoMUD Updated!
Posted 2005 Nov 02ChuchoMUD has been updated!
One of the (many) outstanding issues with ChuchoMUD was that it was sort of gratuitously passing around entities. Well, this is great except that when the databases dump to YAML, they dump to different files. Thus more than one copy of a given entity would exist. Clearly this was not right.
I solved the problem by storing only “references” to the entities. This is pretty easy because each entity has a unique database ID and its type can be used to determine which database to check. Unfortunately, you get some yucky code like this:<pre><code> def entity db = case @entity_type when Character.to_s $character_db when Room.to_s $room_db when Item.to_s $item_db when Portal.to_s $portal_db when Region.to_s $region_db else $stderr.puts("@{entity_type} not found") nil end if @entity_logic!=nil then db.get(@entity_id).find_logic(@entity_logic) else db.get(@entity_id) end end </code>You might notice two things: one the “types” are getting stored as Strings (another issue with YAML) and there’s special code for “logic” modules. Basically, logic modules aren’t stored in databases, but are associated with an entity. They can, however, operate somewhat independently.
All in all, it works. Though, it “breaks” the previous YAML files. So, if you happened to create an entire MUD in the last few days, I apologize.
As a bonus, though, I added a day/night cycle example and a wandering, talkative NPC. See: I care.
See: ChuchoMUD
cube
2005 Nov 22 at 07:32Can you provide some idea of ChuchoMUD’s architectural vision? Teensymud has that amazing “Smoking hot T&A Action!” post in comp.lang.ruby, which I can read in parallel with the source to get an idea of what’s going on.
A skim through the ChuchoMUD source shows a completely different philosophy than teensymud’s, but… what is it?
This is important because I want to use it (or teensymud) as the back-end of a graphical MUD.