Text only game?

Started by
12 comments, last by GameDev.net 18 years, 8 months ago
hi Im reasonably new. I just learned Hellow world and how to get input from the user.(all of this in c++) And I was wondering how difficult it would be to make a game where The game describes to you the location. Keeps track of your stats and allow you to attack and stuff. BAsicly and example would be this. You have just entered a very large wooden room with doors to the left right and a pathway ahead. What do you wish to do? Options are: Go straight, Open Left Door, Open Right Door, Go Forward, Look In Backpack. Then the player chooses what to do and continues. At the begining of the game he has to choose a race and class(this is a text rpg if you havent figured it out already) And you get items and stuff. But the computer has to keep track of you stats your enemy stats etc. I think it would be pretty simple. The only part I think would be difficult is the computer keeping track of stats. Basicly I just want to know how far away I am from being able t do osmething like this.(I figured out how to do what I already know in like 2 1/2 hours. Thanks
Advertisement
It's not that hard, depending on how involved you want to make the game. For a short game, this should be within your capabilities with a little work.
o.k. Well were do you suggest (or I should say what) that I go to to learn next so I can do this? For the most part I need to know what else I need to know in order to do this. (Say that 5 times fast)
thanks
You'll need to know how to write and call functions and use control structures (if, while and for). I'd also recommend getting familiar with the string class since it makes working with text much easier. That's probably enough to write a simple "choose your own adventure" style game with some random stats thrown in.
I'd think that the most difficult things with a text adventure would be keeping track of the game world and implememnting the instruction parser (the bit that tells your program what on earth the player means by "decapitate goblin with spoon"). I'm sure you'll be able to eventually figure out the first problem on your own (and, of course, that's where the fun lies), but you may have to do a little googling when you get to the parser; it may seem simple enough, but pretty much any attempt at trying to get a computer to understand what a person wants to do is going to bring you an awful lot of headaches, so be warned! So yes, it's perfectly possible to write such a game with a bit of dedication, but it won't be a walk in the park. The best thing would be to give it a go, and I wish you all the best in that!
Well, depending on how far you are, functions, pointers, and file handling might help you. After that, you can give it a try, while continuing to learn other aspects of the language.

Having the computer to handle written commands is NOT a good idea right now. Start with a menu selection or, if you feel up for a challenge, a restricted set of keywords in pre-specified format (attack 'creaturename', heal potionid creatureid)...
I teleported home one night; With Ron and Sid and Meg; Ron stole Meggie's heart away; And I got Sydney's leg. <> I'm blogging, emo style
Quote:Well, depending on how far you are, functions, pointers, and file handling might help you. After that, you can give it a try, while continuing to learn other aspects of the language.

Having the computer to handle written commands is NOT a good idea right now. Start with a menu selection or, if you feel up for a challenge, a restricted set of keywords in pre-specified format (attack 'creaturename', heal potionid creatureid)...
ok i have about a 5% understanding of what you just said.


Anywasy basicly I need a list of what I still need to know..
Links would be helpfull but not nessasry..

[Edited by - Doom-Box on August 19, 2005 8:48:56 PM]
Start small. Then add features until your program becomes a mess. Then start over with a sense of organization and repeat.

I would start with a race/class picker. Make code that allows the user to pick a race and then a class. Then make a combat function. Make it simple, like generate a random number and 50% of the time you win. Then make something that randomly picks a monster. Then display something like this:

You (Human Wizard) defeat the Cinder Elk!

Next go in and make those choices count. Maybe your class/race combination gives you an edge over certain types of monsters. Add some variables, math, and if statements. Pretty soon it will start to get messy. Learn about structs/classes next. Then just start adding more and more. Practice makes perfect.
I'll be the party-breaker and tell you that you don't know enough. If you only know how to make "hello world" and take user input, it's impossible. You have to know about conditional loops, structures/classes, functions, pointers, function pointers... Don't stop learning and when you master all these, you can give it a try.
I been working on making a full text game for a while. I would suggest you work on a mulitipy choice version while working on the text parser. Trust me that will give you problems.

This topic is closed to new replies.

Advertisement