PDA

View Full Version : What libraries (native or libs with headers) do you use for game development and why?



phibermon
09-10-2010, 07:07 PM
Hi all, I wanted to get some idea of what people are using for their game projects and why they have chosen as such, be it features, ease of use, user base or just simple personal preference.

It seems to me that there are precious few of us working on game orientated projects in pascal.

The learning curve to creating a game is as steep as the learning curve of programming itself, it's compounded by the fact that C/C++ dominates in terms of userbase, public libs, variety and by far the least, tutorials.

This means that unless you have a good understanding of C/C++, there are many tutorials that become of little use to us and many programmers rely on those more familiar with C/C++ to provide headers for libraries, or for those few that set out to write native pascal solutions for the commonly used systems in games.

So I thought it may be useful for those looking for 'frameworks' within which to create their games to see what their options are.

Hopefully we'll discover some commonly used libs and reasons they are good for certain tasks.

Maybe this will encourage people to follow suit and use the more popular libs, increasing the shared knowledge of the community as a whole, allowing more people to provide support (because they use it too) and hopefully making the learning curve that bit much easier for everyone.

phibermon
09-10-2010, 07:36 PM
For my compiler and IDE I use Freepascal (http://www.freepascal.org/) and Lazarus (http://www.lazarus.freepascal.org/) respectively.

I use these because currently, they are the best solution for writing cross-platform code. Something that I wish to do because I use Linux as well as Windows. (there is also the GNU Pascal Compiler that offer as such, but in benchmarks, Freepascal out-performs it in key areas)

I don't use the VCL or create forms in Lazarus, I use it as an IDE for my code and nothing more. It's tight intergration with the Freepascal compiler plus it's code exploring/completion features makes it a good choice for me.

So I create my own windows but I still want to do this in a cross platform way. so I use SDL (http://www.libsdl.org/) along with the JEDI-SDL pascal headers (http://sourceforge.net/projects/jedi-sdl/) which provide me with a way to create Windows in a uniform way that works on the operating systems I want it to, without having to write different code for each OS.

I want to be able to do hardware accelerated 3D as well as 2D so for cross platform, OpenGL is the only option. DirectX and in turn Direct3D are arguably have much better designs and are easier and faster to use (when you know how). So if you're not bothered about Linux or the Mac, that's what I'd have recommend. Although personally because I know OpenGL better, I'll always use it as long as it's still supported.

SDL does a few other nice things for me, it provides sound, mouse/keyboard/joystick input as well as simple texture loading. That coupled with the fact that it supports easy creation of an OpenGL context (what you need to render) it's a big win.

SDLs texture loading doesn't support many formats, so I use the Vampyre Imaging Library (http://imaginglib.sourceforge.net/) for loading my images. it's a native, cross platform delphi/freepascal library that supports many different formats as well as offering various helper functions, image effects and also primative drawing, bitmap blitting etc. These features and the fact it's cross platform make it a no brainer for me.

For loading 3D Models I use my own code. There are a few model loaders out there which offer various features, but none offered all I wanted. I need bone animation, tangent/binormal data for lighting shaders as well stored quaternion data so I didn't have to calculate it after loading. I wrote a blender export script and a hardware skinning model loader for that format. it doesn't support any known model format except my own. I would reccomend using GLscene (http://glscene.sourceforge.net/wikka/HomePage get it from CVS! it's still quite active) or model 3D (somewhere on these forums) both offer 3DS loading (a common 3D format) and milkshape (able to do animation)

For networking I use customized chunks of lnet (http://wiki.lazarus.freepascal.org/lNet) because it offers a non-blocking, cross platform solution. I like to code with threads so for me non-blocking offers better performance for certain things. (I have customized and built a message passing library on top of this) so I'd reccomend lnet but Synapse and Indy are probably a lot easier for beginners with their non-blocking modes.

and that's me for now.

de_jean_7777
09-10-2010, 08:24 PM
I use FPC and Lazarus. For libraries I use OpenGL and OpenAL, as well as Ogg Vorbis for music files. I have my own reader for wave(.wav) files. That's pretty much it. As far as loading images, creating windows, UI and other stuff goes I have written my own code(a lot of code), to depend on as little libraries as possible, though I do use JPEG functionality that comes with FPC (pasjpeg). All headers are included with FPC. My code works on Windows and Linux, though with some lack of functionality under Linux (X11 is a slight pain).

chronozphere
09-10-2010, 10:07 PM
I have used DirectX for a couple of years, but now I'm using OpenGL. This is mainly because I would like to get into cross-platform development. :)

There is much similarity between the libraries I use and the ones mentioned in the two previous posts. Allthough my winning TubeRunner game didn't use SDL, the new version will use a SDL + OpenGL based engine. I think SDL is a beautifull library that just offers the functionality you need at the right level. Because the graphics capabilities are not that great yet, I am using it in conjunction with OpenGL.
For audio I am using OpenAL because, just like OpenGL, it offers those extra features that make it more interesting than say SDL_Mixer. 3D-sound is probably the most important example.

I often use TGA for my textures. There is a snippet floating arround that allows you to easily load TGA's (I believe it is from Jan Horn's site). However, I've decided to use the Vampyre Imaging Lib in order to support more formats and have better portable code.

Fontstudio is the tool I use to create bitmap font's. I don't actually use the program often. I just have some generated TGA's (with extra font meta-data included) floating on my drive. I only fire up the program if I need something special.

I'm still not sure what the best 3d model format is to use. Until now, I often used the DXS format generated by DeleD (a nice modeller written in pascal). But that format is XML based, which is mega-bloated for 3d data. So I would like to switch to something better. I will probably use *.obj until I either find a great format, or develop my own which suits my needs. :)

My sound is usually .wav for sound effects and .ogg for music. I wrote an ogg player with OpenGL (Thanks to Noeska for the tutorial ;) ). This works great. I could also support MP3 streaming with the mpg123 library, but converting all my audio to ogg is just as easy. ;)

I didn't have the time to look into networking. So I'm not sure what to use for that. I did notice some fairly good libraries. If I need it, I'll go and try some.

That's basicly it!

WILL
09-10-2010, 11:19 PM
I use the latest version of Lazarus on Windows currently. I'd love to start with Lazarus on a Mac, but setting it up is still really messy. Hopefully one day rather soon someone will make a nice installer for Lazarus on the Mac.

As for libraries, I really only use JEDI-SDL for the most part. I do make use of OpenAL when I finally get to audio, but I usually leave sound effects and music for last. I take advantage of OpenGL inside the JEDI-SDL package for 3D hardware acceleration. Makes a world of difference in performance. Everything else is all SDL usage such as input controls and window management. I create my own functionality layer and resource management on top of what SDL provides, but that's mostly because I'm a glutton for making most of my games' engines as resource light as I can. And I like to know how most of everything works so coding it myself helps with that. Not always the best way and some of it slows me down in areas, but I'm usually happy with the end results.

arthurprs
10-10-2010, 02:00 AM
The ones i used most were Vampyre imaging (http://imaginglib.sourceforge.net/) and Opengl

azrael11
10-10-2010, 03:21 AM
For windows i use Delphi7 personal so old but so good...
For linux and Mac i use the last snapshot of the Lazarus and Freepascal Compiler....
The libs i use are for windows OpenGL for graphics in my current project and BASS for audio and audio effects but for some projects i develop paraller with the main project i use the Asphyre extreme is so easy and good.
For linux OpenGL and OpenAL.
For Mac OpenGL and OpenAL.

The OpenGL header is the dglOpenGL from the http://www.delphigl.com/

That's it

phibermon
10-10-2010, 10:22 AM
(I think I smell a PGD GL Base code...)

WILL
10-10-2010, 10:49 AM
(I think I smell a PGD GL Base code...)
Maybe, OpenGL is the best for cross-platform development, however DirectX and Windows development is still popular. Many games are made with Asphyre for example.

chronozphere
10-10-2010, 02:28 PM
(I think I smell a PGD GL Base code...)

Interesting. If people feel like building such a base, count me in! ;)

It would also be great if one or more people could write an OpenGL tutorial series covering the basics from rendering cubes to advanced things like shading and post-effects.

Carver413
11-10-2010, 12:45 AM
(I think I smell a PGD GL Base code...)

what did you have in mind. sdl makes it pretty easy to get a basic system up and running. perhaps a new wrapper more geared for opengl that would inialize dglOpenGL in the process.

WILL
11-10-2010, 03:47 AM
I would seriously love something that makes game development on the Mac easier. So if it worked well on a Mac and had helper tools on Mac, I'd play with it as well. Right now I believe the only true cross-platform solution (not just for graphics) is JEDI-SDL with or without OpenGL and/or OpenAL.

dazappa
11-10-2010, 05:08 AM
For pascal game development, I generally stick with Lazarus with SDL and Andorra. SDL is extremely useful for smaller games where there's not as much shiny graphics, and I use Andorra when I want some real power with hardware acceleration and all of the fun stuff that comes with it.

I want to play around with 3d in pascal, but it's really not an option at this point. My main OS is linux these days, and the only 3d pascal engine I know (that works with linux) of is glscene, which is in a pathetic state of disrepair, currently. The only thing I can really get to run is simple model viewing (w/ animation) & particle fx. Any dreams of dynamic shadows or physics can immediately be shot down because they're delphi only.

chronozphere
11-10-2010, 06:56 AM
Interesting. Seems like almost everyone here is using OpenGL with SDL. :)

There are still a number of game libraries for pascal: Asphyre, Andorra, GLScene, DelphiX, HGE, Irrlicht port etc.. But most of us don't use any of those. Instead we write our own frameworks/wrappers or just write native OpenGL/SDL.

Why is it that we don't use the existing libraries alot?

For me, it's simple. During the past few years I learned how to properly use a graphics API. I really want to use that knowledge by making my own engine.

Also, it seems to me like there is a lot of overlap between the libraries, functionality wise. Most of them are aimed at windows and 2D games (DelphiX, Andorra, HGE, Correct me if I'm wrong). So my question is:

Is there still a big unfilled gap? Is it worth it to develop another library that just does things a little different and supports different platforms?

I'm working on a simple engine based on OpenGL+SDL. If it turns out that it could fill the gap, We might aswell get together and merge our codebases to make a fresh engine that does the things we want it to do. :)

Just a thought.

Andru
11-10-2010, 07:41 AM
Interesting. Seems like almost everyone here is using OpenGL with SDL.
I don't like this ugly(inside) and bad library(at least for Linux). Why? Because it use bad method to start in fullscreen under Linux(block input, so if your game will crash... only restart X or Reset will helps you. Also there is no Alt-Tab support). So I wrote my own crossplatfrom library :) The only problem for now - I didn't make joystick support under MacOS X.

User137
11-10-2010, 11:16 AM
(I think I smell a PGD GL Base code...)
I would do my best to integrate most of my tools and units to work with it. Such as the UI Editor and nx drawing and math classes.

So... I have actually no experience on SDL at all. I ended up to OpenGL with dglOpenGL header. Self-made wrapper called Next3D to simplify it great deal. Other than that, i have some basics in use from Synapse network lib.

Using Lazarus IDE fully. All programs are built on the form, so that i don't have to care about underlying operating system messages. It is much faster to make programs with form events and it doesn't come with efficiency loss.