Temple of The Roguelike Forums
Development => Programming => Topic started by: fecal_brunch on June 20, 2008, 10:23:12 AM
-
Hey there. I'm planning on writing my first roguelike soon, and was reading up on ncurses - I understand this is the library to use... Anyway, I noticed it has a bool data type built in, does this create a conflict with the c++ boolean type?
-
No idea, I have never used ncurses, shouldn't be much of an issue though, as I assume they would both be ints at heart.
Another valid option instead of ncurses is the more modern SDL library, which is what the other half of C++ developers use (if they dont support both that is). Try to write you code so it separates the actual screen output from your core classes. SDL is generally used to emulate ascii and therefore can be quickly adapted to use gfx.
Good luck.
-
Ah, I really want to use the terminal, I hate text emulation... I was planning on building a non graphical frontend and keeping the ui including input completely seperate so that perhaps one day I could make a fully graphical interface with mouse support and stuff using SDL.
I think I'll use ncurses for now, I thought that perhaps "bool" was a restricted term and would cause a conflict. I guess I should just try it out instead of talking about it! Hah. If it doesn't work I guess I could just edit it out of the library...
-
I thought ncurses was Unix only? There's an alternative, pdcurses, which you might want to look into!
Personally, if I ever do get to program a roguelike, I'm probably going to opt for text simulation because I want to be able to incorporate mouse-overs and menus and stuff... I know it's not really necessary for a very traditional roguelike, but it might help.
Have you never felt that mousing-over a monster could give you some decent statistics? Rather than, say, pressing x, using the arrow keys or jumping over to the creature you want to see, then pressing enter, and esc, and so forth for every creature you want information about?
-
ncurses is supported on multiple platforms, including DOS (Try DJGPP) and Cygwin... Windows is a... Let's just say it rhymes with Mitch... when it comes to curses - PDCurses doesn't have complete functionality, but you can always opt for Cygwin.
ncurses also supports mouse functions, at least, as far as I've read. Not sure how far I would go down that route though.
-
Why bother with text at all if you're going to use SDL? You'd be better off having a full tileset. I plan on leaving it open ended so I can incorporate mouse stuff in some kind of more accessable graphical mode (if I get around to doing SDL)... But I still want a traditional text mode.
I'm pretty sure ncurses does have mouse support, but usually when I play roguelikes I'm not wanting to take my hands away from the keyboard.
-
I second your hate for text emulation... Either use real text (with Curses) or real graphics (with SDL). The best is to have both as options.
In case if there is a problem with bool, you could try this instead of modifying ncurses: (disclaimer: I have not tried it, that's just an idea)
#define bool ncurses_bool
#include <ncurses.h>
#undef bool
-
That is such an obvious idea I can't believe I didn't think of it, hah. I'll see how it goes. Thanks.
Still working out how the backend is going to work.