6 Replies - 858 Views - Last Post: 25 March 2014 - 08:42 PM Rate Topic: -----

#1 NantucketSleighride   User is offline

  • D.I.C Head

Reputation: 22
  • View blog
  • Posts: 112
  • Joined: 13-February 11

Ideal language for creating a nice looking text game

Posted 13 March 2014 - 05:13 PM

So I've some experience with languages like VB, C#, and C++. Very basic experience, I'd say. I understand the basics - but I've never really delved into the more intricate parts.

Now, I suppose what I'm trying to do could actually be done in VB or C# as a Windows, but I'd rather do something more console like.

I'm not thrilled with the way the Windows Console works. While I love C# as a language, and I love the flexibility of the console; the inability to make it full screen and to play with the window more makes it not idea to me.

I'm looking to work on my programming by making text based games - I'm also not a master programmer, so I'm looking for languages that are flexible, but easier to understand. I don't have a lot of experience with other languages, but I'm aware there are tons out there like Ruby, Java, Python, COBOL, Fortran, etc, etc.

What would be a language that would be well suited to created your standard 80's/90's style console text game? I'd like the ability to set a screen size, be able to manipulate the colors, have something that can handle say not only text but also a "rogue" style screen (ie - moving characters and what not), the text lines up by itself (I can't remember the term for this - but like how if you make a console app, the font is basically set in a way that the letters always take up the same amount of room, and thus line up properly when you try to make things like maps and images with them).

edit: oh yes - and I have Windows, but my primary computer is a Mac - so a language that would work on a Mac and be cross-platform for would be great.

This post has been edited by NantucketSleighride: 13 March 2014 - 05:21 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Ideal language for creating a nice looking text game

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14045
  • View blog
  • Posts: 56,217
  • Joined: 12-June 08

Re: Ideal language for creating a nice looking text game

Posted 13 March 2014 - 05:17 PM

Why not make a windows form, slap a textbox (docked to full) into it, set the coloring, and output your text to that as a 'console'?
Was This Post Helpful? 0
  • +
  • -

#3 BBeck   User is offline

  • Here to help.
  • member icon


Reputation: 792
  • View blog
  • Posts: 1,886
  • Joined: 24-April 12

Re: Ideal language for creating a nice looking text game

Posted 13 March 2014 - 06:52 PM

I set out to make a rogue-like many years ago. What I found out was that you might as well just make a modern tile game.

The reason that console games worked back in the day was that you could write directly to the screen buffer. You could tap directly into the BIOS and you could tap directly into the hardware interrupts.

With Windows, you can't do that. And drawing to the console window is just as slow as the day is long. It's way too slow for a decent rogue-like. It sounds like you've already experienced this first hand. All the solutions that truly solve the problem are going to be basically the same as making a sprite based tile game. (Unless of course you can format your harddrive and install DOS 3.1 on your machine.) ;-)

You need lowlevel access to the graphics card. Basically that means either DirectX or OpenGL. That doesn't mean you have to actually program in those SDKs. XNA, for example, is built on DX9. So you're actually using DX9 but in a much easier to use environment built around C#.

You could take something like XNA and it's ability to write fonts to the screen and make a top of the line rogue-like. Or you could use it for something far more advanced.

But you're going to need some sort of 2D graphics platform designed for full 2D games. Nothing else is going to be fast enough drawing fonts to the screen.

Although... I haven't done anything with Win8 and you might look into GDI+ or whatever the new interface thing they've got going is with XAML and all that. They made promises that all that was going to run fast enough for 2D graphics.
Was This Post Helpful? 0
  • +
  • -

#4 BBeck   User is offline

  • Here to help.
  • member icon


Reputation: 792
  • View blog
  • Posts: 1,886
  • Joined: 24-April 12

Re: Ideal language for creating a nice looking text game

Posted 13 March 2014 - 07:00 PM

I wonder if you could do that in Unity? XNA is supposed to be cross platform compatible through MonoGame. But I'm pretty sure Unity is cross platform.

You might have to actually draw your own fonts as sprites. I'm not sure how much support any of these environments would give you for any of this.

Another thing is that rogue-likes took advantage of the ASCI character set which is 128 byte + 128 byte with the upper 128 being special characters that you could control the color of.

Today, no one uses that. Everything is Unicode. So, it's a completely different character set.

And I think they call them "proportional fonts" when they are evenly spaced like that. Most fonts are not. Courier New usually is. And there's a system font that usually is.

Oh! Also, sprites can be colored. So if you make the sprites for the character symbols in black and white you can reassign the white color at runtime.

This post has been edited by BBeck: 13 March 2014 - 07:02 PM

Was This Post Helpful? 0
  • +
  • -

#5 baavgai   User is offline

  • Dreaming Coder
  • member icon


Reputation: 7166
  • View blog
  • Posts: 14,933
  • Joined: 16-October 07

Re: Ideal language for creating a nice looking text game

Posted 14 March 2014 - 03:36 AM

View PostNantucketSleighride, on 13 March 2014 - 07:13 PM, said:

While I love C# as a language, and I love the flexibility of the console; the inability to make it full screen and to play with the window more makes it not idea to me.


Step back a moment. If you are in a Windows environment, how often do you really want a program to take over the whole screen?

The console has zero flexibility; it's just a place text is dumped. If you get fancy, it's a grid where text is dumped. Fancier still; colored text.

The thing is, if you're designing a pretty text game, you have only a few drawing options. You actually have only two core methods: getChar(row,col) and setChar(row,col,color,char). Add dimensions and you're off. User IO can be as simple as getKeyPress.

If you write a very basic display interface, the implementation details can be worked out later. The result could run in a console or a graphics screen. If you want full screen in Windows, you'll ultimately having to emulate a console in DirectX.

As noted, you'll end up writing a rather primitive looking tile game. Curiously, in the ancient days of computers, some tile games worked by loading a custom font set and using text as sprites. Today, in most systems, you'll have to do just the opposite.
Was This Post Helpful? 0
  • +
  • -

#6 AdoTheLimey   User is offline

  • D.I.C Head

Reputation: 23
  • View blog
  • Posts: 99
  • Joined: 28-June 10

Re: Ideal language for creating a nice looking text game

Posted 16 March 2014 - 02:20 PM

View PostBBeck, on 13 March 2014 - 07:00 PM, said:

I wonder if you could do that in Unity?


I bet you could use a Text Mesh to achieve that ascii character look and have support for dynamic fonts, scaling, colours etc. I might actually give that a whirl and see how it looks.
Was This Post Helpful? 0
  • +
  • -

#7 Blindman67   User is offline

  • D.I.C Addict
  • member icon

Reputation: 139
  • View blog
  • Posts: 615
  • Joined: 15-March 14

Re: Ideal language for creating a nice looking text game

Posted 25 March 2014 - 08:42 PM

Best and easiest option is HTML and Javascript. Every device under the sun will display and run it. HTML is designed for lovely rich interactive content. All you need is a text editor and a browser.

Javascript has got to be one of the easiest languages to get started in yet it also has the power to do amazing stuff.

To get you started.... this is very dirty formatted, rule breaking code. But will run on anything.
Copy the code below, put it in a file, remove the line numbers that this forum puts on it, save it with ".html". Open it with a browser.
<style>
span.say {cursor:pointer;min-width:200px;width: 154px;display: inline-block;text-align:center;}
span.say:hover {background:#4499dd;}
div.desc {font-size: 30px;width: 500px;text-align:center;}
</style>
<div id='theStory' align=center></div>
<script>
var page = [];
page[0] = {Story:"Was a dark night, and the natives where restless",
           options:[{say:"Ok!",doPage:1},
                    {say:"Why?",doPage:2}]};
page[1] = {Story:"You hear a twig break, and the shuffle of feet.",
           options:[{say:"Scream!",doPage:3},
                    {say:"Say hello?",doPage:4},
                    {say:"Look around",doPage:5}]};
page[2] = {Story:"There in lies the problem, why? why is the sky blue? Why must everything change?.",
           options:[{say:"I dont know",doPage:1},
                    {say:"Maybe I can help",doPage:13},
                    {say:"Who are these natives anyways",doPage:12}]};
page[3] = {Story:"<h1>QUIET FOOL!!</h1>.",
           options:[{say:"Sorry!",doPage:6},
                    {say:"Screem even louder",doPage:7}]};
page[4] = {Story:"<h1>QUIET FOOL!!</h1>.",
           options:[{say:"Sorry!",doPage:6},
                    {say:"Say hello again",doPage:7}]};
page[5] = {Story:"You see nothing as it was and still is, a dark night.",
           options:[{say:"Right can I go now!",doPage:100},
                    {say:"Say hello.",doPage:4}]};                    
page[6] = {Story:"No probs! Now where was I?",
           options:[{say:"Dark night!",doPage:0},
                    {say:"Twigs",doPage:1}]};
page[7] = {Story:"You hear a twang....",
           options:[{say:"Duck",doPage:8},
                    {say:"Run!",doPage:8},
                    {say:"Soil your self.",doPage:9}]};
page[8] = {Story:"Right between the eyes the arrow hits. Your dead lifless body joins the dusty bones of many that came befor.",
           options:[{say:"The end",doPage:100}]};
page[9] = {Story:"Right between the eyes the arrow hits. Your dead lifless body attracks flys.",
           options:[{say:"The end",doPage:100}]};
page[12] = {Story:"Who knows i just write this crap?.",
           options:[{say:"OK",doPage:100}]};           
page[13] = {Story:"Can you ?",
           options:[{say:"Yes",doPage:14},
                     {say:"No",doPage:7}]};           
page[14] = {Story:"Really?",
           options:[{say:"Yes",doPage:13},
                     {say:"No",doPage:6}]};           
page[100] = {Story:"<h1>Javascript games are the way to go!!</h1>",
           options:[{say:"Native apps are doing the DoDo<br><img src='http://www.buzzle.com/img/articleImages/352444-141-30med.jpg'>",doPage:101}]};
page[101] = {Story:"<h1 style='color;blue;'>See Ya Next time</h1>Blindman!",
           options:[]};

// this bit does the work
function displayPage(pageNumber){
   var str ="<div class='desc'>"+page[pageNumber].Story+"</div>"
   for(var i = 0; i < page[pageNumber].options.length; i++){
        str += "<span class='say' onclick='displayPage(";
        str += page[pageNumber].options[i].doPage;
        str += ")'>"+page[pageNumber].options[i].say + "</span>"
   }
    theStory.innerHTML = str;
 }
displayPage(0);
</script>


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1