Jump to content
  • Advertisement
Sign in to follow this  
Neurosecond

Help: Starting from scratch into 2D and then 3D (Which c++ libraries?)

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

I know these topics have been done to death, but I haven't found a specific answer to my question.

I'm looking to start developing games as a hobbyist, and plan on using c++ to do so. My plan is to learn by making 2d game and later a 3D one, lets say by creating a simple 2D game, and then replacing the graphics (much later) with 3D ones. I'm having trouble deciding whether I should just go straight and learn Directx (which seems over complicated for a 2d game), or to take an intermediate step with something like SDL.

At the end of the learning process I don't think I will be using SDL, so will it be more efficient to go with Directx first?

Share this post


Link to post
Share on other sites
Advertisement
I'm no expert (I just started learning a few months ago), but I'm pretty sure some people would suggest SFML.

You CAN use Directx, but like you said it might be too over complicated.

Share this post


Link to post
Share on other sites
If you want to start a bit in a higher level fashion and understand the logic behind all first, you could also use the hge game engine, which is a free one, based on DirectX and which automates some stuff: http://hge.relishgames.com/. If not, then SFML as suggested before me is a good way to go as it is object oriented, so easier to use in C++ as opposed to SDL. It really depends on what you want to do, games or games technology. If you just want to make games, there are a lot of free engines and libraries that will do a lot of low level stuff for you. Doing both is a nice dream but won't get you anywhere in the short to mid term as it is a long process. I wanted to do the same and then I decided to skip the low level stuff and just make games.

Share this post


Link to post
Share on other sites
I started with SDL as the lazyfoo tutorials were fantastic, also it can be used with OpenGL for heigh performance rendering and 3D. It also has sound and font libraries. This is where I recommend to start but that's my opinion, there are lots of people who go down the SDML path because of its hardware accelerated graphics without openGL.

Share this post


Link to post
Share on other sites
If you have no experience you really should start with a higher level language like C#. Especially when your aiming to do this as a hobby. Knowing multiple languages would never hurt you and starting with the hardest will. Also with higher level languages you are able to make more in less time. Why would you want to learn directX or openGL if there are plenty libraries for it that will make your life a lot easier? Make a game man! Not an engine! Eventually you might get interested to go more "behind the scene" and by then the harder stuff will be a lot easier to learn since you know what your doing. If you really want to go C++ then yes go get some sort of library like SDL and worry later about directX.

Share this post


Link to post
Share on other sites
Personally I started with text-based games to help me better understand C++ and games programming in general.

Then I learned some DarkBasic to help me quickly iterate some games ideas and processes, but I wouldn't advise using DB, it's awful.

Eventually, I moved to SDL but quickly learned one thing... SDL is SLOW!!! The only way to get things rendering fast using SDL is to learn to combine SDL and OpenGL and since I was trying to make everything cross-platform I was loading everything in via SDL and converting it over to an OpenGL-ready format. This was just convoluted as hell, so I dropped SDL all-together.

Currently I use OpenGL with GLUT. This allows me to create 2d and 3d games quite easily. These do, however, not provide everything on their own but it's enough to get your project started and the game logic prototype done. Then you can start adding other libraries such as physics, sound and networking libraries as well as libraries to load in different types of media.

If you're interested in doing cross-platform non-commercial games then I can't recommend Java enough. A lot of people say, "Well it's not what games developers use" but that just isn't true. While most AAA games are written in C++ that is not to say that Java can't do any game you'd like to create as well as C++ can! Also, Java is, in my experience, a LOT easier to learn.

And you can avoid having to send your game with redistributable packages as apparently there are already 3 billion devices with Java installed.

Then, of course, there's the fact that Java can run on almost any modern computing device invented and can even be embedded into a web-page.

Share this post


Link to post
Share on other sites
I strongly recommend using C# with XNA instead of C++ with DirectX. I've done hobby games in both and between the two, XNA and C# is much more friendly. Considering that you're new, I'd recommend C# because the code is managed and a lot of the boiler plate coding is already done for you. DirectX/C++ would be a reasonable choice if you're planning to create a game engine and you need the low level granular control. But you want to make games, not focus on game engine semantics. You want to start with a 2D sprite based game, so the XNA Spritebatch is going to be your best friend. Switching to 3D models wouldn't take more than a day to code, you just have to create a camera, use view, projection and world matricies, and think about lighting and shaders.

Share this post


Link to post
Share on other sites
Note that even when you're doing 3D with DirectX, you can still use SDL (yes - SDL can be made to work with both OpenGL and Direct3D), and this simplifies things like setting up windows, as well as providing APIs for sound, networking etc (of course you can do it all in DirectX, but arguably SDL makes these things simpler, and cross-platform).

So you could use SDL 2D to start with, then switch over to SDL + DirectX. Although if you plan to modify the same game to switch from 2D to 3D, it may be easier to start off with SDL + DirectX. (I upgraded a game this way - switching to 3D can be pretty much done to start with just by changing the view transformations, then worry about things like 3D models later; replacing SDL's graphics commands with DirectX would require a significant rewrite just to get things working.)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!