Sign in to follow this  

the best choice...

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

Ok, here it goes... I need some tips on which libraries to use in order to implement my new game idea I have in mind. I don't want to reinvent the wheel, so I want to cover as much as can be done, so I can focus on the game. The game's targeted platforms are Windows and Linux. It will be using 2D graphics, but I need to draw textured triangles. I don't know if any 2D gfx lib has that feature, so I may have to use 3D graphics. OpenGL? I will use FMod for sound/music and Raknet for networking. These are the other sections I need covered: Graphics - ? Input - ? Timer handling - ? Truetype fonts - ? File compression (zip, etc) - ? File handling (cfg, txt, binary) - ? Any ideas? EDIT: Changed the project specs a bit. [Edited by - daeron on August 17, 2004 11:01:42 AM]

Share this post


Link to post
Share on other sites
Well here's a couple of things you could use.

SDL:
You can use this for Input, Networking (with SDL_Net) and also for setting up an OpenGL window without needing any platform specific code. It does include timer stuff so you may be able to use it for timing as well.

FreeType:
This is a library for rendering truetype fonts and it's pretty easy to use (IMO) though you may find the documentation lacking.

For file handling what exactly do you want to do? The standard libraries of many languages include file IO routines, so anything you write using them will be cross-platform. If you want something more high-level you'll need to be more specific about your requirements.

Oh and if your aim is to make a game why not use a prexisting engine rather than creating your own? This means you can concentrate on the game rather than the technology.

Share this post


Link to post
Share on other sites
Allegro is popular with beginner programmers. I haven't used it myself, but I've seen it recommended by several people and is discussed in books.

SDL is a good choice as it can handle a lot of the stuff you're looking at (Network (SDL_Net), Timers, Input).

If you're wanting to make a GUI in OpenGL, you can use HellRizzer's GUI tutorial to make your own, or just download and implement the code in your own way. It's not complete, but it's getting there.

There's also TinyXml, which could be used for handling Xml as your content/config files.

As for Zip handling, look for zlib or the numerous wrappers available (for example, STL-like wrapper on CodeProject.

EDIT:

Being that you've changed the specs, look at OGRE, or Irrlicht for 3d rendering. SDL will let you use OpenGL calls too, so you can still use OGL with SDL. I'm not sure about Allegro, but the library itself has extensive graphics routines, but AFAIK there's mainly 2D.

Share this post


Link to post
Share on other sites
Quote:

For file handling what exactly do you want to do? The standard libraries of many languages include file IO routines, so anything you write using them will be cross-platform. If you want something more high-level you'll need to be more specific about your requirements.


I need config files (.cfg .ini) so I can save user settings about the game.

I need binary files so I can save/load created maps.
(Something about endianess makes this non-platform in some cases? Which libraries are known to be cross-platform about this?)

Quote:

Oh and if your aim is to make a game why not use a prexisting engine rather than creating your own? This means you can concentrate on the game rather than the technology.


What engines are available then? Sometimes engines are too specific when comparing to the requirements I have. And some parts of the engine I won't simply use at all, I want to strip it bare to the bones. But if you have some that are good and free then I might reconsider.

Is SDL capable of drawing textured triangles or do I have to use a 3D graphics API/lib?

Share this post


Link to post
Share on other sites
Quote:
Original post by daeron
Is SDL capable of drawing textured triangles or do I have to use a 3D graphics API/lib?


You can use OpenGL calls from within SDL, so you're not limited in any way as to what you can render.

Share this post


Link to post
Share on other sites
Now it's getting interesting =)

What I have decided:

Graphics - OpenGL
Sound/Music - FMod
Input - SDL
Network - Raknet
Timers - SDL
Truetype fonts - FreeType

Undecided:

File compression - ZLib?

What I essentially need is a way to store my .bmp, .wav and .tga files in one big file (similar to allegro's .dat, and other formats like .pak) so the user doesn't have access to them. Is this possible with the .zip format and ZLib??

File handling -

Ok, instead of config files, xml files looks like a good choice. So, TinyXml it is then.

But what about binary files? Simply using fstream makes it non-cross-platform I've heard, because of the endianess (don't know what it is though heh)

Share this post


Link to post
Share on other sites
If you want to use data files, check you zziplib, it allows you to use files in zip archives as is they were regular files. There's also physfs with creates a Quake-style system where you can place your data is several files and you can access it all as if they were in one directory.

I have also written a library myself that uses a custom file format with built-in (weak) encryption and LZMA compression. I'm still testing it, but it should be capable of general usage.

Share this post


Link to post
Share on other sites
Hardware via OpenGL, software on its own. The OP doesn't sound like he needs a lot of power, so Allegro's 3D may be enough. I've seen some pretty impressive stuff done with it (nothing like what can be done with OpenGL though, of course [smile]).

But sounds like he's made up his mind anyway ...

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:

But sounds like he's made up his mind anyway ...


Not entirely. If textured triangles are supported by the library and the drawback in speed ain't too great, I will certainly consider that option. I've some knowledge in Allegro, and it would be stupid to learn other libraries (which takes lots of time and testing) when I have it all in a complete package.

Is there a signifant drawback using Allegro's routiens than OpenGL? I guess I won't be doing so extremely advanced stuff afterall...
Do you know any projects I could look at using Allegro's polygon rendering?

Alternative configuration:

Sound/Music - FMOD
Network - Raknet
Graphics/Input/Timers/config/.dat/ - Allegro
Truetype fonts - AllegroFont

I kinda like that =)

Share this post


Link to post
Share on other sites
Aaagh... forgot to login. Above post was mine (as you probably already guessed).

One thing that is important is the fact that the Allegro community is indeed big and very helpful. I haven't found an equivalent such as Allegro.cc anywhere concerning SDL. So...

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
Is there a signifant drawback using Allegro's routiens than OpenGL? I guess I won't be doing so extremely advanced stuff afterall...
Do you know any projects I could look at using Allegro's polygon rendering?

Well, there's this project, which was impressive when I played it, but the link seems broken now. [sad] Screenshots are still there though ...

Share this post


Link to post
Share on other sites
If you're going to be using OpenGL, you might want to consider using GLFW, which is a free, open source, portable framework for OpenGL application development.

Basically, it handles operating system specific tasks, such as opening an OpenGL window and reading keyboard, mouse and joystick input in Windows, Unix, Mac OS X, AmigaOS and/or DOS.

Share this post


Link to post
Share on other sites
Quote:
Original post by 23yrold3yrold
Hardware via OpenGL, software on its own. The OP doesn't sound like he needs a lot of power, so Allegro's 3D may be enough. I've seen some pretty impressive stuff done with it (nothing like what can be done with OpenGL though, of course [smile]).

But sounds like he's made up his mind anyway ...


Why not add AllegroGL into the mix?

Share this post


Link to post
Share on other sites

This topic is 4865 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this