# Creating a text-based game,

## Recommended Posts

Ok, I'm a noob, I've no clue on programming games. I was wondering if there was anybody out there who would guide me through the creation of a text based game? Maybe via I.M. or something? If so please P.M. me or add me to MSN unwantedminority@hotmail.co.uk Cheers.

##### Share on other sites
Twisol    468
I can't personally help you with that, but the C++ Workshop has some great projects that might be exactly what you want to try.

##### Share on other sites
I'm a complete newbie... Those titles mean jack to me and I have no clue where to start! :(

##### Share on other sites
Twisol    468
I suggest getting a good book on a programming language of your choice then. C++ is supposedly tough to learn, but I had no problem with it myself. I think (in my opinion) C# is a good language to learn at the start too. Online tutorials can be good, but usually books are better. "Thinking in C++" is an online, downloadable book though, and it's great, although I wouldn't say best for a new programmer.

##### Share on other sites
So you think something like C+ for dummies or something like that will be enough? I'd consider myself fairly intelligent... I picked up HTML in about half an hour.

##### Share on other sites
monp    100
A book I liked when I was figuring at the basic was. "C++ Without Fear" In my opinion it was a pretty decent book.

##### Share on other sites
Twisol    468
I'd just take a trip to a local Barnes' & Nobles' or Borders bookstore and see what they have. Leaf through any books you find that might interest you to make sure you're getting what you want, some books might not go over some stuff, or do advanced stuff you don't want yet, etc.

The C++ Workshop I mentioned uses "Learn C++ In 30 Days" or some such book, if you're interested in following along with that you can look at the Introduction thread in the workshop.

EDIT: I actually own the book monp mentioned, it is a pretty decent book. It has exercises at the end of each chapter, which is a plus for me!

##### Share on other sites
theOcelot    498
I found "C++ For Dummies" satisfactory, and I'm not (really) a dummy either. The author's smart-mouth remarks occasionally obscure the point he's trying to make but thats generally not a problem. When you're done, though, make sure you read up on STL and the boost libraries (that'll make sense later). He doesn't really give STL justice, but then you couldn't if you had the whole book, and it only gets a chapter. But it gets the basics of programming across without really delving into all the icky parts of C++. You can check it out at the library, and if you don't like it no harm done.

##### Share on other sites
Ok thanks mate... I might need help as to where to go after that though :o

##### Share on other sites
blewisjr    752
In all honesty I would suggest picking up a beginner book on C# where it starts you with some console programs like Beginning C# by Wrox Publishing. They will teach out about input and output and then the rest of the C# language. I suggest it because it is alot easier to start with C# then C++ because you don't have to worry about some of the annoying quirks it has. Also you can get a free C# IDE at MSDN. Since you are new to programming I think it would be easier for you to pick up on. With all the basics of programming down I think you would have no trouble implementing a text based single player game. My first game I ever did was Tic Tac Toe in a console window with C++ however, if C# was out then I think it would have been alot simpler.

##### Share on other sites
oler1s    585
Quote:
 I was wondering if there was anybody out there who would guide me through the creation of a text based game?
You mean, have someone else program the game for you.

Quote:
 So you think something like C+ for dummies or something like that will be enough?
No.

Quote:
 I picked up HTML in about half an hour.
It’s not a programming language.

Same advice applies to you as to anyone else who wants to learn how to program and make games. Pick a decent language suitable for beginners (read other forums posts for information on how to pick a language and recommendations, C++ not one of them). Then learn to use that language with decent fluency. Do so with small practice programs. At some point, you may be able to tackle your game idea.

EDIT:

The way you post, it sounds like you want everything spoonfed to you. You don’t know what to do, so you want someone else to hold your hand through everything. That isn’t how programming works.

##### Share on other sites
I Am Legend    122
Wrathlands. That's the name of a sample game put together in these tutorials(not mine)

http://www.rdxgames.com/projects/wrathlands/index.html

##### Share on other sites
blackviper91    182
I would recommend that you try out Python with PyGame or Pyglet. Python is easier to learn and use than C++, so I find it to be a good beginner language. I already had programming experiance when I picked up Python, so all I did was look at some examples and experiment. For this reason I'm not exactly sure what book to recommend, but probably just about any "for absolute beginners" or "for dummies" type book would probably give you a good foundation in both programming concepts and the language itself.

~Cody

##### Share on other sites
steveworks    146
I recomend learning Python. I am currently in the middle of learning it after a messy affair with C++. I have to tell you that Python is a lot easier to use than C++. A byte of python (check it out on amazon) is the book I read so far and it was very helpful to me. It also has an online html version that you can get at python.org. Its found under for beginners which is under documentation. I wish you luck with whatever you pick.

##### Share on other sites
Electrons    120
Whatever programming language you choose, find a good book that not only teaches you the language, but also teaches the basics of programming as well (algorithm design, data structures, object-oriented programming). If you can't, find a separate book that teaches you how to program and learn it well. Also, make sure you stick with the language you choose until you know it very, very well.

##### Share on other sites
Thanks guys much appreciated... and Olers gtfo... what's your problem? :|

##### Share on other sites
Tesseract    285
If you are making a purely text-based game, there is always Inform.

##### Share on other sites
blackviper91    182
Quote:
 Original post by unwantedminorityand Olers gtfo... what's your problem? :|

He just wrote what alot of people were probably thinking. You probably haven't been around the forums much, but if you spend any amount of time here, you'll quickly find that a good half or more of the people that come on asking for beginner help (i.e. what language, write this code for me, show me good tutorials, etc) really don't want to do the work, they just want the games quickly with as little work as possible. I don't think his statements were meant as a personal remark against you, he was just wary, as was I, that your another one of the dozens that wants to be spoonfed and won't actually follow through.

Hopefully that's not true and you'll stick with this wonderful hobby (or if your damn lucky, profession :P). Good luck with your future learning and programming!

~Cody

##### Share on other sites
kakudi74    122
hi, its ok. am a newbie too but you really need to do the grinding yourself. it seems we all need the extra hardwork

##### Share on other sites
oler1s    585
@OP (unwantedminority):

Take a look at this thread. So many people replied. But how many volunteered to be your guide? None. Because no one will volunteer for it. I’m actually trying to tell you something useful. If I wanted to just be hostile, there would be no mistaking it from my post. If someone else, or the mods, think my posts come off as hostile, do chastise me in a reply or through PM. I’m not being a jerk, I’ll listen.

Part of being a programmer is having the right attitude. You are displaying the wrong one, and I’m trying to move you out of it. Ignore me if you wish. Maybe you’ll want to read http://www.catb.org/~esr/faqs/smart-questions.html though, because it will show you how to get more relevant answers to your questions.

[Edited by - oler1s on June 26, 2008 6:43:16 PM]

##### Share on other sites
Well basically... what I was looking for was somebody who I could contact to find out what languages I should and learn and help me if I ever got stuck at some point... I don't want to get other people to make the game for me... I'm genuinely interested in learning the languages so I can use them for other projects myself, without any help.

##### Share on other sites
Anexa85    186
People need to stop being so paranoid, especially in the "For Beginners" section. If you want to answer the question, you should answer in the way that you find best and if you don't want to hold his hand, then don't. I think it's rude and uneccesary to respond so sarcastically.

If you think it's a dumb question, don't answer it and just point him to a place that can help. At least give people a chance before you decide their asking you to make their game for them.

I was interested in this thread because I have been working hard to learn C++ but am still not quite sure how to best implement a system for a text-based RPG. I was hoping for some answers as to methods or possibly a site that does show some good methods. I want to do the programming myself or I wouldn't be busting my tail to learn C++ but sometimes all you need is someone to give you an idea about how to think about the problem. Thankfully some people provided that for me and I believe that I can start programming my text-based RPG by myself.

Some people might want their hand held and I have seen that a lot on here but some people are working hard and come to the "For Beginners" section becuse they are new and don't know where to find the best resources yet.

##### Share on other sites
oler1s    585
Quote:
 Anexa:If you think it's a dumb question, don't answer it and just point him to a place that can help. At least give people a chance before you decide their asking you to make their game for them.
I don’t think he had a dumb question. I think it’s a question that will not get any answer. You ask someone to personally contact you and spend time guiding you, you will either be ignored or be berated. Except for me, not a single person responded to OP’s query for personal help. I’m not being sarcastic or paranoid. I’m giving a response, so OP doesn’t keep repeating a query that will continue to be ignored, and will eventually get a sharper reprimand. It’s bad etiquette to come on a forum and ask for personal one-on-one help when it isn’t warranted. It isn’t here.

Quote:
 what I was looking for was somebody who I could contact to find out what languages I should and learn and help me if I ever got stuck at some point
If you’re looking for information on how to pick a programming language, you should go through this subforum’s post archive. Your “what programming language” query shows up literally about every other day. If you go through the posts from now until a long way back, you will get more information than you can ever read on picking a language. I’ll summarize very quickly: Python and C# get recommended the most. C and C++ have big fat “do not touch” stickers on them here. Everything else is talked about marginally when you ask a “what programming language” question. You’re told to investigate yourself, and if you can’t make up your mind, just go with something.

Also, please don’t mistake learning a programming language for learning how to program.

##### Share on other sites
Anexa85    186
Once again , this is "For Beginners" and your second reply there was actually helpful for once.

Also, since I am a beginner, and do not have the time to take classes, learning the language is my first step into learning to program.

You are being negative for no reason and should probably not post in for beginners especially since you don't seem willing to actually acknowledge people who are trying.

##### Share on other sites
Chris27    122
I've actually never written a text based game, but I was thinking of how one could be done and came up with this as a beggining to creating an invisible game board in my mind. It's not a game yet, but it has the basic structure for a game I think. I'm sure someone else could have done a lot better job.

#include <iostream>using std::cin;using std::cout;using std::endl;// Shows current player board positionvoid ShowPosition(int X, int Y);// Outputs message when you are at the end of the boardvoid EndOfBoard();int main(){	// end of board	const int lrMax = 4;	// beggining of board	const int lrMin = 1;	// top of board	const int udMax = 5;	// bottum of board	const int udMin = 1;	// board position	int boardPosition[2] = {1, 1};	// keyboard input choice	char getKey;		cout << "Welcome to Game Board Example!"		 << endl		 << " press n to quit"		 << endl;	do	{		cout << "Which direction would would you like to go?"			 << endl			 << "1 left, 2 right, 3 up, 4 down"			 << endl;		cin >> getKey;		switch(static_cast<int>(getKey))		{			case static_cast<int>('1'):				// if greater then beggining move left				if(boardPosition[0] > lrMin)				{					boardPosition[0] -= 1;					ShowPosition(boardPosition[0], boardPosition[1]);				}else EndOfBoard();				break;			case static_cast<int>('2'):				// if less then end move right				if(boardPosition[0] < lrMax)				{					boardPosition[0] += 1;					ShowPosition(boardPosition[0], boardPosition[1]);				}else EndOfBoard();				break;			case static_cast<int>('3'):				// if less then top move up				if(boardPosition[1] < udMax)				{					boardPosition[1] += 1;					ShowPosition(boardPosition[0], boardPosition[1]);				}else EndOfBoard();				break;			case static_cast<int>('4'):				// if greater then bottum move down				if(boardPosition[1] > udMin)				{					boardPosition[1] -= 1;					ShowPosition(boardPosition[0], boardPosition[1]);				}else EndOfBoard();				break;			case static_cast<int>('n'):				// end of game message				cout << "Goodbye" << endl;				break;			default:				// error for wrong input from keyboard				cout << "Please enter 1, 2, 3, or 4" << endl;		}		// if you are at this board position you are dead!  game over		if(boardPosition[0] == 1 && boardPosition[1] == 3)		{			cout << "Trap triggered! You are dead!" << endl;			getKey = static_cast<int>('n');		}	// exit the game game if n is pushed	}while(static_cast<int>(getKey) != static_cast<int>('n'));	//system("pause");	return 0;}void ShowPosition(int X, int Y){	cout << "Current board position = [" << X << "] [" << Y << "]" << endl;}void EndOfBoard(){	cout << "You are at the end of the board!" << endl;}