Jump to content
  • Advertisement
Sign in to follow this  
Goniloc

How to make a linear text adventure in C#? URGENT

This topic is 1834 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey, I know basic C++ coding and I want to make a text adventure for PSM, but it only accepts C#. Nothing Zork-line, it'll just be like select the answer you want, like those goosebumps books. Please, someone give me some insight.

Share this post


Link to post
Share on other sites
Advertisement

What exactly are you having trouble with? The basic elements are the ability to get user input and to display text to the screen. Additionally the ability to read text from a file and to represent such text in some form of a data structure is usually desired.

 

If you break your question up into parts you could ask:

 

1. How do I display text to the user?

2. How do I get user input?

3. How do I read a file?

4. What format should I store my data in?

5. How could I represent my data internally and what data structures could I use?

 

Since you mention (or it seems) that this is for a competition I would recommend that you research each of these independently.

 

I will start you off with the first: http://msdn.microsoft.com/en-us/library/aa288463%28v=vs.71%29.aspx.

 

Advice on 4 is that you could use JSON or XML to represent your data in a file. The reason for using a file is that it separates the game data from the game logic and provides a "data driven design".

 

5. Internally you could use a dictionary of "room" objects with some form of identifier for each room being the key.

 

Another bit of advice is that in general if you find yourself asking for help "urgently" on a forum, then you are likely getting into a situation that you may not be entirely prepared for. Know that programming takes time, and usually LOTS of time. Always be sure to budget plenty of time with software projects so that you have time to cover the unexpected. It has been said that usually what someone thinks they can do in a day is usually about 2x to 3x more then they can actually do. So take how long you think something will take, double it, and then add a bit more for good measure.

 

Good luck.

Edited by shadowisadog

Share this post


Link to post
Share on other sites

To add a little bit more to this topic, my suggestion is to think about the design of your game and the story that you have. Your story should be developed before you begin the process of creating the game. Your task is to translate the story and the "branches" of the story into a format that can be navigated by a computer. There are many ways to do this but my suggestion would be to think of each story "node" before a transition point (where you ask what they want to do next) as having a unique identifier. This identifier can be used to access that particular point in the story. The transitions are then choices that the player can make. Each choice would correspond to some action (such as going to a different point in the story, ending the story, ect). Your program would then start at the first story node, and display the text for that node along with the choices for the user. The user would then input a choice and the program would execute whatever action corresponded to that choice. If for instance the action was to navigate to a new story node then that action would take place and the text for that story node would be displayed.

 

Some people start by trying to hard code the entire contents of the story into a computer program with a bunch of print statements, read statements, if statements, ect but this way of approaching the problem is extremely limited and involves writing a great deal of repetitive code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!