How to program a text adventure in C by Ruud Helderman <r.helderman@hccnet.nl> Licensed under MIT License 1. Introduction This is not a C tutorial; there are plenty of those on the web. The reader is assumed to have some basic knowledge of programming in general, and preferrably the C programming language in particular. Maybe you just finished reading a tutorial somewhere, and you would like to learn some more about programming by studying other people’s source code. Or could it be that you really are genuinely interested in the ancient art of writing text adventure games from scratch? Maybe you are just having a sense of nostalgia about the old days, when life was simple, and so was software. In either case, you have come to the right place. In the 1980s, text adventures were a respectable genre of computer games. But times have changed: in the 21st century, they pale in comparison with modern MMORPGs with 3D engines. Where books survived the rise of film, text-based games quickly lost the battle against their graphical counterparts. ‘Interactive fiction’ is kept alive by an active community, but its commercial value is long gone. There is a bright side to this: authoring tools of professional quality are now available free of charge. This is also the single biggest advice I can give you if you intend to write your own adventure: use one of the many dedicated development systems. Why C But then, why this tutorial? Why write an adventure game using a general-purpose programming language? Because doing so can be entertaining, challenging and educational. The programming language C may not be the most obvious choice for writing a text adventure; it’s nothing like LISP-based languages like MDL and ZIL. Some people will claim C is not even a general-purpose language. I disagree; maybe it should not have become a general-purpose language, but it most certainly did. Yes, there are general-purpose programming languages that are better than C in terms of maintainability and...
First seen: 2025-04-27 08:14
Last seen: 2025-04-27 19:17