The very first CS class I took in college was based on SICP (taught in Scheme, for reference). By this point, I had already been programming for a while, but there were plenty of students with very limited exposure to programming as well.
One of the projects we had was writing a text-based RPG. This was to highlight the ideas behind OOP, which we learned after functional programming. Initially, the idea seemed to have merit--writing a game seemed to be a fun thing to do. However, I got quickly bogged down in boring detail; it turned out that writing a text based game has a lot of boring, repetitive work for each of the cool bits. It was the most tedious project in the class overall.
The final project we did was implementing a Logo interpreter. This was completely different--the ratio of cool and insightful stuff to boring fiddly bits was much, much better. Also, unlike the text-based game, even a barely working final result felt brilliant. Being able to program in a language I had just implemented was magical. Playing a text-based game with a working engine but a poor story line did not measure up.
So far, this has been my favorite course. However, I remember the text-based game as annoying and not particularly illuminating; it does not compare at all with the logo interpreter.
Overall, I think that too much of a text-based game is repetitive and boring, and it relies too much on non-programming bits (the dialog, the setting, the story) to be consistently inspiring to a new programmer.
I've been programming since I was a little kid, when those text adventure games first came out.
I remember programming my own text adventure with a text adventure toolkit, I can't remember the name exactly, it was an acronym, like AGP or AGT or something. That was really fun! But it didn't teach me programming.
Implementing your own text based game from scratch might teach you a bit about the language, but it won't teach you how to be a good programmer. In fact, if you are just starting out, I am willing to bet you will get stuck very early on, or you will find your solution works but doesn't scale, or it works but its terribly tedious to generate levels, etc, etc...
Really what you need is a properly tailored programming course on a 'good' learning language, like Pascal or Python.
Having said that, programming should be fun and I highly recommend choosing projects that are interesting to you to begin with. It does not matter if it already exists, try to program something you will actually use. If you do decide to program a text game, do research on the different ways you could do it. If there is something you don't understand in the solution you have chosen, research it (rinse, repeat).
I would say "yes" if you're learning a language that has a REPL (such as the Lisp languages.) A REPL is already basically an interface for a text-based game and learning about one helps you learn about the other.
If you like text-based games, it is a good introduction.
Otherwise, only really tiny self-contained examples are good. You need to break it down into more 'atomic' pieces - at which point you are no longer developing a text game.
You could use a really trivial VERB NOUN parser instead of the usual RPN calculator example. You can use a directed-graph world as a showcase for linked lists. TCP is often learned by writing a simple chat server.
Higher-level languages might make it easier to constrain this sort of project to a few hours.
But most people do not like text games and doing a proper job is probably an order of magnitude more complex than you imagine it to be. So actually writing or modifying a text game is only a great idea if it is motivating to the learner.
7 comments
[ 3.6 ms ] story [ 37.2 ms ] threadOne of the projects we had was writing a text-based RPG. This was to highlight the ideas behind OOP, which we learned after functional programming. Initially, the idea seemed to have merit--writing a game seemed to be a fun thing to do. However, I got quickly bogged down in boring detail; it turned out that writing a text based game has a lot of boring, repetitive work for each of the cool bits. It was the most tedious project in the class overall.
The final project we did was implementing a Logo interpreter. This was completely different--the ratio of cool and insightful stuff to boring fiddly bits was much, much better. Also, unlike the text-based game, even a barely working final result felt brilliant. Being able to program in a language I had just implemented was magical. Playing a text-based game with a working engine but a poor story line did not measure up.
So far, this has been my favorite course. However, I remember the text-based game as annoying and not particularly illuminating; it does not compare at all with the logo interpreter.
Overall, I think that too much of a text-based game is repetitive and boring, and it relies too much on non-programming bits (the dialog, the setting, the story) to be consistently inspiring to a new programmer.
I remember programming my own text adventure with a text adventure toolkit, I can't remember the name exactly, it was an acronym, like AGP or AGT or something. That was really fun! But it didn't teach me programming.
Implementing your own text based game from scratch might teach you a bit about the language, but it won't teach you how to be a good programmer. In fact, if you are just starting out, I am willing to bet you will get stuck very early on, or you will find your solution works but doesn't scale, or it works but its terribly tedious to generate levels, etc, etc...
Really what you need is a properly tailored programming course on a 'good' learning language, like Pascal or Python.
Having said that, programming should be fun and I highly recommend choosing projects that are interesting to you to begin with. It does not matter if it already exists, try to program something you will actually use. If you do decide to program a text game, do research on the different ways you could do it. If there is something you don't understand in the solution you have chosen, research it (rinse, repeat).
That's why I create a text adventure game in "Land of Lisp" and on my website: http://lisperati.com/casting.html
This book takes takes this approach with a number of its examples and projects.
And I think the book is a good introduction to programming and Python.
Otherwise, only really tiny self-contained examples are good. You need to break it down into more 'atomic' pieces - at which point you are no longer developing a text game.
You could use a really trivial VERB NOUN parser instead of the usual RPN calculator example. You can use a directed-graph world as a showcase for linked lists. TCP is often learned by writing a simple chat server.
Higher-level languages might make it easier to constrain this sort of project to a few hours.
But most people do not like text games and doing a proper job is probably an order of magnitude more complex than you imagine it to be. So actually writing or modifying a text game is only a great idea if it is motivating to the learner.