Jump to content
  • Advertisement
Sign in to follow this  
Silicon Viking

Roguelike & Curses

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

I'm attempting to create my first game, and it's going to be a roguelike. I intend to use C and the PDCurses library to develop it on a Windows Vista machine. There is sufficent, if a bit scattered, documentation on the Curses library, but little, it seems, directed toward using it for a roguelike. Could someone direct me to a tutorial or something on the subject? [Edited by - Silicon Viking on September 25, 2007 5:57:00 PM]

Share this post


Link to post
Share on other sites
Advertisement
If you want to make a rogue like and it's your first game... then I suggest you try and make it. If you are searching for a tutorial then if you find one you'll tend to just copy their approach. Programming is about finding solutions to problems... How to generate and represent a map? How to generate and represent monsters? What information to associate with objects? As for the mechanics of Curses... a rogue like needs IO and coordinate based output. Do you specifically want to make it console based in any case? You could easily use a library like SDL and make it tile based. Basically I think you should initially not worry about curses and worry about the structure of the game itself and how and why you might want to represent in game objects in a certain way... once you have this at least vaguely in your mind... then think of how to convert a level into an image. Rogue likes are based on tiling... you might draw it in a room centric fashion... or simply have an array representing the tile element to draw at each coordinate... Once the level is drawn you overlay the objects, then characters (as the number of tiles taken be characters/objects is small compared to that taken by level elements). A rogue like is a rare thing in that it has good seperation between game systems. Graphics can be completely decoupled from player IO, AI, sound etc.
Good luck!

Dan

Share this post


Link to post
Share on other sites
Thanks a lot! You've been a big help. Even though a tile based system may be easier, I chose to use C and Curses because I wanted to make my game with the traditional tools. Is that unreasonable?

Anyway, like you said, I'll concern myself with how things will be diplayed later, but I feel I must decide what language to use first because things will be generated/represented in C much differently than the would in C++, would they not?

Share this post


Link to post
Share on other sites
You should have a look here http://roguebasin.roguelikedevelopment.org/index.php?title=Main_Page
it has a lot of useful articles for roguelike development.

Share this post


Link to post
Share on other sites
I happened to come across this post as I was seeking similar information. I figured I might as well help a dude.

Looking at the tome, angband and nethack source codes, basically they used seperate code for every type of display mode, x11, curses, gtk, sdl, whatever. Yuck.

Fine I was going to just use ncurses anyways, but what really bothered me is that they had to use basic getchr for input. Last thing I want to do is code something, give it to a friend to look at and find endless terminal bugs, numlock, capslock, keypad, on top of terminal errors, bad color schemes etc. Screw that mess. I want to use nice, dependable sdl.

So I found an app in gentoo-portage called sdl-terminal, which is essentially a small opengl based terminal (1500 line program) that adds ncurses like functions. I say like, because it is not mature, but the theory is sound. It is pretty simple, nothing anyone couldn't write themselves with a blitting tutorial. I'm busy hacking it as I write this to make it more suitable to my tasks.

Now that I'm using sdl, it opens up a lot of possibilities, without all that much coding being required. Zooming in and out at will (for overworld map), maybe making a small d for a baby dragon and a larger d for an adult and maybe even expanding outside of the normal square size, I have complete control of colours, I can use transparency, I can even replace terrain with actual pictures of terrain, if I want.

In the future I can do even weirder stuff like animating movements from square to square, animating tiles (like water), Displaying multiple items in a single square (a pile). Really it is limitless.

And since the fps of this thing is roughly one per keypress, it won't slow down even if you don't have a beefy graphics card.

http://www.loria.fr/~rougier/index.php?n=Software.Terminal

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!