Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Curses or custom?  (Read 8574 times)

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Curses or custom?
« on: January 22, 2009, 03:29:13 pm »

So I've been playing a lot of curses games lately.  Straight-up curses: doomrl, that weird elf treetop game, stuff like that.  And unlike DF they all have one thing in common:  They're pure curses, pure terminal games, no GL rendering or the like.

So I'm thinking of working on a text-style game, and I'm wondering whether I should go the curses route or the graphical one.  Clearly, it's -possible- to get DF's style of graphics working on Linux and Mac, and it gives me more options in the long run...but there's something kind of soothing about curses, and it's probably easier.

So I'm looking for experienced people who've worked with curses and with, well, not-curses.  I've got some game development experience behind me, but usually projects that fall apart after 3-6 months.  I'm after advice on which style I should use.  I'd -really- like to develop in C#, but I don't know if there's any curses libraries...  and if curses has any particular annoying things, I'd really like to avoid them.  How easy is it to resize a window in curses?  Is it even possible, given an OS that's friendly to that kind of thing?

Right now I'm aiming for a simple project, not too complex, no graphical aims later in the future.  Basic interface pretty similar to how DF is now.

...And if anyone has a DF-style GL type of library that works similar to curses, but is dead simple to get running in C++, C# or Java...Boy I'd love to have that.  The key is 'easy to get set up', though.  All links appreciated.
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

DJ

  • Bay Watcher
    • View Profile
Re: Curses or custom?
« Reply #1 on: January 22, 2009, 03:34:30 pm »

You should check out SDL.
It's very simple, and it can handle all your interface needs (graphics, audio, keyboard, mouse, gamepad,...).
Logged
Urist, President has immigrated to your fortress!
Urist, President mandates the Dwarven Bill of Rights.

Cue magma.
Ah, the Magma Carta...

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: Curses or custom?
« Reply #2 on: January 22, 2009, 03:37:02 pm »

*cringes*

I've used SDL in the past.  Has it greatly improved in the last ten years?  It used to be a real bear.
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Fenrir

  • Bay Watcher
  • The Monstrous Wolf
    • View Profile
Re: Curses or custom?
« Reply #3 on: January 22, 2009, 03:37:59 pm »

I've got some game development experience behind me, but usually projects that fall apart after 3-6 months.
I'm not really experienced, since my projects fall apart after 3 minutes to 6 hours. I've a tendancy to bail when the going gets rough I suppose. It's so bad that the phrase "pulling a Fenrir" has come to mean just that. I hate myself for it. I'd try to strangle myself, but I'd probably quit halfway through...

er...

Oh yeah, sorry. Anyway, curses is easier. I don't think you can resize the window at all.
Logged

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: Curses or custom?
« Reply #4 on: January 22, 2009, 03:47:28 pm »

What if you compel the user to set his terminal size to 100x50?  If the user changes window size, can curses easily take advantage?
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Fenrir

  • Bay Watcher
  • The Monstrous Wolf
    • View Profile
Re: Curses or custom?
« Reply #5 on: January 22, 2009, 03:48:47 pm »

What if you compel the user to set his terminal size to 100x50?  If the user changes window size, can curses easily take advantage?
I'll have to experiment with that.
Logged

Keiseth

  • Bay Watcher
    • View Profile
Re: Curses or custom?
« Reply #6 on: January 22, 2009, 03:55:26 pm »

Curses varies wildly in irritation, for me. On one hand, getting a terminal to spit letters at the user is fairly easy and enjoyable, but cross-platform support appears to be a real nightmare. I think that's why curses hasn't seen as much use in recent years. I managed to get a terminal in XP to resize vertically (longer) but not horizontally, so far. Not sure why.

Ask Jonathan S. Fox if he's around, he has a lot of experience with Curses from LCS. There's a lot of technowizardry you have to put in place to get it to work on several systems, from what I gathered of the LCS code at a glance.

Me, I greatly prefer SDL / OpenGL, if only because I can make more character tiles if I ever need them, and it's much easier to get all that working on another system too. Infact, I'd prefer Python + Pygame if I had the choice, I've had a lot of fun with those two over the last year. The other bonus is, if you don't mind breaking the Curses feel slightly, you have a lot more freedom with color. One fellow, ages ago on this forum, had an OpenGL roguelike preview, and he managed the most awesome looking lighting effects from fire tiles I have ever seen.

You could also try to seperate the graphical front end as much as possible, and offer both curses and SDL to the user. I believe ToME does this. It's more work, but everyone is happy, I suppose. And you could do curses now and add SDL / OpenGL support later.
Logged

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: Curses or custom?
« Reply #7 on: January 22, 2009, 04:07:33 pm »

Hm, that's true.

And I CAN see a few places where I'd want multicolored tiles...

Well, separating the graphics layer is something I wanted to do anyway, just for good design practices.

I'm worried about relying on SDL for my input stuffs.  I guess I can abstract that away too, but pretty soon, it starts to become a real bear to start up your project.  Hmm.  But I guess there's probably not many crossplatform game libraries besides SDL, are there...

(Oh, and I just remembered SDL wasn't the horrifying one I was stuck using way in the past.  That one was Allegro, and it *WAS* nightmare fuel.)
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

Fenrir

  • Bay Watcher
  • The Monstrous Wolf
    • View Profile
Re: Curses or custom?
« Reply #8 on: January 22, 2009, 04:08:40 pm »

Have you decided on any of the game's details yet?
Logged

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: Curses or custom?
« Reply #9 on: January 22, 2009, 04:12:06 pm »

I've got a clear image of the gameplay and a mostly-good image of its interface.  Halfway between DF and Moonbase, I think.  Uh, leaning a little more towards Moonbase.  With a little smidgen of Afterlife, but that's a secret.

Which means:  Individual units running around, realtime, some emphasis on materials and construction and job tasks... But way more emphasis on infrastructure and interconnecting buildings.  None of Moonbase's stock market garbage though, I always hated those.  Just survival, and ra^H^Hharvesting the planet as hard and fast as possible.  That's another thing, too many games emphasize building long-term sustainable bases.  I guess it'll draw from Outpost 2 as well.

It'll be fun.  Get to play around with my own pathfinding algorithms, and come up with my own ways of handling things like job priorities and displaying elevation.  It's really not going to be that detailed of a game, and I'm really trying to put easy-to-develop gameplay ahead of complex design, here.
« Last Edit: January 22, 2009, 04:38:05 pm by Sowelu »
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Curses or custom?
« Reply #10 on: January 22, 2009, 05:10:48 pm »

I have an opengl based tile system that can theoretically render any size, set up to load DF's 12x8 character set.

Also, it runs fast, ever since I got it to do partial redraws.

It is not set up for complete screen changes(such as a scrolling window), those will drop it to a low FPS(<15 or so?), but for anything else it works.


Edit: also it could be ported to SDL to make it platform independant(I got it ot compile on ubuntu with little hassle, except finding an easy way to open a window)
Logged
Eh?
Eh!

Sowelu

  • Bay Watcher
  • I am offishially a penguin.
    • View Profile
Re: Curses or custom?
« Reply #11 on: January 22, 2009, 05:14:45 pm »

Sounds like SDL it is!  Is your stuff easily accessible online?  Don't jump through too many hoops if it's not, but I'd like to at least see it.  :)
Logged
Some things were made for one thing, for me / that one thing is the sea~
His servers are going to be powered by goat blood and moonlight.
Oh, a biomass/24 hour solar facility. How green!

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Curses or custom?
« Reply #12 on: January 22, 2009, 05:42:57 pm »

http://www.mediafire.com/download.php?tm4nmymqtgm

That one is windows.h and openGL.

There are certainly better ways.

Edit: First thing to do would be gut the sample code, then see about using SDL to load images, so it supports more types.
Logged
Eh?
Eh!

JustOnePixel

  • Bay Watcher
    • View Profile
Re: Curses or custom?
« Reply #13 on: January 23, 2009, 05:01:39 pm »

Libtcod is a pretty good console emulator.  It allows you to do fast true-color ASCII art, is pretty easy to pick up, and it comes with a lot of useful extras, like a Bresenham line algorithm and basic heightmap functionality.  It's not perfect by any means - it's C-native with C++ wrappings, so it's not nearly as object oriented as it could be, and there's also some features that I just haven't used due to frustration.  Still, it's definitely worth a shot.  I'm using it for one of my projects and it's treated me well so far (just be ready to fill in some gaps/shortcomings).

get it at http://thedoryenlibrary.appspot.com/
Logged
Tessie! 'nuf said' McGreevy shouted,
we're not here to mess around!
Boston, you know we love you madly,
hear the crowd roar to your sound!
Don't blame us if we ever doubt ya, you know we couldn't live without ya!
RED SOX!  You are the only, only, only!