Advertisement

2D vs 3D

Started by March 16, 2015 09:27 PM
11 comments, last by Nypyren 9 years, 9 months ago

Hello everyone,

I want to get started with programming graphics.

I often hear that 2D (with for example SFML) is a bit easier than 3D, but I'm way more

interested in 3D (with for example DirectX). I know C++ and some basic geometry and some other math and physics,

but I don't know if it's enough. (I'm asking it a bit more for the programming/developing part too)

What do you think is the best for me to start with?

Thanks.

(PS: I know that there are already some topics about this,

but I see so many different answers and I wanted to ask it for my situation.)

Short answer: start with 2D, progress to 3D.

There's a lot of stuff you'll learn while working with 2D games that'll be relevant when working in 3D.

Starting in 2D ensures you're able to learn those things, and be free to focus more on the pure 3D parts later on.

Hello to all my stalkers.

Advertisement

2D really simplifies everything, but not to the point of transforming it entirely -- in short, working in 2D is a great playground for learning to work in 3D later. Take physics, for example, 2D basically means you have only 3 degrees of freedom (translation along x, along y, and rotation in the X-Y plane) to deal with, rather than 6 (X, Y, Z, Roll, Pitch, Yaw) -- everything is basically the same, its just less of it and the simplifying assumptions you can make.

You probably are better off starting with 2D to get your bearings if you're new. One of the most difficult parts of making your first complex game is figuring out how all the parts fit together and interact -- and its almost entirely the same whether 2D or 3D, but you won't have the 3D details holding you up if you start with 2D.

But I guess that really only goes if you want to write those systems yourself. If you're going to use Unreal Engine or Unity or other engines/middleware, you'd probably be fine to choose either if you're very confident that your math skills and reasoning skills are up to the task. Just keep in mind that basically everything is twice as difficult or more in 3D than in 2D.

throw table_exception("(? ???)? ? ???");

I agree with the previous posts that 2D can be a smaller initial hurdle than 3D, but I wouldn't spend a whole lot of time overthinking which you should attempt first. I think what will be most helpful and most interesting is getting your feet wet. Start working through tutorials. Build very simple minimalistic games.

This will give you the best idea of what you're comfortable with, what you find most difficult, and you'll have experience (minimal experience, but experience), which carries a lot of weight when learning any new craft, especially game development.

Good luck and keep at it!

If you think it through 2D is not really easier than 3D.

- You use vectors with 2, not 3 dimensions, which is basically the same difficulty. Or you dont use vectors and calculate everything twice for x and y.

- A few calculations get easier, but not much.

- You use a slightly simpler projection transform, which wont safe you much time as you basically create this once.

- You possibly waste much time emulating features like depth testing or pseudo-3D-perspectives, which you could get for free when using real 3D in the simplest possible way, without always thinking about which sprite to draw last so its above/in foreground or creating an isometric tile engine or similar things.

- You only use quads as meshes, sparing you from creating any real, more complicated meshes, but wasting way more time creating much more complicated textures, which you cant reuse as easily, making you need to create a multitude of them from different perspectives.

If you think it through 2D is not really easier conceptually different than 3D.

- You use vectors with 2, not 3 dimensions, which is basically the same difficulty. Or you dont use vectors and calculate everything twice for x and y.

- A few calculations get easier, but not much.

- You use a slightly simpler projection transform, which wont safe you much time as you basically create this once.

- You possibly waste much time emulating features like depth testing or pseudo-3D-perspectives, which you could get for free when using real 3D in the simplest possible way, without always thinking about which sprite to draw last so its above/in foreground or creating an isometric tile engine or similar things.

- You only use quads as meshes, sparing you from creating any real, more complicated meshes, but wasting way more time creating much more complicated textures, which you cant reuse as easily, making you need to create a multitude of them from different perspectives.

Fixed it for you smile.png

You do 2D in much the same way as 3D at a conceptual level, but when you get down to details the extra dimension introduces quite a lot more of them, and so quite a lot more difficulty. So, like a said before, if you plan to write things yourself (that is -- to get into the details) then 3D is significantly more difficult, and perhaps best avoided as a first-attempt; but if you plan to use existing libraries/middleware/engines (that is -- to work at a more conceptual level), then 3D is not much more difficult to wield (though even still, somewhat more difficult).

throw table_exception("(? ???)? ? ???");

Advertisement

I agree with Ravyne above. As someone who probably moved into 3D too soon, I've found that, while in theory they're similar, some of the details and boilerplate things get extremely complicated rather quickly. In hindsight, I would probably have had a much smoother time in the learning process had I waited a bit longer, and likely wouldn't struggle nearly as much as I still do.(I had only been programming for a few months when I moved into opengl, probably much to everyone's dismay in the opengl forums).

That 3rd degree of movement gets tricky the moment you realize that Euler angles aren't going to suit your needs. Animation gets vastly more complicated than sprite-sheets ever could be. You have the addition of handling projection and view matrices (and matrix math in general). The boilerplate directx/opengl stuff is far more complicated than rendering sprites via SFML/SDL. You need to learn your shader language and more importantly, how to render proper lighting, normal mapping, shadows, etc.

With that extra overhead, you're now needing to consider performance (perhaps really for the first time), and streamlining your rendering operations.

In addition to that, if you're developing on your own, you'll need to learn to 3D model, texture, and animate, which I'd say is close to on par with the timeline to learn the programming side of things, if you want things looking even semi-decent. And while we're talking about time, the modeling side of things take so, so long.

Anyhow, I'd just say to make sure you have a solid grasp on things in the 2D world, and be prepared for learning and development of a game to go much more slowly when you add that extra dimension.

Edit*

To be clear, I'm not trying to talk anyone out of learning something new or to even necessarily discourage moving into 3D. I just wanted to give the perspective of someone who did move to 3D rather early on in their learning curve, and note some of the pitfalls and likely struggles ahead. If you're totally comfortable with creating 2D games, and the concepts involved, then I think by all means, forge ahead :)

Beginner here <- please take any opinions with grain of salt

OpenGL is always a great place to start I find, it's cross platform and is just about on par with Directx.

With OpenGL you'll be able to effectively learn all the things that you need to learn such as how to create orthographic matrices and rotation/translation matrices which will be vital when starting on 3D Projects.

The other major added bonus is that you'll be able to learn OpenGL with just about any language that you want as most of these major languages have frameworks that provide the bindings! I'm currently developing a series on Java and LWJGL 3 which is the framework that provides OpenGL bindings for Java so you should check it out: OpenGL Tutorials

Game Development Tutorials - My new site that tries to teach LWJGL 3.0 and OpenGL to anyone willing to learn a little.

I plan on writing a blog post about how 2D games being easier is a misconception. I do agree in some areas 2D is easier, however 2D does have its own set of problem that are just simply easier to solve in 3D. Especially design and gameplay wise, the challenges you face with 2D are just purley different than the challenges in 3D

Mobile Developer at PawPrint Games ltd.

(Not "mobile" as in I move around a lot, but as in phones, mobile phone developer)

(Although I am mobile. no, not as in a babies mobile, I move from place to place)

(Not "place" as in fish, but location.)

I plan on writing a blog post about how 2D games being easier is a misconception. I do agree in some areas 2D is easier, however 2D does have its own set of problem that are just simply easier to solve in 3D. Especially design and gameplay wise, the challenges you face with 2D are just purley different than the challenges in 3D

Its true of course that 2D has its own unique challenges that 3D does not have. But in general 3D has most of challenges that exist in 2D, and they're all complicated by an extra dimension and 3 extra degrees of freedom -- plus 3D games have their own set of unique challenges and it pretty significantly dwarfs the set of challenges in 2D, in my experience. Usually, you only run up against significant difficulties in 2D when you are emulating 3D in some way -- isometric engines with large and tall objects are famously less straight-forward in 2D than achieving the same effect in full 3D, and old-school arcade racers like Pole Position are odd ducks, even if they aren't all that complicated.

Design is surely different as you point out, but the OP is asking about graphics programming, not design, so I'm not sure that's relevant to the discussion. I'll be interested in reading your blog though, it sounds like an interesting topic and maybe you'll sway me.

throw table_exception("(? ???)? ? ???");

This topic is closed to new replies.

Advertisement