Eric: 00:08 Welcome evennians, pythonistas, developers one and all to the titans of tech podcast. We are your hosts, Eric Ostrich Danny: 00:18 and Danny "Austerity" Nissenfeld. Eric: 00:20 Uh, we have with us Griatch, the veritable Athena of the mud world. Griatch is the lead developer of one of if not the most well known, uh, mud platforms Evennia as well as an accomplished artist and illustrator. This is Going to be a technical episode this week as we dive into the code base he's working on, why Python was chosen for it and some of the ins and outs of Evennia itself. Welcome to you Griatch, Griatch: 00:41 Thank you. Danny: 00:42 Uh, so, uh, let's start with you a little bit before we get into Evennia. Uh, how did you get into the text gaming universe? Griatch: 00:51 So I am an old school tabletop role player originally and I was basically running out of real live people to play role playing games with and was looking online and I did some forum based role playing and stuff like that and eventually I came upon muds. So I'm actually relatively new to the mud world at least by comparison to most active in it. Um, found my first mud, maybe 2008 or something like that. So pretty late. It's not a matter of having some sort of sentimental feel for it or anything like that. I just find that as a role player, I find that muds represent some of the best role playing you can get online. So that was my original input. Then I am also a developer and an astrophysicist by training and I use python a lot in that. So this is my entry from that end, so to speak. Danny: 02:00 What led to wanting to work on primarily a platform for other people to make games with as opposed to making a game yourself? Griatch: 02:11 So originally I was looking around for existing platforms and I, as I said, I used python in my science and I certainly did not want to use C or Fortran for that matter, which is what I use a lot. I do not want to use Fortran to make a game. So I wanted to use python of some sort. So I looked around and now to be fair, this was 10 years or more ago. Uh, so I, at the time at least the python stuff available for, for making text games was pretty much abandonware much of it at least. There was something called naked mud, which still exists, which I looked into and it's a C code base by which you extend with python. And I looked at that and it's very, it's very nice, but I found that at least at the time I had to, to make the changes I wanted to make for making the type of games I was interested in. Griatch: 03:17 I felt that I would need to go into, have to go into C eventually. And I did not want that. I wanted to do python throughout. A short while. I was toying with a code base called PYMOO, which is a MOO in python. So MOO is a separate type of, uh, in soft code language that you code on top of the, of the game and you can code things in, in this MOO language. And I toyed with that and cleaned up, the code a bit for this program, which people had not used for awhile. And I did that and then I realized I was making a soft code language or a scripting language in python, which is the ultimate scripting language. So that made no sense. So I eventually stumbled upon Evennia, which is a fully python. Evennia is something created originally by American named Greg Taylor, back in 2006 or so and mainly as an experimental thing. Griatch: 04:25 And Greg, we work together a bit and I contributed and eventually he moved on to other things and I took over development of Evennia in 2010 so to answer your question here, uh, of course originally I had grand plans like everyone does to make your next big great game. Eventually I more got into the backend development and the server development of things and found that I spend most of my time and enjoying my time actually creating the underpinning of a game rather than actually making the game. And this is where I'm at today. So I don't know if I will eventually use my own work here to make a game with myself. But at the moment I'm just having too much fun just developing and working on the backend stuff. Eric: 05:19 That sounds very familiar. Uh, Danny and I both joke about in a the MUD Coders Guild, how are just making web admins. So what, what can a person brand new to Evennia expect in their initial setup? Griatch: 05:33 So Evennia is a python program and I said, uh, and uh, it's supported on Linux and on Mac, and on windows and there is extensive documentation and installation instructions for all of these. Uh, you need the Git version control system because we distribute this over Github and you need some terminal console knowledge to run the server. But overall, once you get the Python Code and you get it installed, you will run it and that will so Evennia will work as a sort of a library and server in one and that means that when you, so when you start it you will enter the, the Evennia command and then you will do init and when you do that, the system will create an empty game folder for you named whatever you want. Griatch: 06:30 And that folder contains templates. You could say empty templates that hold everything you need to expand on because Evennia is completely customized and modified by you writing python modules and just importing Evennia as library and using those resources. So once you have created that game folder, which you don't have to modify at all to get the whole thing going, you just see cd into that folder and then you run Evennia start and you will get to answer some questions to create your first super user. And after that the server will be up and running and at that point you can telnet into the server. Normally on localhost port 4000 or you can go to your web browser and connect to localhost 4001 and you have a website for your game and you can click on a link there and you get a web client and html 5 web client where ypu can connect to your game and play directly in your browser. Griatch: 07:36 And that Web Browser, the web client, it looks, uh, it mimics the telnet interface, but it's not a telnet client at all. It's uh, it's a web socket, a client using JSON for communication with the back server. At that point what you have when you login is that you have a very empty game. You have one room and you have lots of the full administration type commands, but not much in the sense of game systems such as races or combat systems or stats or experiences and things like that. So the basic idea of Evennia is we handle everything that, all the boring stuff that you have to have in a multiplayer game. And we offer library resources for creating the cool stuff which you envision for your particular game. So that's the basic premise of Evennia. We do have contributions, so a contrib folder that comes with the system that you can use for activating and adding more game specific stuff that the community has contributed. But that's completely optional. You don't have to use that. And many people that that come to the community have grand plans for their own games and they really want to make something very custom and they can do that in Evennia because to can modify pretty much everything out of the box. Danny: 09:05 So is there a, I mean there's a lot of, there's a lot of code bases out there, a lot of very old code bases in C, uh, hopefully not in Fortran. I don't think there are any of those. Griatch: 09:16 Really hope not. Danny: 09:19 Why would someone pick a Evennia other than say they want to get into python? What, what makes Evennia different? Not necessarily then, I don't know, downloading stock Diku or circle off of an FTP somewhere, but of, of, of any of the clients really? Uh, what, what makes Evennia worth using? Griatch: 09:40 First of all, you should not underestimate the power of python in this because we have not insignificant amount of people coming into Evennia specifically because they want to learn python. And we have, uh, so we have people really learning python from scratch to being real pythonists in Evennia and that has happened over the years. They are still active in the community and very much we have people that have gotten jobs from working with Evennia for these reasons. You should not underestimate that because python compared to something like C it is very, very fast to prototype and develop in and uh, it's also comparatively easy to learn, I would argue. Or even for someone who is does not have any, well, very limited programming experience. That's a, that's an important point. Griatch: 10:37 Now Evennia is focusing on this bare bones aspect. And, uh, you can argue that this is a, uh, an advantage or a disadvantage because if you want the particular game style that a Diku offers, for example, the you really want the, the kind of stock stuff that comes with Diku, okay, then maybe a Diku is exactly what you want because you can get all this stuff out of the box in there. Evennia does not offer that. On the other hand, uh, for a different type of developer who has a different type of goal and then not having to tear out the specific types of game systems that you know, we tried to enforce upon you in that case is seen as an advantage. And since the code is written throughout in the same language that is scripted and it means you can really modify everything to your satisfaction and not to forget also that python of course has a vast infrastructure and the ecosystem of third party libraries doing pretty much everything you, you may want to do. Python is really excelling in text manipulation for example, which is a good thing for a text based game. Now, uh, Evennia itself has several quite interesting technical aspects to it, but you might maybe cover those as we go on because that can cover a lot of ground in one go. Eric: 12:16 Uh, yeah, so I was just jump straight into that. If you want totalk us through any of the technical stuff of Evennia. Griatch: 12:24 Evennia is an asynchronous server that means that it is not thread based. So we are not using threads to dig at parallelism in the system. Its all running in one process using asynchronous io. And the um, how this works is that technically it is like youre executing code sequentially, but youre chopping up that code and quickly rotating execution between different users. So it looks to the user like everyone is operating at the same time. But in practice the, it's actually old working in the same stack. So it's actually sequential code. Griatch: 13:04 This has some tremendous advantages in the sense that there are no race conditions. There can be no race conditions. No, weird timing problems with the system. Its all extremely clear what happens in which each order. A drawback is of course that you don't take full advantage of multiple processors and things like that. This is overall a limit of python as well. To be honest, it's not really a big issue I feel for a text based game overall because it's not in average very demanding of a modern system. Then we have several systems which are interesting and that we are using um, database. Evennia is based on Django, which is sort of like ruby on rails, but for Python, so a web framework. Griatch: 14:01 This is what both handles all our web presence, but it's also acting as the ORM for the database. So you never need to deal with SQL everything is done in python. What happens is that we leverage some aspects of Django with our own solution that allows you to as a developer, create a python class a normal python class inheriting from an Evennia parent. And when you do that and to create an instance of that class, then you will automatically create a new row in the database. And that happens for you automatically. So all you are doing as a game developer is instantiate classes all in code, and magically under the hood, we all the database creation for you. Now of course you can go down to the database if you know what you're doing, you can do direct queries, et cetera, but you don't have to do that if you, when just starting out and for most kind of tasks that you may want to do. Griatch: 15:09 You have, um, another aspect. So we separate between accounts and characters. Characters are objects, like any other thing in the world and accounts are a representation of your connection of your persona, your, you're the player. So the account holds information, like your email connection, information, banning information, things like that. But that always puppets a character, which is the, our presentation in the world. So this is always how, how the, how the interaction works. And Evennia has multiple modes for how to represent this connection. So the simplest connection mimics the Diku one or the traditional web, uh, solutions where you, you're connected, you're logging into the game and that login is your character and everything all the way up to multi puppeting modes where you can connect to the game and then you can connect and puppet multiple characters at the same time for multiple clients and even multiple characters per client. Griatch: 16:18 But in by default, it mimics the traditional model of just logging in and having a direct connection. It includes by default or something like 90 default commands, which are probably vaguely MUX or MUSH, like in style, which has more to do with um, uh, the original developer, creator of Evennia coming from the battlemux world. But there is nothing that, that forces you to use these types of command syntaxes. You can change that at will to whatever you want to mimic whatever, how their code base you want to use or just make up your own syntax. Commands overall are organized in something called command sets. So command is the class, you know, and yeah, it's a, it's an object and a command set is a grouping of commands. So what happens is that a command set sits on an object and the most common ones are the ones that sit on a character object that gives you access to commands, like look, get and inventory and things like that. Griatch: 17:28 But you can also have command sets that sit on the account. So you will have them available at all times or you can have them set on a room so that they are available to everyone in the room or on an object, like a button you want to push. And the interesting thing with command sets is that they are working like mathematical sets so they can be combined in unions and they can replace each other. And the classic example in the Evennia documentation for this is the dark room. So what happens in a dark room, how you implement that in, in Evennia is that the user enters the room and a new command set is added, the dark room command set this added to them. But they are using that the command set in the room simply has a higher priority than the command set on the character and it overrides the commands on that character temporarily. Griatch: 18:23 For example, when when they enter look, they will get the dark room's version of look it tells that it's a dark room and you need to have a some sort of light source to see it. But it could also affect other things. Maybe you cannot look at your inventory anymore because it's dark, maybe you can't have, it's a random chance that to draw the wrong potion from your backpack. Things like that. And of course you could do this kind of effects by a lot of if statements in the same in your command, but using command sets, it's automatically cleaning up after itself because when you leave the room, that dark room command set just goes away. And the old one you had before comes back and your normal version of look and inventory and potion or whatever, get back to the old one. Griatch: 19:16 So in this sense, this makes for you can create very powerful effects and we're powerful states. And these type of system also means that you can implement things like in game menus and uh, all sorts of things like NPC communication, all in commands. You don't have to make a custom new system for any of this stuff. Everything can be implemented in with commands and common sets and it is also done this way. You have full systems for menus, even in the inbuilt vim like game editor, which comes out of the box. There's no need for any custom code beyond just creating commands. Otherwise as I said with the, there are very few actual game systems. You get concepts like rooms and containers, things inside other things. Uh, you get something like a dozen normal default in game commands, like look and get and give so just to have a minimum kind of interaction. Griatch: 20:26 But most of the commands available are building commands. So building, digging, destroying things, banning things and configuring your connection and stuff like that. So, uh, that's the, the, some of the of aspects of this, but you can expand all of these. There are people that have coordinate systems rather than room based systems. We even have a developer using Evennia to make a traditional roguelike with a custom web client that makes you move around us and as, as an ampersand or at sign, you know, the, the Moria or rogue style of over overview as you move around. So that's still experimental, but it shows the kind of things you can do with it. Eric: 21:16 Yeah, that's, that's pretty cool. I also liked that you guys picked uh, the correct vim editing mode. Griatch: 21:23 Of course. Eric: 21:28 So this week we're going to do something a little bit different. Uh, give a shout out to Tark and the stick in the mud podcast. Each week you can listen to Tark as he ponders issues facing muds and their players. You can find his podcast at, stick in the mud podcast.com. Danny: 21:45 Are there any good anecdotes or like one good anecdote or story that came out of developing Evennia when you took it over through today? Pick the juiciest one to regale the listeners with. Griatch: 22:00 So overall, and I must say that the community of Evennia is very friendly and um, my, it's not very juicy but, but my personally, my sort of biggest sort of happy moment in development was when, I mean we have this, um, in IRC a channel for communication and also forums for, you know, asking people questions and things like that. I think my personally most happy moment was when I realized that I didn't have to answer the questions, every question anymore, um, people were actually understanding the code and we're able to answer as well and, and were willing to and happy to help newcomers on as well. That was, um, a very, very happy moment for me. Griatch: 22:58 Uh, I think the otherwise, I think, eh, the moment I asked Greg Taylor, the original creator of Evennia where the name Evennia actually came from because it's pretty weird, right? It doesn't relate to muds per se. And it doesn't relate to python that I know of. So I thought maybe there was this you know, very clever idea behind this thing. And he explained to me no Evennia is the name of a very cheesy NPC in the game, guild wars. And it has absolutely nothing to do with anything. And I was so dissappointed because they would, this is, and so it is a typical example of, of uh, this experimental is it project needing a name and he just grabbed the first name cause he played guild wars at the time. I never even played it myself. And that happened to be the project that stuck. And today, I mean we can't really change the name. I think it does, it has quite a lot of name recognition. But I remember that, uh, that that was, that was really annoying. But I found out this, the name where it came from. Eric: 24:20 That's pretty great. Sort of like against python projects and not have py somewhere in the name. Right? Griatch: 24:27 Yeah. I mean we could have been pymud or pymoo or whatever. Right. But no, that was Evennia. Eric: 24:39 All right. Uh, so wrapping up the episode, um, are there any other shout outs that you'd like to give to different mud projects? Griatch: 24:47 So a, yeah, sure. There is, um, more mush specific code base called AresMUSH. I developed and developed by a, uh, a lone developer primarily I think, but, um, uh, she's doing a good job of, this its actually written in Ruby, but focuses specifically on the mush style world of things. So Evennia by comparison is actually aimed at all the different genres of muing of, so we're not, not only muds but mux or mush or, muck, Et cetera. They are all of these different genres that partly interact and partly do not want anything to do with each other. Uh, but, uh, yeah, so that's a shout out to her to working on that. And also, um, it, it's not, it's not a server, but I think the mudlet client could be good to make a shout out to because they have, we have had a lot of interactions dealing with, you know, dealing with the various, um, telnet weirdness that has happened in the mud world over over time because there are no standards, uh, the only standards available for how a mud should communicate over telnet tends to be pretty vague. There are a few exceptions, but most of the time it's difficult to find out what, what the standard should be. And often it's just whatever, uh, style the most popular games are using at the moment. So a mudlet has worked with, with us and also fixed some of the discrepancies between the, in the protocol. Danny: 26:36 I'd like to thank you for, uh, for coming out to the podcast. It will be a treat for, uh, for all of the listeners. Uh, we haven't, we haven't really done a technical dive as of yet. It's mostly been about the building and the, and the, and the design. Uh, and I think a lot of people enjoy this and uh, you have any tips for anyone that wants to make their own code base, so their own platform, uh, start from or something that's not out there yet? Griatch: 27:02 I think it's important to remember first of all who your target audiences. So you need to make sure to document everything rigorously if you're making a code base. And I, I find that most, or at least many code bases that have looked at do not document anything at all. They, they have some comments, may be in the code, but they expect everyone to just understand what was being said. Documentation often lacks dramatically behind. So that's something to keep in mind when you, if you were aiming to make your own code base. Uh, otherwise I would say that you should only make your own code base if you're more interested in making a code base than you are in making a game. Because if you think making a game, will take a lot of time and effort. I can tell you that making a whole code base from scratch and then make a game on top of that, will take even longer. Eric: 28:03 Thanks once again for coming out, for the titans of texts podcast. Griatch: 28:07 Thank you. Eric: 28:08 See you in two weeks everybody.