SDL or Allegro: Difficult decision

This is a discussion on SDL or Allegro: Difficult decision within the C Programming forums, part of the General Programming Boards category; I've been having some debates with myself about whether to go with SDL, which I'm sure a lot of you ...

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    67

    SDL or Allegro: Difficult decision

    I've been having some debates with myself about whether to go with SDL, which I'm sure a lot of you know of, or Allegro, a gaming library. ( http://alleg.sf.net ) They look pretty much the same to me, just a different style and I'm trying to find out what would be best for engineering a 2D RPG.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,453
    > I'm trying to find out what would be best for engineering a 2D RPG.
    Since they're both capable from a technical point of view, you have to go with some other kind of choice. Like your past experience and where you see yourself wanting to be.

    Would you view SDL as a stepping stone to OpenGL?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    67
    Well, I am trying to steer clear from DirectX as it is Windows-only and I seek cross production. SDL and Allegro both simplify OpenGL to some extent, though I'm hoping to hard code the game's resources such as images and sounds into the binary to hide them from end-users to avoid alteration.

  4. #4
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    > SDL and Allegro both simplify OpenGL to some extent
    SDL does not... and really has very little to do with OpenGL

    > I'm hoping to hard code the game's resources such as images and sounds into the binary to hide them from end-users to avoid alteration.
    Impossible to avoid alteration, and that's a silly idea. Big game companies stopped doing that long ago for a good reason.

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    67
    Quote Originally Posted by zacs7 View Post
    Impossible to avoid alteration, and that's a silly idea. Big game companies stopped doing that long ago for a good reason.
    Well, they do usually have the game data in some format that's not usually readable by the average Joe...

  6. #6
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,461
    Quote Originally Posted by Chris87
    Well, they do usually have the game data in some format that's not usually readable by the average Joe...
    I have anecdotal evidence that some of them now use more human readable formats like XML documents (which, admittedly, are not readable by the average Joe, but tend to be readable even by the average computer game playing Jane).
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  7. #7
    Registered User
    Join Date
    Dec 2007
    Posts
    67
    Well, take Blizzard for example. Their game data is in the Mopaq archive format, a format exclusive to Blizzard products. Also, I think Half Life 2 has it's own format. I saw no image/sound files laying out in accessible folders for it, but instead large binary documents that were above 1 gigabyte in size.

  8. #8
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,167
    Just change all the file extensions to .dat.

    Or, if you really want to do it, apply simple XOR encryption or something. Then the average computer game playing Jane won't be able to read it, but of course the average programmer John will be able to.

  9. #9
    Registered User
    Join Date
    Dec 2007
    Posts
    67
    Good strategy, thanks!

  10. #10
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,461
    I do not have many examples as I tend to play browser based online games, but one PC game that I do have in my possession, Civilization IV, has its sound files in MP3 and WAV format easily found in an Assets subdirectory. Its movies are in some strange format provided by a third party, but a free converter for that format by that third party is nonetheless available online.

    The custom formats that you speak of could well be optimisation or even just development strategies.
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  11. #11
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    > Also, I think Half Life 2 has it's own format.
    Nope, they just use steams "gcf" system. And there is already a program to unpack and repack them... and it was out well before HL2, so it just goes to show they don't care.

    Perhaps a better way is to perform checksums on the data instead...

  12. #12
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Chris87 View Post
    SDL and Allegro both simplify OpenGL to some extent,
    I'm learning OpenGL now and I can't imagine there's any point in "simplifying it". I don't play games (much) so I don't notice these things, but it seems to have routines for interfacing with devices like joysticks. But you probably need SDL to integrate sound.

    Even if the game is a 2D RPG like Dune (am I dating myself?) or Warcraft, you may want to go with 3D modelling anyway (do "they"? could be...) and certainly working with 3D objects on a "2D" surface is a little simplification.

    OpenGL seems nicely designed to me but I haven't gotten that far into it.

    ps. Isn't the whole Half Life engine open-source?
    pps. your fears about user alteration would seem silly even if you owned the company
    Last edited by MK27; 01-04-2009 at 07:20 AM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  13. #13
    Ex scientia vera
    Join Date
    Sep 2007
    Posts
    478
    Quote Originally Posted by Chris87 View Post
    Well, take Blizzard for example. Their game data is in the Mopaq archive format, a format exclusive to Blizzard products. Also, I think Half Life 2 has it's own format. I saw no image/sound files laying out in accessible folders for it, but instead large binary documents that were above 1 gigabyte in size.
    Take a look at Mangos, it's an emulator that is capable of running privat wow servers. They provide tools that can unpack blizzard's files.

    However, clientside manipulation is often of no real concern. If the game designers aren't idiots, they will have made it so that almost nothing can be changed from the clientside. All information for World of Warcraft is stored client side. Even if you would change your HP on your client, you would still die according to the server.

    On top of that, spending too many resources to create complex file formats when they will be cracked eventually, is pointless. To use some method of compressing many files into one, you will need some kind of a header that contains information about it. Anyone with a few nights off a month and decent experience in the field will be able to decipher what the first few bytes say about the rest, etc.
    "What's up, Doc?"
    "'Up' is a relative concept. It has no intrinsic value."

  14. #14
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    21,461
    Quote Originally Posted by IceDane
    All information for World of Warcraft is stored client side.
    That is probably a typographical error where "client side" should be read as "server side" (though it may be true that much of the information is sent to the client so...)
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  15. #15
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    > ps. Isn't the whole Half Life engine open-source?
    Goodness no. Quake 1-3 are, but certainly not the Half-Life engine... and it never, ever will be.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Allegro And SDL
    By 7EVEN in forum Game Programming
    Replies: 5
    Last Post: 08-10-2005, 10:22 AM
  2. SDL or Allegro
    By fungus_mungus in forum Game Programming
    Replies: 7
    Last Post: 04-02-2005, 12:18 PM
  3. Crossplatform Sound Library -- other than SDL and Allegro
    By frenchfry164 in forum Game Programming
    Replies: 4
    Last Post: 10-14-2003, 04:27 PM
  4. Allegro or SDL?
    By napkin111 in forum Game Programming
    Replies: 11
    Last Post: 11-01-2002, 06:08 PM
  5. Special Allegro Information
    By TechWins in forum Game Programming
    Replies: 12
    Last Post: 08-20-2002, 11:35 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21