Jump to content
  • Advertisement
Sign in to follow this  
carpetfilter

Retro Text-based games

This topic is 2465 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 folks,

I worked in the IT industry for five years as a web developer, so while I have experience with languages such as C#, Java, PHP, and perl, I have done very little development that isn't web-specific. I left the industry and now have an itch to work on a hobby project I've been thinking about for a year.

I've always had a special place in my heart for a good DOS text game. ZZT was one of my all time favorites. In that vein, I have come up with the general idea of a sci-fi RPG I'd like to build. I could best describe the project as text-based Sims, set in a space ship not unlike a Soviet-era submarine, with RPG elements in place of house-building. The game will focus heavily on the interactions and relationships between a crew of five forced to live together in isolation from Earth. Four of the crew will be AI controlled characters. The fifth, the commander of the team, will be where the player comes in. I have some ideas on how to simulate moods, personality, character development, relationships, goals, memory of past events, etc. That's why I liken it to a text-based Sims: The Sims has similar simulated social dynamics.

I am fairly comfortable with OO, such as working with classes, interfaces (headers in C++ I guess they are called), etc.

But in my endeavors to figure out the best ways go about making a text-mode game, I've come up against a bit of resistance from the community at large. The general feeling I get is that "nobody should use the console for anything with complex interactivity". Is there another way I should build a text based game that I'm not aware of? A main point of this project is to develop a reasonably good AI for four characters (crew of a ship), and this is what I want to focus on. Having to worry about designing art is a distraction, and worse, detracts from the feel I want this game to exude. Specifically, more like a book than a movie. In other words, no GUI, no mouse. But people are trying pretty hard to convince me I'm crazy.

At this point, I only really have one specific question

I've been using the win32 API to control the console, such as sizing it to 80 chars by 40 chars (which turns out to be 640x480), disabling the blinking cursor, and controlling the position of characters on the screen. But if there is a slightly more cross-platform API for making text based games, I'd love to know about it.

But any other feedback or comments would be helpful. Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Question: What made you decide to use C++ for your text-based game? Personally that's the LAST language I'd choose for writing this sort of application.

Share this post


Link to post
Share on other sites
Quote:
Original post by carpetfilter
"nobody should use the console for anything with complex interactivity"


Replace the word "interactivity" with the word "graphics" and they have a point. If you're doing a straight up text-based game then command line is obviously the correct choice.

You can also do command line in Java, so no need to use C++ unless you just want to learn the language. It's a good one to know in any case, but for this project it depends what your goals are.

-me

Share this post


Link to post
Share on other sites
Thanks for the replies so far!

As for why I chose C++... I quickly found Code::Blocks, and love it. I was using Bloodshed Dev C++ before. So I guess I chose C++ based on my extremely limited experience with using it before.

To be honest, I'm just not terribly aware of the options. I prefer the C style syntax, though - it's shared by all of the web-oriented languages I've used and I'm familiar with it. That is a big motivator. The particular language doesn't much matter, really. If there are better options you would recommend, fire away!

Share this post


Link to post
Share on other sites
Quote:
Original post by Palidine
If you're doing a straight up text-based game then command line is obviously the correct choice.


I think he's talking about something that uses text characters for graphics. A-la Rogue.

If thats the case and you're looking for a portable console library, you should look into Curses.

PDCurses is a curses library for Windows. I've never used it myself.

If portability isn't a concern, is there any reason you can't use C# and System.Console? I imagine it's a lot more pleasant to work with than straight Win32 :).

Share this post


Link to post
Share on other sites
Quote:
Original post by joshuanrobinson2002
Quote:
Original post by Palidine
If you're doing a straight up text-based game then command line is obviously the correct choice.


I think he's talking about something that uses text characters for graphics. A-la Rogue.

If thats the case and you're looking for a portable console library, you should look into Curses.

PDCurses is a curses library for Windows. I've never used it myself.

If portability isn't a concern, is there any reason you can't use C# and System.Console? I imagine it's a lot more pleasant to work with than straight Win32 :).


Ah, I should have clarified how I will be using text. I'll be using some minimal ANSI characters for "graphics", but there will be a main "window" that is mostly plain text contents, such as descriptions of the environment and character dialog, followed by multiple-choice options selected by the up/down/left/right arrow keys and enter key for making choices.

But yeah, Rogue-like is fairly accurate in the sense that whatever would be best for making a Rogue-like game is very likely also best for doing what it is I'm trying to do.

To be honest, my main concern is making sure that the console is of a predictable size. As far as I can tell, I've already figured that one out. I'm sure surprises will come up, though. Now all I have to do is figure out how to write characters to a buffer, then output to the console all at once. Then I'm set! So far, the Win32 API hasn't posed a problem. But I'm not doing anything fancy.

Portability isn't a major concern, though it would be a nice goal to aim for if I had the opportunity. Since I'm using the Win32 API, I guess you could say that right now there isn't any portability in my code at all.

That curses library looks promising. Thanks for the heads up!

Share this post


Link to post
Share on other sites
For cross-platform consistency, modern roguelikes actually use windows with tile-based graphics rather than text mode. The tiles are simply the ascii character set. There are libraries which make it simple as far as programming; you still work with characters and strings and don't have to worry about textures and whatnot. libtcod is the leader in that arena. It has lots of fancy features like converting true color graphics into tiled text but of course you don't have to use those features.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hollower
For cross-platform consistency, modern roguelikes actually use windows with tile-based graphics rather than text mode. The tiles are simply the ascii character set. There are libraries which make it simple as far as programming; you still work with characters and strings and don't have to worry about textures and whatnot. libtcod is the leader in that arena. It has lots of fancy features like converting true color graphics into tiled text but of course you don't have to use those features.


That looks very nice! I am not *really* making a roguelike game (my game shares the use of ASCII "graphics" but otherwise has little in common with the genre), but it looks like this would work quite well regardless. I will have to fiddle with this and PDCurses, once I get them working in Code::Blocks.

Your suggestion might just have revolutionized my approach, if I can get it all working (when it comes to desktop application development, I'm still very much a newb).

Share this post


Link to post
Share on other sites
Quote:
If portability isn't a concern, is there any reason you can't use C# and System.Console? I imagine it's a lot more pleasant to work with than straight Win32 :).


Have people still not heard about Mono? C# and the CLR are not Microsoft specific and so this shouldn't be seen as a limiting factor. In fact for a text based game I doubt you'd have to do any recompilation whatsoever to run on Windows/Linux/Mac**.

**This statement comes with no guarantee and may actually not be as easy as I've made out :), but would certainly be no different to issues that could occur from cross platform C++.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!