• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
KappaG3

What are the most important things that should make me consider moving to C++?

47 posts in this topic

Hello, new user here.

I started to program in C# about a year ago, after having some random general knowledge. Well, things change over time and now I'm pretty confident about my amateur-ish skills in C#.
Lately, though, I'm considering moving to C++. Being used to VisualC# I downloaded its counterpart, Visual C++. Which is good, simple and powerful. Lacks intellisense, but I guess I can deal with it.

Anyway, what really made me consider this option was seeing actual C++ source code. All those "shortcut symbols", pointers and more control over the code were what caught my eye. I'm not entirely [i]sure[/i] about what I saw and am trying to code, and this is why I started the thread. Is C++ a viable (and better) option for amateur programmers or is it only useful to more experienced users?

On a related note, what would be a good library to make games in? I'm used to XNA, I think I can shift to something else though. I've heard that it all boils down to OpenGL vs DirectX.
0

Share this post


Link to post
Share on other sites
Thanks vertex, your answer pretty much covers all my questions.
Speaking of the resources you posted, thanks again. I'll surely look into SDL as I need to get familiar with 2D programming, but is it good if I need to use some 3D models? There's a project I want to realize with a friend (who is in the same situation as me, migrating from a managed language to c++) and it could work in 2D, but I was thinking of making it 3D to learn some more while performing almost every calculation on a 2D grid (Tower defense says enough?). Edited by KappaG3
0

Share this post


Link to post
Share on other sites
[quote]Speaking of the resources you posted, thanks again. I'll surely look into SDL as I need to get familiar with 2D programming, but is it good if I need to use some 3D models?[/quote]

SDL essentially wraps OpenGL to provide its graphics functionality so you could definitely mix the two. There's a sub set of calls in SDL that allow you to operate directly on the OpenGL context should you need to.

[quote]There's a project I want to realize with a friend (who is in the same situation as me, migrating from a managed language to c++) and it could work in 2D, but I was thinking of making it 3D to learn some more while performing almost every calculation on a 2D grid (Tower defense says enough?).[/quote]

I should warn you that adding a dimension sometimes complicates things severely. Instead of using sprite sheets for characters, for example, you're now skinning animated skeletons, applying textures to them, etc. If you're new to game programming in general, consider taking smaller steps first. If not, by all means, 2D is - mathematically - a subset of 3D so anything expressible in the lower-order dimension is expressible in the higher.

My opinion on the whole 2D/3D argument is that you should consider carefully what you're getting out of using the extra dimension versus what you're adding to your workload to pay for it. If the benefits are clearly there, then that's enough of an argument for. If not, that's enough of an argument against. In your case, I'm not sure you're going to get anything beyond the "cool" factor. Maybe I'm way off on that, but consider it in any case.
2

Share this post


Link to post
Share on other sites
Quick addendum: you might want to check out [url="http://sfml-dev.org/index.php"]SFML[/url] over SDL, I just stumbled across another thread where they were talking about it and it appears to be an object-oriented cousin of SDL.
2

Share this post


Link to post
Share on other sites
Yeah, it would be strictly related to the 'cool' factor, while being essentially a 2D game under most aspects. That's why I tought that making it 3D wouldn't be such a big deal, but I'll take my time to see and consider what I can do.

@Addendum: Even better, thanks again (again [img]http://public.gamedev.net//public/style_emoticons/default/ph34r.png[/img] )! Edited by KappaG3
0

Share this post


Link to post
Share on other sites
[quote name='apatriarca' timestamp='1347547594' post='4979735']
What are your objectives? Why do you want to move to the C++ language?
[/quote]
That's what I'm asking in this thread.
Why [i]should [/i]I move to it?

Anyway, I've already got enough replies to think that I'll just move to it. I prefer the syntax and it's good to know that I can do more than before, even if maybe I'll need those functions rarely. Edited by KappaG3
0

Share this post


Link to post
Share on other sites
[quote name='KappaG3' timestamp='1347554976' post='4979770']
That's what I'm asking in this thread.
Why should I move to it?
[/quote]

Do you have a bunch of existing code in C++ that's easy to reuse?
Is your team a pile of experienced C++ developers without much exposure to other things?
Does your target platform only support C++, but that's where the money is?
Did your boss/class demand you use it?

These are really the only reasons, given the headaches the language puts on you to use it.
1

Share this post


Link to post
Share on other sites
[quote name='KappaG3' timestamp='1347554976' post='4979770']
Why [i]should [/i]I move to it?

Anyway, I've already got enough replies to think that I'll just move to it. I prefer the syntax and it's good to know that I can do more than before, even if maybe I'll need those functions rarely.
[/quote]
First off, you shouldn't move to any language, add languages to your toolbox, change your favourite language but never leave a language behind.
As for reasons to learn C++ there is only 2 good ones in my opinion:

1) Because you have to. I.E it is the only language that can do what you need to do. (This mostly applies to embedded systems or consoles where the language options and system resources can be fairly limited (Allthough C++ is not an option on all platforms, it is however fairly commonly available)).
2) Because you want to learn the language. (It is a fairly good language to know simply because of how widely used it is, (The same goes for C#, Java, Python and a bunch of other languages).

In general it is better to learn languages before you are forced to learn them. (The game industry have fairly good control over their language choices though but if you end up as a consultant maintaining old custom systems for clients things can get very interesting)
2

Share this post


Link to post
Share on other sites
[quote]These are really the only reasons, given the headaches the language puts on you to use it.[/quote]

I don't know that "headaches" is the best word for it. C++ simply does things differently than C#. At the end of the day it's all the same to the machine, but sometimes it's worth getting closer to said machine to learn a little more about how it works. I'm pretty emphatic about the fact that my experience with C++ has made me a better developer in other languages. If the ultimate goal here is to learn something new, that should be plenty reason to consider C++, or Java, or Haskell, or any other language really.
-1

Share this post


Link to post
Share on other sites
[quote name='Telastyn' timestamp='1347561104' post='4979799']
[quote name='KappaG3' timestamp='1347554976' post='4979770']
That's what I'm asking in this thread.
Why should I move to it?
[/quote]

Do you have a bunch of existing code in C++ that's easy to reuse?
Is your team a pile of experienced C++ developers without much exposure to other things?
Does your target platform only support C++, but that's where the money is?
Did your boss/class demand you use it?

These are really the only reasons, given the headaches the language puts on you to use it.
[/quote]
Quote for truth.

Learning isn't a valid excuse to switch to C++, you can learn C++ on the side in the years to come (and it will take years).
2

Share this post


Link to post
Share on other sites
[quote name='Telastyn' timestamp='1347561104' post='4979799']
[quote name='KappaG3' timestamp='1347554976' post='4979770']
That's what I'm asking in this thread.
Why should I move to it?
[/quote]

Do you have a bunch of existing code in C++ that's easy to reuse?
Is your team a pile of experienced C++ developers without much exposure to other things?
Does your target platform only support C++, but that's where the money is?
Did your boss/class demand you use it?

These are really the only reasons, given the headaches the language puts on you to use it.
[/quote]

Pretty much this.

There are a few edge cases, but those are exactly that.

I would also be curious to know what C# prevented you from doing. I came to C# from C++ and rarely if ever found myself unable to express certain code adequately. There have been a handful of times I had to pInvoke native code, but interop is certainly one of C#'s strengths ( especially compared to JNI). There are certainly things you do differently between languages, but there are few things I can think of that you can't do in C# that you can in C++. Hell, you can even get remarkably implicit with memory management if for some bizarre reason you really want to.

I will say this... when moving back to C++ there are certainly things I miss. Linq, beautiful link, perhaps being one of the biggest. Although a sensible class library is certainly high up that list.
2

Share this post


Link to post
Share on other sites
If you wish to learn C++ go for it, dont abandon C# though, both languages work very nicely together. No one can tell you 'why' you need to learn C++ though, only you can decide on that.

I went from XNA to SlimDX / SharpDX and I didnt regret my decision, sure the learning curve is greater than say an engine or other libraries but honestly after the initial few weeks every problem became fun and a game itself, however I should state my end game was purely to learn with and open schedule on when to stop. This may not be the best advice for you, but if your aim is to learn and you have a generous amount of free time (im talking months to years too) then a lower level graphics library may not be a bad idea.
2

Share this post


Link to post
Share on other sites
[quote]Then use C. Then use Assembly. Go write a compiler.[/quote]

Sure, all of these have plenty to teach. I understand the ultimate logical conclusion here: if you [i]really[/i] want to learn how a computer works start building switches. This would also be valuable, but is so far removed from making games it's not worth pursuing in order to make one. In my opinion, C++ is not a bad candidate for making games [i]and [/i]learning some things higher-level languages might give you very little to no exposure to. Sure, these languages exist for exactly the reasons you describe: they absolutely make life easier if you're looking to get something done quickly, focus on game play, etc. There is definitely value in that.

[quote]There are better ways to get this sort of knowledge without the gotchas inherent in the language's design.[/quote]

To what are you referring here?
1

Share this post


Link to post
Share on other sites
[quote name='greenvertex' timestamp='1347567880' post='4979821']

[quote]There are better ways to get this sort of knowledge without the gotchas inherent in the language's design.[/quote]

To what are you referring here?
[/quote]

I am not speaking for him, but I would answer:

- C legacy cruft... ( malloc, stdio, etc )
- the shitastic link process
- the precompiler
- byzantine inheritance rules
- pre-STL C++

Those are the warts that leap immediately to mind, but only really scratch the surface. There are little niggling things too, like scoping rules in for loops or the ++ gotchas.
1

Share this post


Link to post
Share on other sites
[quote name='Telastyn' timestamp='1347568972' post='4979826']
I should just write it up one day and link to it.[/quote]
Hah. I was just thinking about this the other day.
1

Share this post


Link to post
Share on other sites
Oh, wow. Just have to go away some hours to find the exact opposite of what I got told yesterday.

I want to learn C++ mainly because I never worked with low-level languages, and because I'm sure it'd be a great learning experience.
I also tought that its libraries would make life as easy as it is with XNA, but I think I'm wrong after seeing all those replies.

I have the solution: I'll keep studying C++ as a hobby, while continuing my C# projects.
0

Share this post


Link to post
Share on other sites
It boils down to whatever you want to do... You want to be productive now - stick with what you've got, as long as it works for you. You want to learn a lower-level language and have the determination to feel stupid again without giving up (because switching will, at times, make you feel that way), then go ahead onto C++. What C++ has for you ... it's the de-facto standard for any "serious" (read consoles + PC/MAC) game dev company (I should know, I've been working for one for 6.5 years). If you want to code an xbox game (short of little XNA games), you will do it in C++ at least at some level, because the sdk they offer is for C++; want to code something for PS3... yep, C++ sdk as well... So, just define your goal: productivity now or study_now_reap_benefits_later. If you're determined and willing, I see NO reason not to go into some C++ programing. Have fun!
2

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0