Sign in to follow this  

total newbie wants to make simple text games but needs help.

This topic is 2662 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

Hi, um, I am not sure what programming language to use, it doesn't matter, as long as it's the one most or second most used. (C++? java?) could someone please help and tell me what to download so I can start making a text game?

oh, and im on a PC.

Share this post


Link to post
Share on other sites
Yep; I haven't used python in a while, but a quick google shows that it can output to the console. It can also change the color of the text and background (or just portions of text) - but only the limited colors that the console allows (10 or so colors - same as C++).

Share this post


Link to post
Share on other sites
Quote:
Original post by namragog
I have looked at the tutorials and stuff, but I can't find one on how to make a text game. please help!


The best way to learn how to make a text game is first of all getting familiar with the language you are going to use, because doing so will most likely inspire you to figure out how to design your game. I have never used Python myself, but most programming languages make heavy use of data structures that allow you to store multiple "units" of the same type (eg. swords, rooms, players, messages etc.).

For example, let's say you are making a quest game where the user has to walk around in a virtual world and the actions he/she performs decides what is going to happen, like

"You are standing in an old house, to you left is a door and to your right is a chest."
> open chest
"You open the chest and find a short sword (1D6)"

In this case you would probably make a data structure representing a location (eg. the old house) containing information like what to display to the player when he/she enters ("You are standing in an old house, to you left is a door and to your right is a chest."), a list of objects in the room like the chest which would be a unit of another data structure (a container) with information about what is inside of it (the short sword, or perhaps nothing). Also, you would have a data structure representing a command (eg. "open") and write a set of functions to scan user input ("open chest") and take actions accordingly (in our example inform the user he/she has opened the chest and give him/her a short sword).

I hope this will help you get started.

Share this post


Link to post
Share on other sites
Specifically, to make a text game, the easiest and most common way is to make a console application. All you really need to know is how to throw text to the screen, and take text from the user. Start basic and work your way up. Make a password prompt, "Guess the number from 1-10" type game, try to make tic-tac-toe after that, maybe make a poker game.

I'm not familiar with python but I know a good book to look at for C++ would be "Beginning C++ Game Programming." It'll teach you the basics of the language as well as how to make small text based games. From there, you can make what ever you'd like.

Share this post


Link to post
Share on other sites
Quote:
Original post by slynk
Specifically, to make a text game, the easiest and most common way is to make a console application. All you really need to know is how to throw text to the screen, and take text from the user. Start basic and work your way up. Make a password prompt, "Guess the number from 1-10" type game, try to make tic-tac-toe after that, maybe make a poker game.

I'm not familiar with python but I know a good book to look at for C++ would be "Beginning C++ Game Programming." It'll teach you the basics of the language as well as how to make small text based games. From there, you can make what ever you'd like.


Hey im also a complete n00b at programming but i'v bought this book "Beginning C++ Game Programming." i haven't really read much of it yet but from what i can see and what i'v heard it's the best place to start learning C++. i would really suggest you get this book.

Share this post


Link to post
Share on other sites
Quote:
Original post by Servant of the Lord
Python would be excellent for text games, is easier to learn than C++, and has even been used in major commercial games.


Maybe im unaware of something here , isnt Python one of the most portable and slowest languages? python vs c++ ratio == 9/1 (around that) i even heard 12/1

how can be a large scale game be written in that , when nr1 priority is speed?

(maybe a pythonish mmo might work fair,but still)

and namragog go C ,and learn it from K&R, you can not know C++ without the basic C knowledge, (+ that i might say C works fine with what are you trying to do)

Share this post


Link to post
Share on other sites
Quote:
Original post by NextEpisode1
Quote:
Original post by Servant of the Lord
Python would be excellent for text games, is easier to learn than C++, and has even been used in major commercial games.


Maybe im unaware of something here , isnt Python one of the most portable and slowest languages? python vs c++ ratio == 9/1 (around that) i even heard 12/1

how can be a large scale game be written in that , when nr1 priority is speed?

(maybe a pythonish mmo might work fair,but still)

and namragog go C ,and learn it from K&R, you can not know C++ without the basic C knowledge, (+ that i might say C works fine with what are you trying to do)



In data driven world of game engines, rather easily.
Platform specific low level implementation is communicated with a higher level "content" language, such as LUA, Python or whatnot that describes the game logic.

That I would understand as "writing the game".

Share this post


Link to post
Share on other sites
[Warning: Wall-o-text]
Quote:
Original post by NextEpisode1
Quote:
Original post by Servant of the Lord
Python would be excellent for text games, is easier to learn than C++, and has even been used in major commercial games.


Maybe im unaware of something here , isnt Python one of the most portable and slowest languages? python vs c++ ratio == 9/1 (around that) i even heard 12/1)

Well sure it's slower, but computers today are also very fast - "slower" on today's super fast computers may be "faster" than whatever language you used on yesterday's computer. What's it matter if Python is 1/12 as fast as C++? That's like saying, I need to buy a racecar, because racecars are faster than the car I use to drive to work - but driving to work, I don't need the extra speed, and the extra cost of learning to drive a racecar would be wasted, and besides, a racecar would be harder to drive. However, when I decide to join NASCAR, then my experience driving a regular car will make it easier to learn to drive a racecar.

The point in choosing a programming language is not, "What's the most powerful language I can find?" but rather, "What's the best language for the job?". Now, the original poster is clearly a newer programmer. His 'job' is making a text based game. Python is far superior to C++ at doing that task, because it'll be easier to get things up and running, and easier to change things as you're working on it, thus Python is a better tool for the job.

But that was only the explicit job the user mentioned. There's a second implicit job; that of learning to program in the first place. Python is easier to learn than C++, so Python is the better tool for the second job as well: Introducing namragog to programming. Look at his posting history - he's jumping between different tools (RPGmaker, FPSmaker, etc...) trying to find the one tool that'll make game making easy enough to give him an entry point. C++ is not that tool. Python may not be that tool either, but it's a good deal closer. [wink]

Telling him to learn C or C++ is needlessly making his task more complex, and might be such a huge entry point to him, that he might give up, and never progress as a programmer at all.
Quote:
how can be a large scale game be written in that , when nr1 priority is speed?

Number one priority is speed? Maybe for a FPS, but not for every game under the sun. Besides, even for a FPS, most Python game engines are coded in C++, and you just do the logic in Python - all the graphic intensive stuff does run fast enough. Unless you are making a AAA modern game for next gen systems - but if you are doing that, then you're already a good enough programmer (one better than I) that you probably have multiple languages under your belt already. [smile]

When choosing a language to start learning today, you say, "What's the most helpful language to get me started?", not, "What's the best language to make that game I might start making 10 years from now?".

Quote:
and namragog go C ,and learn it from K&R, you can not know C++ without the basic C knowledge, (+ that i might say C works fine with what are you trying to do)

When going through C++ tutorials, they teach you C already; or at least C++'s version of it. The modern 'C' language is deviating from the 'C' language that C++ was built upon (or so I hear anyway - I might be mistaken). Learning modern 'C' is not a requirement to learning C++. Learning C++ is the sole requirement of learning C++; any 'C' features that C++ has, a C++ tutorial teaches you, because it's part of C++.

Is C++ a better language than Python? No. It's a different language than Python. I personally prefer C++ myself, so I understand where you are coming from, but C++ isn't better, it's just different. And you use different languages for different jobs. C++ is better for some jobs, Python is better for others. In namragog's case, Python is the superior choice (over C++, anyway, there may be even 'better' languages for the goal of namragog's entry into programming)

And yes, I do need a few lessons on being succinct. [grin]

Share this post


Link to post
Share on other sites

This topic is 2662 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this