Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


How can I create a text based adventure game?

  • This topic is locked This topic is locked
21 replies to this topic

#1 wormhero1   Members   -  Reputation: 105

Like
0Likes
Like

Posted 03 July 2012 - 11:02 PM

I've wanted to make games for a while now. I started learning c# about a week ago. I know some basics, but I'm still learning it. I just wanted to ask how can I start to create a text based adventure game. I have yet to find a real tutorial on it. Can anyone give me some tips on creating one?

Sponsor:

#2 laztrezort   Members   -  Reputation: 1017

Like
0Likes
Like

Posted 03 July 2012 - 11:28 PM

There was a similar question I replied to a little while ago, here: http://www.gamedev.n...ork-clone-in-c/

I gave some suggestions in the above link, if you have more specific questions I'll try and help.

#3 DevLiquidKnight   Members   -  Reputation: 834

Like
0Likes
Like

Posted 03 July 2012 - 11:32 PM

Your going to want to make a set of rooms in some sort of format, that have a variety of things in them and then load them from say an XML file. It's somewhat of an advanced thing to build for a beginner to C#. Have you done coding in any other languages?

I would recommend you start smaller then this, perhaps try making a game where their is a grid of locations that are drawn to the screen and it lets you move through the grid somewhat like a map. You can imagine using an array to store the information of where the person is, and then moving them through the array based on where they want to go. Then each area could have say a chance of getting attacked by say a monster, and then it would switch to a combat system. Where you would fight this monster before you can move again.

This thread may also prove useful.

Edited by DevLiquidKnight, 03 July 2012 - 11:34 PM.


#4 CaptainKraft   Members   -  Reputation: 266

Like
0Likes
Like

Posted 04 July 2012 - 09:28 PM

I made a SUPER SIMPLE and probably poorly done text game in Java (which is very similar to C#). If you want to check it out as an example you can see the game and a link to the source on my website.

What I did was build a class for each major concept that I wanted. Items, rooms, entities(players and monsters). The rooms were a bit tough to tackle. The simplest way I could imagine doing it was assigning exits to each room which were just other rooms themselves. When a player went though an exit they were put in the next room. If there was no exit in that direction(N S E or W) then it was null and did not allow traversal.

My source code will explain in better but if you have any questions, feel free to ask: myself and the other programmers here will be able to help. Good luck.

#5 nugget850   Members   -  Reputation: 101

Like
0Likes
Like

Posted 05 July 2012 - 01:19 AM

This is my first coding language. What are some suggestions for creating a game simpler?

#6 CaptainKraft   Members   -  Reputation: 266

Like
0Likes
Like

Posted 05 July 2012 - 07:35 AM

This is my first coding language. What are some suggestions for creating a game simpler?


I think just about everyone would like simpler (read better) code. What I find helps me the most is making sure that I know what I want to do before I start coding. Thinking about what you are going to program is a huge part of programming. Even if you don't know exactly what data structures you will use to solve a problem, just make sure that you understand what needs to get done.

My answer is pretty abstract, but there really is no language specific advice to give for that question. It's all about how you tackle the problem.

#7 kseh   Crossbones+   -  Reputation: 2476

Like
4Likes
Like

Posted 05 July 2012 - 12:58 PM

It's already been mentioned and I'll repeat the fact that there's a lot of techniques that you can probably learn yet that would make it easier to produce a text adventure. However with careful thought about what you already know and some creativity you should be able to come up something that will help you feel like what you're learning is worthwhile and in the direction that you've been hoping for. If I recall, my first text adventure used little more than a couple of switches and a whole lot of if statements. Code wise, it was horrible. But it more or less did what I wanted it to and I was proud of the result.

First I used pen and paper to draw a map which I think was just a 5 * 5 grid. I planned which directions the player could go for each location. I also figured out what text I would print for each location. For whatever location the player was in, I'd print the text, then collect input regarding which direction the player wants to move, if it's a valid direction then move the player to the desired location, and repeat.

As for challenges of some kind to complete, you will need to know what those challenges are and how the player would be expected to beat them. Developing a combat system is one option but it might be a bit early for that. It'd probably be easier to think of something like, there's a giant frog blocking the player's way in one location. You would track the fact that the frog is in this room and so long as it is in this room, attempts to travel through one exit will be disallowed. The player recalls that in another location is a jar of flies. He travels back to the room with the jar. The player is somehow given the option to get the jar. The fact that the player now has the jar in his possession is tracked. The player returns to the frog. The player drops the jar (again tracking the fact the jar is in the player's possession). When the jar is dropped in this specific room, the frog chases the flies and is no longer blocking your path.

You can do the sort of stuff I described above by just setting some variables, using if statements, and printing to the screen. Nothing spectacular at all. If there's one reason to not proceed yet though, it is that using only those techniques, you *will* end up with a large mess of code that will be difficult to manage and identify where problems are occurring. Organizing things into classes and being able to load data from files could help that. Truth be told though. if you have no experience with that sort of thing you're just as likely to end up with a giant mess that doesn't work either. So the best tips I can give would be to; get creative with what you know, plan the best you can, give the plan a try, don't be afraid to fail, learn something about what you did, and repeat.

#8 larspensjo   Members   -  Reputation: 1561

Like
0Likes
Like

Posted 05 July 2012 - 01:16 PM

So the best tips I can give would be to; get creative with what you know, plan the best you can, give the plan a try, don't be afraid to fail, learn something about what you did, and repeat.

I couldn't agree more. Either you succeed with what you want to do, which is fine. Or you don't succeed to get what you want. The failure is unfortunately one of the best ways to learn. That is when you start to appreciate design patterns. Without having done the failure first, it can be hard to understand why a specific design patterns are used.
Current project: Ephenation.
Sharing OpenGL experiences: http://ephenationopengl.blogspot.com/

#9 DavitosanX   Members   -  Reputation: 328

Like
4Likes
Like

Posted 06 July 2012 - 10:25 AM

To the OP, if you think that a text game is easier to do than a graphical one, you may be mistaken. Really, learning to display an image on the screen isn't particularly difficult. If you already have a basic grasp on your language of choice, it's at most a one-day endeavor.

If you like, take a look at Inform 6 or 7. It's a programming language designed specifically to write interactive fiction. You'll realize soon that those games' complexity is staggering. Don't shy away from graphics. Once you start getting the hang of it, the results will be very satisfying.

Of course, if you mean to program a text adventure, do try out Inform. After all, some of the greatest games of all time are interactive fiction (The Lurking Horror, anyone?)

Starting out in game programming? Me too! Check out my blog, written by a newbie, for the newbies. http://myowngamejourney.blogspot.mx/

 

Also, if you don't mind a 5 seconds ad, here's a great free ebook for beginners on the subject of pygame: http://bit.ly/19Bem2q


#10 Vollkrasser   Members   -  Reputation: 137

Like
0Likes
Like

Posted 28 March 2015 - 05:07 PM

just use this platform, there is everything:

http://textadventures.co.uk/quest



#11 jacmoe   Crossbones+   -  Reputation: 1971

Like
0Likes
Like

Posted 28 March 2015 - 05:18 PM

The most obvious place to look: http://bit.ly/1HUYIxG

 

For example: http://www.lincolnli.com/text-adventure-game---c.html


More signal, less noise

#12 frob   Moderators   -  Reputation: 29010

Like
0Likes
Like

Posted 28 March 2015 - 05:44 PM

Not so much a tutorial on the genre, but I built a mini text adventure as a step in the process, documented here.  


Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I write about assorted stuff.


#13 Khatharr   Crossbones+   -  Reputation: 3798

Like
3Likes
Like

Posted 28 March 2015 - 06:21 PM

A thread for the ages...


void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

#14 DaveSF   Members   -  Reputation: 499

Like
1Likes
Like

Posted 05 April 2015 - 03:46 PM

Start by writing a one room text adventure.

Add a room.

Rinse repeat.

#15 jacmoe   Crossbones+   -  Reputation: 1971

Like
0Likes
Like

Posted 05 April 2015 - 04:04 PM

To the OP, if you think that a text game is easier to do than a graphical one, you may be mistaken.

Well..

A text adventure is probably the most focused type of game you can make. The complexity of assets like textures, models, animations, whatever is not there. :)

You can concentrate on the text, the logic and the code.

That sounds easier in my ears.


More signal, less noise

#16 MarkS   GDNet+   -  Reputation: 1616

Like
1Likes
Like

Posted 05 April 2015 - 04:30 PM

Well, I've been wanting to make one for years, but...

Attached Thumbnails

  • 20101115002739_181_necropost.png


#17 jacmoe   Crossbones+   -  Reputation: 1971

Like
1Likes
Like

Posted 05 April 2015 - 04:41 PM

D'oh - did not notice that the OP posted this in 2012 biggrin.pnglaugh.png


More signal, less noise

#18 MarkS   GDNet+   -  Reputation: 1616

Like
0Likes
Like

Posted 05 April 2015 - 06:30 PM

I've actually been wanting to make one for years, but I've also had that pic waiting for years... Perfect timing! I get to use that pic and this thread might just spur me on to make a text adventure game! Now I just need a story. But that's a topic for another thread in another forum...

 

As a side note, although completely relevant, the forum software alerts you when you are about to post in a thread older than 60 days:

Attached Thumbnails

  • Clipboard01.jpg


#19 Khatharr   Crossbones+   -  Reputation: 3798

Like
0Likes
Like

Posted 05 April 2015 - 09:34 PM

We should change it to also warn if the topic itself is over a certain age.


void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

#20 MarkS   GDNet+   -  Reputation: 1616

Like
0Likes
Like

Posted 05 April 2015 - 10:32 PM

I disagree. They lost favor with the introduction of interactive computer graphics, but the lack of graphics makes the developer focus on the story; Something that I think has been lost. The lack of graphics has one other advantage and that is that you must actually think to win. Depending on the amount of time spent developing the story and world, they can be even more challenging than CGI-based games. You easily forget where you are in the world, what direction to go, what inventory you have. It's like playing Skyrim blindfolded. You have to use your imagination and memory. You need both of those less with visuals.







PARTNERS