Coding and Game engines. Which are best for me?

24 replies [Last post]
Joined: 12/29/2008

Ok, so I would like to create a 2D game. I'm not giving much specifications because this project may never see the light of day. So what I am looking for:
Tools to create a physics-based kind of platformer-ish game with liquid simulation (kind of in the style of OE cake).
I'm addressing my self to those more experienced in languages like C++ and know which libraries are best for what. Thanks in advance!

Check out my SoundCloud, MomoSoundWaves

Joined: 12/23/2010

Question: are you asking for a C++ library, or for a language that you should use? That is, have you already learnt a coding language or not? I'm not exactly getting what you're looking for.

Joined: 08/06/2010

If you're using C++, I really like SDL. Graphics, sound, collision detections, transparency, soundmixing...on any system you want.

Another Planet finally has an official release! Download chapters 1 through 3 here! Thank you for waiting so long while I kept starting over.

Joined: 09/01/2009

Heyo!
Physics, once you start delving deep into fluid simulations and stuff, gets obscenely complex quite fast. Sometimes you can use stuff like Nvidia's PhysX for fluid simulation, I think they have a library for that in there someplace. Of course, it's not a simple, plug-and-play sort of thing. It's kinda a shame, because if every game had as awesome physics as Vessel, for example, we'd have a lot of flipping awesome games out there.

Back when I was looking at fluid simulations, I didn't see the OE Cake example, so good find. I think that looks like it's an open-source program, you may want to look into the source if you're interested. The physics for that look sweet from the demo screenshot. EDIT: Maybe it isn't open source; never mind.

If you're looking into 2D physics, I personally like Box2D, because it's relatively simple and has a lot of really cool features. Of course, you could do what 2DBoy did and hack a 2D version of ODE, but that may be above your programming level. It's probably above mine. Tongue

For graphics and rendering, I'm personally using an OpenGL wrapper (OpenGL can be a bit complex, so a wrapper is nice) called HGE, but I've heard good things about SFML also. I'm using SDL_Mixer for sound, and I'm probably going to switch to OpenAL soon just for functionality. There are a lot of good engines out there for just about anything, though, but some of them may be overly complex to set up and use, depending on what you want.

Probably the hardest part of a fluid simulation is actually rendering it out to the screen, to be honest, since you have to take a bunch of voxels for each fluid particle and render close ones as a single blob rather than a bunch of individual images. It is possible, it just requires some knowledge of how your rendering engine works, and a pretty powerful renderer to boot. I doubt you could do something like that with something like SDL or Win32 libraries.

Fluid dynamics is a pretty complex field; my roommate here in university took it just this last year, and he's in his fourth year of Mechanical Engineering. It was a pretty challenging course for him, also. I wish there were some sort of library for doing this kind of thing, since it's really cool and would look awesome if it were in more games, but so far I haven't found anything.

After looking in more detail at this application, it looks like it'd be pretty tricky to make into a game. Everything is voxel-based, so it'd probably be a bit of work to add simple rectangles, circles, and other objects to it. It's also programmed in Octave, which is "a high-level interpreted language, primarily intended for numerical computations." That should tell you how complex this stuff is, since it's coded in a strictly math-based programming language! But it does look really cool. I really know nothing about programming this sort of thing, I'm afraid.

A while back, we had a discussion about how to code simple fluid examples; stuff that's about as complex as World of Goo's fluid simulations. I can link you to the topic if you want, but it's probably not at all what you're looking for.

EDIT: And whoa, while I was walloftext'ing, looks like you got two responses already.

Joined: 02/20/2011

tl;dr Tongue
i mostly skimmed trough it, as it is aimed towards momo.

-_-

Joined: 07/08/2011

Are you just starting in C++? Because if that's true, I'd suggest learning simple C++ tutorials first until you really understand what classes are, how functions work, and all of the different variable types.

Once you know that, you can learn SDL from this guy: http://lazyfoo.net/SDL_tutorials/index.php
He teaches you to use SDL and gives complete instructions on how to get the libraries up and running for whatever IDE you use. (by the way, I suggest you use Code::Blocks)

If you want a copy of my project file for Code::Blocks that already has all the Windows libraries set up and compiled, you can find it here. It has everything set up for the following libraries:
SDL (graphics/sound handling)
SDL_image (better graphics handling)
SDL_mixer (better sound handling)
Box2D (2D physics)
TinyXml (read/write XML files)

The first three are used in Lazy Foo's tutorials, if you want to look at those. They are really easy to follow, and I suggest taking a look.

Joined: 12/29/2008

Thanks for all the quick replies! So I'll go for C++ with SDL, but I still have the issue of Fluid dynamics which would be a big part of the game. For info, I played around with the basic C++ stuff but I never really got how a game could be made with it. If I can get SDL to work, hopefully I will work my way through.

Check out my SoundCloud, MomoSoundWaves

Joined: 07/08/2011

Like I said, you can just use my project file (link above) and it'll be all set already for you to use.

You still have to #include and everything on your own, however. I made it so there would be a blank main.cpp for you open and ready.

Joined: 12/29/2008

Okay, what do you guys think about this?
http://www.rowlhouse.co.uk/water/index.html

Check out my SoundCloud, MomoSoundWaves

Joined: 07/08/2011

You can more or less do that with Box2D. I mean you can make lots of bodies and have them all the same gravity, all very small, and it'd be similar to physical water.

Joined: 07/08/2011

You can also try out yoyogames.com and use their Game Maker engine. It's gotten pretty powerful, but if you want to be serious you should use something like C++, which happens to be the industry standard.

Joined: 02/20/2011

is that yours? it is very good. fun to use up about 10 minutes.

-_-

Joined: 07/08/2011

Whom/what are you referring to?

Joined: 02/20/2011

wait, did momo make the Water thing? if he didn't then Nev mind.

-_-

Joined: 07/08/2011

lol, no he was referring to it as the kind of thing he wanted to achieve.

Joined: 09/01/2009

Yeah, you can't just make a zillion boxes in Box2D and make a water simulation that way. It'd take up way too much CPU and wouldn't look so good. But both ones you've linked to so far look pretty good; question is how good they'd work and how easy they'd be to implement. I have no idea what jiglib is; looks kinda outdated, but may work fine. Good luck, anyhow!

Joined: 12/29/2008

Okay, so I have to learn C++ then Integrate SDL and Box 2D into the engine. Does that seem like a plan?

Check out my SoundCloud, MomoSoundWaves

Joined: 09/01/2009

If you'd like. I personally think that SDL is a good place to start, but once you've got the rest of your code working, add in some OpenGL-based engine (Or use OpenGL itself- there's some SDL+OpenGL tutorials out there too) for rendering. It's pretty essential to have hardware acceleration, imo.

Joined: 12/29/2008

I couldn't even get SDL to work in code::blocks :s

Check out my SoundCloud, MomoSoundWaves

Joined: 07/08/2011

Yeah, momo, use my template file. It already has everything included, so you don't need to do anything special.

Basically:
1. Install Code::Blocks
2. Download Template Project (link above)
3. Run "Engine.cbp"
4. Code yourself into oblivion (it's ready at the point at which you can just start with #include <SDL/SDL.h> and it'd work fine.

Joined: 09/01/2009

Can't you just File->New Project and choose "SDL project" and have it do all the compiler/linker setup work for you? Ehh, anyhow, whatever works.

For the record, SDL and standard libraries like it are a lot easier to set up to compile in Linux. Just sudo apt-get install [library]-dev and you're good to go. But in Windows it ain't too bad, either. Just download the SDK (ie header and library files) and copy them to mingw's include directory. If you can't figure it all out, you can always post here with the exact problem(Drunk you're having and we'll do our best to help. I've used SDL and Code::Blocks a lot, so I may have some kind of idea how to fix common problems. Smile I imagine Red can help too.

Of course, the easiest thing to do is to use Red's pre-set up project, but imo it's good practice to know how to link in different libraries.

Joined: 07/08/2011

"SDL Project" in Code::Blocks didn't work for me. It's apparently broken for Windows.

Joined: 12/29/2008

I'll try that... sometime, I'll wait till I have some free time.

Check out my SoundCloud, MomoSoundWaves

Joined: 09/01/2009

Weird. It works fine for me. I just used it the other day... Maybe I did something special to point Code::Blocks to my SDL installation a long time ago, and now I just don't remember. Tongue

Joined: 07/08/2011

Ah that was it. Code::Blocks did not have a beginner tutorial on linking in SDL.

I never made the connection. Tongue