Adding 100's of rooms to TinyMUSH
Just pondering this. The idea is to automatically add hundreds of rooms at once to a TinyMUSH.
Say there's a method to generate these rooms coherently, with descriptions, exits, etc. (There isn't in this case, but let's say there is.)
Once the content is created, what might be the best way to actually import or create these objects in the server?
- A generator program could use tools like python and the "pexpect" library to interact with the server over a telnet session. This would enter dig, link, open, succ, fail, etc commands as if typed manually.
- Could a generator create the flatfile DB that the server loads at next startup?
- Is there some other mass import command I just haven't found yet?
Posted Dec 4, 2023, 2:48 AM UTC
50
Web searches didn't turn up anything, so I ran with my first idea of using python+pexpect to control things. This actually works pretty well, but there are some performance issues when doing something like this.
I changed the server's config to reserve room for 10,000 objects in the initial DB, and start a new player with 1,000,000 pennies.
My program runs telnet to the server, then writes commands and reads responses with pexpect. For those who may not know, the pexpect library allows a python program to control some other interactive command, like telnet.
Here's sample output from creating a 1000-room long hallway.
The connection lines in the middle are due to how TinyMUSH slows down to about 1 command/second after the first 100. To avoid the slowdown, before every 100 rooms it logs out, then reconnects. This keeps it fast.
Memory-wise, the server starts with an empty DB and is using <1MB of RAM. After this runs, RAM usage is about 50MB, and the .db file is about 524K.
Of course, this is no way to create a world. I was curious about how this could be done as I was thinking about procedural generation (wave function collapse, L-systems, random creation, etc).