Writing AI in a Text-based Game
I'm not talking about large language models here, but rather traditional game logic that we call AI within most video games.
I've been exploring the Evennia game engine again, last I checked it out was when I was crazy into Python still. However, since coming back into Python with my rediscovery of Zope and Plone, I decided to look at other projects I briefly used before.
So, while reading through their documentation pages, I found the part about implementing a in-game creature which will move about the virtual map, moving itself from room to room until it eventually meets up with a player character, in which then a battle starts. This made me think for a moment, there is a timer system running every few seconds, which will then run a couple lines of Python code to decide where this creature on this virtual map should move to next? That's quite a lot of processing just to use a random number generator, a couple conditional statements, and then updating the location of that creature. A process might add that no player might even be aware of, the player might completely assume that these battles are just random encounters, and calculated by each step they take. Similar to say how random encounters worked in a typical Final Fantasy game.
Take this for example, you were just playing a completely text-based game, were wanting the map via various compass directions on a field, and then out of nowhere there is an enemy encounter. Is your first thought that this creature was actually roaming the same map with you, and just bumped into you then, or would you just think Final Fantasy type random number logic at play? I feel that most players might think it's the latter over the former.
However, for players with a keen eye to detail, this extra detail they might not immediately notice, will probably make them feel more impressed with the overall experience. Having a creature actually roaming the map, rather than it just being some random dice roll, also has another interesting advantage. The world could be pre-populated, and thus limiting the resources which a player could obtain without the game respawning them somehow. Think of how respawning works in Zelda: Breath of the Wild, and Zelda: Tears of the Kingdom. During those blood moon cut-scenes, that is when the game engine is re-populating the enemies in the world. So, this sort of game mechanic could work interesting in a text-based game engine.
It's just interesting to think of different game design decisions, and then even look at a lot of existing games, and wonder how the game would be if it were done a bit differently. One game I've played recently that I thought this exact thing with was Planet Crafter, which plays like in a first-person view mode, similar to No Man's Sky, in fact that's why I feel in love with it, was because it was like No Man's Sky for me, except I was taking one of those planets and terraforming it. I wish No Man's Sky would have some sort of terraforming abilities, like using certain base parts or something to increase some sort of terraforming level to slowly make the plant less toxic of one of the other debuffs some of the planets have. That'd be a neat feature, but until then, I got Planet Crafter. Anyway, a bit off topic for a bit there, but this is just a thought page, so I can ramble just a bit. Anyway, while playing Planet Crafter, I was wondering how the game would have been from a top-down perspective, as it does give me some vibes of games that would have this camera view. I do like it in it's first-person form, which is why I probably like, so I think they made a good choice with that.
There are so many things you really do need to think of while planning a project. Right now, as noted in a previous post I wrote, that I am currently in the process of preparing a deployment of an Evennia instance, which will be available via it's webclient, and perhaps via Telnet later down the road. I've tested being able to fully embed the webclient right into a Plone page here, so it'll fit in with all the current content. At first once it's deployed, it won't actually be publicly accessible, as there would be little point, as the world will be complete devoid of anything, which is the point of hosting such a server. Once I have some base content placed out, and all the settings and everything else working smoothly, a public link will then be available. I'm not sure how many other MUD servers out there enforce guests only, and disable immediate account creation, but this is how it will be configured at first. It enables anyone that might be curious what the heck a MUD is to easily click and connect as a guest to check it out. They won't need to create an account, or even think up a character name. This should open the door to more people hopefully seeing what a MUD actually is, and hopefully allow more people to try out these sort of games. If you are or were a fan of Dungeons & Dragons, or loved reading those long Choose-your-own-Adventure series of books, then you owe yourself to at least check out a MUD with a theme that interests you. It is a really fun way to build community, as you are in this virtual world through text, and can move around and explore it. It can lower effort than a modern MMORPG, and even feel perhaps a bit cozy to a lot of people. Perhaps fans of the Animal Crossing series of games that also enjoying reading and writing, might actually enjoy the very social aspects that a lot of modern MUDs provide.
