Author Topic: My Renewed Interest in LPMud stuff  (Read 255 times)

Offline Maeglin

  • Acquaintance
  • *
  • Posts: 9
    • View Profile
My Renewed Interest in LPMud stuff
« on: November 22, 2017, 12:00:29 AM »
First, a disclaimer: Way back in 1991 when I was in college, I started playing RealmsMUD. Soon after, I became a wiz, made an area, quickly shot up to "god", rewrote the core lib, graduated and found other pursuits. By about 20 years ago, I vanished from the scene. I've been a software engineer/architect for the last 22 years... I say this because:

In 2011, the mud was finally about to die. I came back on the scene and set it up to run on one of my servers. I decided that it'd be a fun project to modernize it (after all, too much of the lib was that horrible stuff I wrote before I knew what "responsible development" meant.) A bunch of the other wizards volunteered to help but never did. I wasn't surprised when everything failed, though I was a bit disappointed - I decided to not waste my time continuing to work on Realms.

In 2014, I began working on a Unity3D-based game based in a world I'd created. I spent the next couple years doing a small amount of development whilst herding voice actors and artists. Over the course of the next three years, I got a large portion of the roughly 800,000 lines of dialog I'd written acted out. I also decided to pay some artists for some amazing 3D assets. The easier parts of the game were done and "the world" was largely peopled. I'd resisted the urge to make it have any type of online presence but then at the beginning of this year, I decided to go ahead and do that.

But how?

I came back to the LPMud driver (no laughing - I specifically chose LDMUD 3.2.17 because that's what Realms still runs and I had this weird fantasy about being able to reuse the many tens of thousands of rooms, countless monsters, and all the other stuff that had been created over the years.) There were a lot of shortcomings about using an LPMUD backend, but as everyone knows, it also has a ton of really useful stuff - from the technical side, it already has all the interesting network interaction stuff and is a pretty decent virtual machine for the "programs" it runs (players, monsters, rooms, items, etc). I began to hack the driver to suit my purposes and decided, "what the heck..."

I won't go into all of the details about what I implemented in the lib, but some of the more interesting things I did include:
  • I wanted to practice sensible engineering practices. I set up a VSTS site (Visual Studio Team Services) to both use for source control (it's git under the hood) and project management (even as a team of one, it's useful to track features and their implementation progress). I also did a few minor hacks to the driver such that I could run it as a "compiler" instead of a driver. That way, I was able to set up a Jenkins server to do automated builds / execute and report a full suite of tests written for the driver.
  • To that end, I created a gtest-like testing framework for LPC.
  • I haven't kept up with what others are doing in the LP world, but I identified some core lib things that I needed - event handling and a UML state machine implementation, for example - and wrote them.
  • I wanted to be able to build detailed quests/stories akin to what one might find in games like the Witcher series, Dragon Age,
     Mass Effect, etc. This includes things like complex, state-based quests and conversation trees (without guessing what to 'say'),
     research (think Civ-style but for various crafting, player background, guild, etc stuff), Crusader Kings-style (well, sort of) character traits.
  • I implemented an ASN.1 lib for the driver (because, why not). I'm using it to transmit driver data to the 3D client I'm working on. The long-term vision is that people can either use telnet (or whatever text-based client they want) OR the 3D one.
  • To that end, I changed the way that rooms are created. Instead of writing descriptions, you add objects to the environment. For those who have used any of the game editors that came with Neverwinter Nights, the Bethesda games, and others - it's like that. In text-mode, this gets translated via a "mad libs" style message parser I created and converted into a description. For the other mode, the objects/positions get sent raw.

The down side is that I added a ton of executional complexity. The act of a player hitting a monster can now trickle down into a few dozen cascading function calls... Since the hardware it's running on is pretty good (32 cores, 128G RAM) and it's the only thing running on it, the only real concern is the limitations of the 3.2.17 driver. I suppose I'll find those when I find them.

So, what was my point in posting this? Well, I wanted to let people know what I'm up to because I think (not to be immodest) that I've done a few pretty cool things. When I do release everything, the license should be pretty easy to follow (ie: do whatever you want with it, just give me credit).

Assuming there's interest, I'm perfectly happy to do some show-and-tell - this just didn't seem the appropriate time or post location to do so... and if anyone wants to dive in and create some stuff with it, all the better (though that might require doing so on a RealmsMUD instance I stood up - I haven't tried to detangle to be portable to other drivers as I did add some simulated efuns and a couple real ones (primarily around git and zfs support).

Anyway, the images I've attached are a successful and a failed build on the Jenkins server.

Offline silenus

  • BFF
  • ***
  • Posts: 181
    • View Profile
Re: My Renewed Interest in LPMud stuff
« Reply #1 on: November 22, 2017, 06:36:42 AM »
Sounds interesting. I would love to see the code on a public repository or some such.

Offline Adam

  • Global Moderator
  • *****
  • Posts: 56
    • View Profile
    • TheMud.ORG
Re: My Renewed Interest in LPMud stuff
« Reply #2 on: November 26, 2017, 03:17:36 AM »
Looking forward to seeing it too
Adam @ Dead Souls Dev
https://www.themud.org - MudList, Channel History, Channel History Search, i3 Dynamic DNS, Router Infomation

Offline Maeglin

  • Acquaintance
  • *
  • Posts: 9
    • View Profile
Re: My Renewed Interest in LPMud stuff
« Reply #3 on: November 26, 2017, 07:07:18 PM »
I did a bit of digging and it looks like my choice of VSTS was kinda terrible as far as providing public read access goes. I can add an authenticated read-only user that's "anonymous", but there's no support for truly anonymous (ie: unauthenticated) access. I can do it via Jenkins, but the code browser through Jenkins kinda sucks.

I'll have to come up with a solution that doesn't involve me ditching the infrastructure I set up.

Offline kriton

  • Acquaintance
  • *
  • Posts: 11
  • ICQ??! AIM?! Just how old is this place?
    • View Profile
Re: My Renewed Interest in LPMud stuff
« Reply #4 on: December 02, 2017, 05:27:43 PM »
I can relate to your path back to here.  I first got into MUDs around 1992 by playing on MUDDog and Star Wars MUD and then I ran an LPMUD called Emerald starting in '93 and well into college.  I moved on the professional software world, got married, etc, and it languished.  I recently started playing with Node and JSX and thought it would be fun to create an LPMUD-like game.  The environment is very LPMUD like, I think.  Objects are loaded into a near empty context with access to master() and efuns() objects.  I am trying to keep telnet access but the main client is intended to be a browser (telnet is great for nostalgia but super crunchy).  I would love to add graphics to my game and/or possibly support your game client once you have it out.

p.s. I am really curious to know why you stuck with an old LP driver, though!  I have created a driver

MUD Update: I just finished actually wiring up the validRead, validwrite applies in the master object for real.  I just have a few kinks to work out in object serialization and the verb system before I publish the initial, single core version of the lib.

Offline sarak

  • Acquaintance
  • *
  • Posts: 8
    • View Profile
Re: My Renewed Interest in LPMud stuff
« Reply #5 on: December 03, 2017, 09:30:47 AM »
First, a disclaimer: Way back in 1991 when I was in college, I started playing RealmsMUD. Soon after, I became a wiz, made an area, quickly shot up to "god", rewrote the core lib, graduated and found other pursuits. By about 20 years ago, I vanished from the scene. I've been a software engineer/architect for the last 22 years... I say this because:

Wow, what a blast from the past. I started playing RealmsMUD some time in 1994 not long after starting college. I remember your name from there. I also remember spending a lot of time running around as a Lich class. Most fun I've ever had with any class in any game. Ah, to have that sort of time to spare again....

Offline Maeglin

  • Acquaintance
  • *
  • Posts: 9
    • View Profile
Re: My Renewed Interest in LPMud stuff
« Reply #6 on: December 03, 2017, 04:11:15 PM »
p.s. I am really curious to know why you stuck with an old LP driver, though!  I have created a driver

Since I posted my original message, I updated to ldmud-3.5.0. For my new lib stuff, it wasn't too big a deal to accomplish - primarily changing calls to a few efuns and I did also have to implement an alternative to set_light (not a big deal since I eventually wanted to do something more sophisticated anyway.) I was also going to take a look at what it would take to go to DGD since its licensing is a bit more permissive, but have not yet done so.

The original reason I stuck with 3.2.17 was pure laziness - ie: I wanted to spend my efforts writing the "fun" stuff within the current Realms lib and I guessed (rightly, it turns out) that it would take a lot of work to go to 3.2.17 if I carried the existing Realms forward. I planned on writing a compat layer to translate all the pre-existing stuff in Realms to use the new lib. However, after having played with that mudlib again in earnest for almost a year, I'm much less excited about that because the code really is a mess and I'm not sure I want to spend all the mind-numbing hours making it work. As I did the update to 3.5 and had to severely hack them, it did become pretty apparent that I'm going to want to rewrite master and the sefuns because, well, yuck.

I'll definitely be curious to see how your driver dev goes and will have to check it out when you release it. My client is probably a couple years away from being "ready" (especially since I've been spending the bulk of my time on lib dev this year.)

Offline Maeglin

  • Acquaintance
  • *
  • Posts: 9
    • View Profile
Re: My Renewed Interest in LPMud stuff
« Reply #7 on: December 03, 2017, 04:13:29 PM »
Wow, what a blast from the past. I started playing RealmsMUD some time in 1994 not long after starting college. I remember your name from there. I also remember spending a lot of time running around as a Lich class. Most fun I've ever had with any class in any game. Ah, to have that sort of time to spare again....

That's cool. My roommate in college (Maelik) was the one who wrote the Lich guild.

Offline kriton

  • Acquaintance
  • *
  • Posts: 11
  • ICQ??! AIM?! Just how old is this place?
    • View Profile
Re: My Renewed Interest in LPMud stuff
« Reply #8 on: December 04, 2017, 04:17:55 AM »

I'll definitely be curious to see how your driver dev goes and will have to check it out when you release it. My client is probably a couple years away from being "ready" (especially since I've been spending the bulk of my time on lib dev this year.)

I hope to have a very basic mudlib up by the end of the month.  I am still debating on how LP like to make it.  I guess I could make compatibility a configurable option (e.g. populate global namespace with LP methods like master(), this_player(), etc).

Objects are defined much the same way, complete with create(), init(), and reset() applies.  I could probably write a transpiler to convert LPC to JavaScript :P

Debugger listening on [::]:5858
vEthernet (DockerNAT) 10.0.75.1
Ethernet 4 192.168.1.216
vEthernet (Internal Switch) 192.168.1.229
Bootstrapping in-game master
Adding http port 8080
Adding http port 8888
Adding telnet port 8000
Starting Emerald MUD
Extending EFUNS
Creating preloads...
Exporting ChatChannel
        Preload: /sys/daemon/PlayerDaemon: [OK]
Exporting GameObject
        Preload: /base/Interactive: [OK]
        Preload: /sys/lib/Login: [OK]
        Preload: /daemon/I3Router,[object Object]: [OK]
        Preload: /sys/lib/CommandShell: [OK]
        Preload: /sys/daemon/FileIndex: [OK]
        Preload: /sys/daemon/CommandResolver: [OK]
        Preload: /daemon/ChatDaemon: [OK]
        Preload: /base/GameObject: [OK]
        Preload: /base/Container: [OK]
        Preload: /base/Body: [OK]
        Preload: /base/Living: [OK]
        Preload: /base/Player: [OK]
        Preload: /base/Creator: [OK]
        Preload: /base/Command: [OK]
        Preload: /base/Room: [OK]
        Preload: /daemon/I3Daemon: [OK]
Done with startup
Startup took 0.233 seconds [233 ms]
I3 Router is running on 192.168.1.216 8787

Offline silenus

  • BFF
  • ***
  • Posts: 181
    • View Profile
Re: My Renewed Interest in LPMud stuff
« Reply #9 on: December 04, 2017, 07:14:20 AM »
I have been actually interested in writing a lpc -> java transpiler but I suspect I might be able to equally do a lpc -> ecmascript6 one. Lately I have been hanging out on IRC so haven't been on I3 much. I have been learning about lisp compilers, IR representations and optimizations there. I suspect it might take me about a week to make good progress on a transpiler for lpc->java. To javascript might take a bit more time since I am uncertain about the best ways to map to javascript (i.e. instrumentation for security and so on).

Offline kriton

  • Acquaintance
  • *
  • Posts: 11
  • ICQ??! AIM?! Just how old is this place?
    • View Profile
Re: My Renewed Interest in LPMud stuff
« Reply #10 on: December 07, 2017, 01:27:04 AM »

I am adding plug-able support for transpilers to my Node-based MUD.  I just added my first instance (.jsx) to allow more natural development targeting web clients.  Going from JS-like to JS is pretty easy, though. I am curious to see how well an LPC transpiler would work.

Code: [Select]
   webcmd(args, cmdline) {
        var players = users(),
            count = players.length;

        var result =
        <div className="who-results">
            <table>
                <thead>
                    <tr>
                        <td>There are currently {count} player(s) on {mud_name()}</td>
                    </tr>
                </thead>
                <tbody>
                {
                    players.map((player, i) => {
                        var lvl = player.getLevel(), status = [], color = '';
                        if (adminp(player))
                            lvl = 'ADMIN', color = 'purple';
                        else if (archp(player))
                            lvl = 'ARCH', color = 'blue';
                        else if (wizardp(player))
                            lvl = 'WIZARD', color = 'green';
                        else
                            lvl = player.getLevel();

                        if (player.idleTime > 60)
                            status.push('idle');
                        else
                            status.push('active');

                        var row = <tr style={color}>
                            <td>{lvl}</td>
                            <td>{player.getTitle()}</td>
                            <td>{status.join(',')}</td>
                        </tr>;

                        return row;
                    })
                }
                </tbody>
            </table>
        </div>;