Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Building a text-based game

I’ve been mulling over ideas for my next hobby project, now that I’m almost done making my CSV reading log parser.I’ve decided on (drumroll…) a text-based game!What, seriously? Isn’t that the quintessential newbie project for first-time coders? That’s so beneath you.That’s what the critical voice in my head keeps saying. So in this post I’ll try to convince myself that making a text-based game is not, in fact, a dumb idea.It’s true, I used to be a gamer but then in college, life got busy with other things, and it’s been that way ever since. It was a good change, and I wish it had come sooner.And yes, I’ve just welcomed my first baby into the world 👶 He’ll be his own person, of course, but I’ll encourage him to cultivate other interests besides gaming (like I wish I’d done sooner).Still, making a game has been my dream since middle school. I never did get around to it, first because of my teenage lack of discipline, and then by my choice in college to study the humanities rather than software development. Now that I’ve ended up as a developer after all, why not go back to that dream?Don’t get the wrong idea—all this about “my dream” sounds more grandiose and ambitious than it is. The reason I’m contemplating a text-based game is precisely because I’ve just had a baby, and whatever project I start next has to be lightweight and easy to dip into while the baby is asleep on my lap and (tip for new parents!) my hands are free thanks to the incredibly useful Boppy pillow.A text-based game sounds like the simple, restful project that I need right now.I already do Rails at my job, so a hobby Rails app would feel too much like work.I really like Bridgetown (which I used to make this site), and Scarpe looks intriguing for desktop apps, but I don’t have a compelling reason to make another site, or a desktop app.True, I could get a Raspberry Pi plus this robot car kit. Its actions are written in Python, but I could write new actions in Ruby using the Artoo Ruby robotics framework, or (at a lower level) a Ruby port of the RPi.GPIO Python module.These robot shenanigans could be fun, and they might be inspiring to my kid when he’s a bit older. But right now I’ll pass, because it’s not a baby-friendly project. My lack of robotics experience means it would be a big time investment, and the troubleshooting would be stressful. Plus, all the (literally) moving parts aren’t conducive to being immobilized with a baby sleeping in my lap.Indeed I have, not least because DragonRuby has a great community around it.The problem with me making a graphical game is sprites and other assets: making them or even mixing-and-matching premade assets would be tedious. I could make an arcade-like action game that avoids sprites, maybe something along the lines of my childhood favorite Gravity Well. But that would involve fairly complex geometry and physics, which are also high on my “don’t want to deal with it” list.In a text-based game, these headaches would be out of the picture (because there is no picture, heh). And later on if I choose to add graphical features and/or I want to distribute the game more widely, I can easily move it into DragonRuby. In the meantime I’ll simply output text to the terminal, just like it was done in the early days.Speaking of which, what are text-based games anyway?For the sake of simplicity, under this one heading of “text-based games” I’m lumping together various terms denoting different but overlapping genres:I’m not including roguelikes under this umbrella because they are essentially graphical, even if the graphics consist of ASCII characters.I want to make something outside these established genres because I must admit, I haven’t enjoyed most text-based games that I’ve tried.First let’s consider parser-based Interactive Fiction. It’s not very accessible to newcomers like me. Every time I tried one, my initial excitement was dampened when I realized I’d have to look up and memorize commands just to move around and look at things. To be fair, some modern-day titles such as Counterfeit Monkey include a very helpful tutorial. I even found one, FeedVid Live, where the possible commands are intuitive based on context.Hypertext interactive fiction feels more accessible to me, though it can get very literary and avant-garde, in which case I’d rather read a book. A couple that I enjoyed are Hana Feels and You Will Select a Decision.The examples linked above are free to play, but there’s also commercial interactive fiction. Most are choice-based, such as Sorcery! and Roadwarden. There are also story-heavy RPGs reminiscent of interactive fiction, such as Disco Elysium and Wildermyth.I’ll start by pointing to inspiring games that I want mine to be like in spirit, even if these are in other genres and more graphical than what I’m aiming for.So I suppose I want to make a text-based game that incorporates interactive fiction (more on this below), but is essentially a sandbox RPG set in a procedurally-generated open world that continues to evolve over time, a sort of world simulation where pretty much anything can happen. Towns can be founded and wiped out by floods, animals can spread disease and be hunted to extinction, a drought can cause famine and malnutrition, the nobility can intermarry, discontented peasants can rise up in revolt.What makes these goals anything close to attainable is what I’ve already said: there will be no graphics or (initially) any other assets to worry about, just text. Also, there will be no small-scale physics because the world won’t exist as a grid of small spaces like in Dwarf Fortress, but instead will be composed of various large areas or regions. (For example, a town could be one area, the farmlands outside the town another area, and the forest beyond it yet another area.)But hold on, how can interactive fiction fit with a procedurally-generated world? Well, the trick will be for each story to provide parameters and custom content to the world generator. This way, the world generator will still do its thing and the story won’t have to define every tiny detail of its world, only the broad strokes and important details necessary to make the story work. (Though, a story will inevitably grind to a halt if one of its key people or places is destroyed—remember, anything can happen! So stories will have to provide some minimum of contingency plans in case of mishap, and getting stuck through bad luck will always be a possibility.)I fully expect no one will play my game. Heck, I myself probably won’t play my game much. But that’s the beauty of it! Because the goal of this project isn’t to produce a popular game with wide appeal. No, I’m doing it for the fun and challenge of embodying this whacky mashup of ideas, and tweaking those ideas to my own satisfaction. For me the real game is in making the game. (So meta, right??)Yes! I’ve got to say, though, that last self-criticism hit me hard, because I often slip into being a perfectionist and demanding that everything I make be great and impressive, otherwise it’s not worth doing. So it really goes against the grain for me to make something knowing it will probably be lame in the end, but making it anyway just to enjoy the creative process.See? I’ve already learned and grown from this project, and I haven’t even begun yet!And now that I’ve acknowledged its fate, I feel relieved of the pressure to make it into a game that other people will love. I don’t have to bow to anyone’s expectations. This feels… spacious.*If I were going to write traditional interactive fiction, there are many commonly-used authoring tools I could choose from. But I love Ruby, so I might have chosen one of these instead:* The muffled voice of the critic interjects again, questioning my sanity for wanting to spend untold hours making just another one of those GitHub repos that you stumble upon, only to scratch your head in confusion and close the tab within three seconds. However, these protestations are in vain, being now banished to footnotes.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

Building a text-based game

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×