954,541 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Text based games

I just decided that I wanted to make one with C++, but I'm not really sure what I should put in it. Any ideas? I don't just want it to be some boring thing where you have to "Press enter to continue" all the time.

ben1996123
Junior Poster in Training
82 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

Try making it include:
Your own scripting language
OOP Design
Loadable Scripts
Threading
Online support
Script DLC, Script IDE, and a Script Store
Static and Dynamic libraries, so on a small update you just release a DLL rather then a new .exe(besides on major updates)

I am working on a side project to my 3D game that has support for most of this stuff.
My scripts are no more advanced then something like(but not exactly):

print:
     "A monster is incoming"
Attack(MonsterType, MonsterSpecialName, &Player):
     MonsterType = "Elf"
     MonsterSpecialName = "Scriptor"
     &Player = default_player

Honestly, a text based game is not to advanced and you can probably find all the resources needed on http://www.cplusplus.com .
You should first start by making a nice static library instead of the game itself, as you will realize you will be doing the same things over again alot(I saw 1 person who put a whole game in a main!!!...LOL.) Just PLEASE use OOP and make our lives easier, and if you don't ATLEAST use functions.

BCBTP
Light Poster
34 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

Try making it include: Your own scripting language OOP Design Loadable Scripts Threading Online support Script DLC, Script IDE, and a Script Store Static and Dynamic libraries, so on a small update you just release a DLL rather then a new .exe(besides on major updates)

I am working on a side project to my 3D game that has support for most of this stuff. My scripts are no more advanced then something like(but not exactly):

print:
     "A monster is incoming"
Attack(MonsterType, MonsterSpecialName, &Player):
     MonsterType = "Elf"
     MonsterSpecialName = "Scriptor"
     &Player = default_player

Honestly, a text based game is not to advanced and you can probably find all the resources needed on http://www.cplusplus.com . You should first start by making a nice static library instead of the game itself, as you will realize you will be doing the same things over again alot(I saw 1 person who put a whole game in a main!!!...LOL.) Just PLEASE use OOP and make our lives easier, and if you don't ATLEAST use functions.

Umm... All of that stuff is way too advanced for me at the moment... I was just wondering what to actually put in the game, stuff like monsters/battling/items, not stuff like online servers. Well, I would do that if I had any idea how to :P

ben1996123
Junior Poster in Training
82 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

Oh wow, L.O.R.D. has come flooding back to me... have a look at that for some inspiration; I remember it as being pretty nifty, back in the day.

You also might wander through the IF Archive ; there are a lot of interesting text games and articles on game design in there. It's maybe a little different type of game than what you're looking for, but it's educational, anyway.

gusano79
Posting Pro
521 posts since May 2004
Reputation Points: 182
Solved Threads: 77
 

If you're really starting out with programming, i'd advice going for something that can start out simple, like a rpg without combat (walking, talking, throwing switches etc).
Once you get about 5 minutes of gameplay, you could try to integrate some simple stuff like an inventory and mob fights.

and finally, later on you might want to add more complex stuff like your own gear, classes and spells.

phoenix_2000
Junior Poster
107 posts since Sep 2011
Reputation Points: 40
Solved Threads: 12
 

Yeah, but PLEASE use OOP, there is enough C++ function only text-based games.

Player *newplayer;
Monster *monster;
newplayer = new Player;
monster = new monster;
newplayer->combat(&monster);
delete newplayer;
delete monster;

I think that is right, I am still new to new and delete.

And in a OOP perfect text based game that would start combat with your default monster and player IMO.

BCBTP
Light Poster
34 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 
Moschops
Practically a Master Poster
620 posts since Sep 2008
Reputation Points: 258
Solved Threads: 117
 

You could always make a game where a user starts at door and the user has for options.
* Move up
* Move down
* Move left
* Move right
Upon selecting each option the user will move one tile across and will receive a message saying something like "You are now in a forest". Or "There is a gate that requires a key". And the user would have to go across the map to find a hidden object until the player gets to the finish line/tile. The memories.

cwarn23
Occupation: Genius
Team Colleague
3,033 posts since Sep 2007
Reputation Points: 413
Solved Threads: 259
 

Yeah if you really want to get good, you should go to DirectX, OpenGL/SDL.
I like D3D alot, and I am working on a simple engine for it.

BCBTP
Light Poster
34 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

guys, don't forget we're talking about someone that wants a simple starter project :)

phoenix_2000
Junior Poster
107 posts since Sep 2011
Reputation Points: 40
Solved Threads: 12
 

yeah. I still work on my text based game, more so the scripting lang which is in console(but will be used for everything), which is

if(str == "#alloc") Alloc(str);
if(str == "#asign") Asign(str);


But of course those functions arn't the easiest to write...
And also my scripting lang is more like a .lib only. Like I have no bare .exe to interpret.

BCBTP
Light Poster
34 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

my question is

is the user viewing text and entering text

or is the world generator is real time text message driven environment and the user is a GUI smartphone interface or dumb GUI screen & mouse ...

Cireyoretihw
Newbie Poster
6 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: