Author Topic: C Libraries  (Read 10183 times)

Pueo

  • Rogueliker
  • ***
  • Posts: 263
  • Karma: +0/-0
    • View Profile
    • Email
C Libraries
« on: November 23, 2011, 05:15:39 PM »
Hi, I'm currently working on a new rogue-like, and I just wanted a quick point in the direction of the Libraries I should use.  I'm going to write in C.

Thanks
{O.o}
 |)__)
   ” ”   o RLY?

Pueo

  • Rogueliker
  • ***
  • Posts: 263
  • Karma: +0/-0
    • View Profile
    • Email
Re: C Libraries
« Reply #1 on: November 23, 2011, 09:42:56 PM »
Erm.. another (unrelated) question: Does the size of the window matter? Is it possible to make it resizable?  If not, what is the preferred size?
{O.o}
 |)__)
   ” ”   o RLY?

XLambda

  • Rogueliker
  • ***
  • Posts: 208
  • Karma: +0/-0
    • MSN Messenger - tau_iota@live.de
    • View Profile
    • The Weird Rogue
Re: C Libraries
« Reply #2 on: November 23, 2011, 10:58:07 PM »
1) the classic choice would be ncurses (or an equivalent library), but if you don't like doing low-level stuff. libtcod.

2) I think 80x25 or 80x24 are the most common formats.

dephbokks

  • Newcomer
  • Posts: 37
  • Karma: +0/-0
    • View Profile
Re: C Libraries
« Reply #3 on: November 23, 2011, 11:23:30 PM »
Hi. You could use libtcod.

It has bindings for c as well as many other languages. Is there any particular reason you wish to use c? I ask because there are more modern languages out there that may allow for more efficient use of time; although some c programmers are bad-asses that can program the hell out of things. Personally I use c++ or python and I wrote my own c++ library that I use and am continually modifying and updating.

You could also use curses.

So I think curses or libtcod would be the top recommendations for c.

Size of window: usually 640x480, 800x600, or 1024x768. Some rl's allow for resizing; I think DCSS allows for this (I usually play on the akrasiac server so I'm not sure). It is good to allow the user to run the game in fullscreen mode too. I think 800x600 is good with the ability to run in fullscreen; that is what I did for my game.

edit: oops too slow in typing....

corremn

  • Rogueliker
  • ***
  • Posts: 700
  • Karma: +0/-0
  • SewerJack Extraordinaire
    • View Profile
    • Demise RogueLike Games
Re: C Libraries
« Reply #4 on: November 23, 2011, 11:31:57 PM »
While typing this dephbokks beat me to the punch....

ncurses, libtcod and SDL. Libtcod is a roguelike library so it is probably your best bet.

Preferred size is really only relevant if you are going to use a terminal application (linux terminal, dos), i.e using ncurses lib.  A lot of old-school players prefer terminal roguelike, most don't care but some (vocal ones) do.

If you are going to use "terminal emulation" I.e. using SDL or OpenGL (not sure what libtcod does) then you can make your window any size you like. Probably best to stick to monitor resolutions i.e 640x480, 800x600 etc that way it is easy to make a full-screen mode.  Re-sizable windows on-the-fly is probably not needed although it can be cool if done right.




corremn's Roguelikes. To admit defeat is to blaspheme against the Emperor.  Warhammer 40000 the Roguelike

Pueo

  • Rogueliker
  • ***
  • Posts: 263
  • Karma: +0/-0
    • View Profile
    • Email
Re: C Libraries
« Reply #5 on: November 24, 2011, 05:49:39 AM »
1) the classic choice would be ncurses (or an equivalent library), but if you don't like doing low-level stuff. libtcod.

Thanks.

It has bindings for c as well as many other languages. Is there any particular reason you wish to use c? I ask because there are more modern languages out there that may allow for more efficient use of time; although some c programmers are bad-asses that can program the hell out of things. Personally I use c++ or python and I wrote my own c++ library that I use and am continually modifying and updating.

My line of thinking in using C was, "Well, if all those 20 year old rogue-likes can make such a  mayonnaise game in C, then why not me?

Size of window: usually 640x480, 800x600, or 1024x768. Some rl's allow for resizing; I think DCSS allows for this (I usually play on the akrasiac server so I'm not sure). It is good to allow the user to run the game in fullscreen mode too. I think 800x600 is good with the ability to run in fullscreen; that is what I did for my game.

Ok, thanks. I think I'll go with several preset resolutions, and maybe a fullscreen mode, if I can figure out how.

If you are going to use "terminal emulation" I.e. using SDL or OpenGL (not sure what libtcod does) then you can make your window any size you like. Probably best to stick to monitor resolutions i.e 640x480, 800x600 etc that way it is easy to make a full-screen mode.  Re-sizable windows on-the-fly is probably not needed although it can be cool if done right.

Yes, I was going to use terminal emulation, so thanks for the input  :)


Also, (stupid question ahead) to use libtcod, I'm supposed to #include the .h file I want to use, right? 
If yes, where do I have to place the .h files to use them correctly? (I'm on Mac Lion)
If no, how do I use libtcod?
« Last Edit: November 24, 2011, 07:18:56 PM by Pueo »
{O.o}
 |)__)
   ” ”   o RLY?

corremn

  • Rogueliker
  • ***
  • Posts: 700
  • Karma: +0/-0
  • SewerJack Extraordinaire
    • View Profile
    • Demise RogueLike Games
Re: C Libraries
« Reply #6 on: November 24, 2011, 11:40:21 PM »
Hmm, check your compiler settings, and set the "include" setting to include the directory (folder, do the still call them folders on MacOS?) where you have placed the libtcod files.  Dont move the header files, point the compiler at them instead.

Surely there is a tutorial for beginners somewhere?

And please tell me you can program in C, for it is a bitch of a language.
« Last Edit: November 24, 2011, 11:41:54 PM by corremn »
corremn's Roguelikes. To admit defeat is to blaspheme against the Emperor.  Warhammer 40000 the Roguelike