Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411489 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 03:28:17 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Moving towards C++ development
Pages: 1 [2] 3 4 5
Print
Author Topic: Moving towards C++ development  (Read 9976 times)
BrianSlipBit
Level 1
*



View Profile WWW
« Reply #20 on: January 25, 2012, 07:30:34 AM »

Is it true that C++ isn't as important for someone who wants to be a gameplay or graphics programmer? I haven't seen or heard that elsewhere.

This is absolutely 100% false. And it's even more false considering the current state of the economy and the number of veteran developers who all know C++ and are out of work right now.

If you seriously want to work in the mainstream game industry, much less at a AAA developer, then yes, you'll need to have a very solid understanding of C++.  The only way you're going to have that is by using the language.  Yes, you'll probably blow your foot off a few times along they way, but how else can you expect to learn?

I learned C++ back in the mid-90's in college when there weren't a million C++ tutorial websites under the sun, the books on it were half as thick as they are today, and in general there just wasn't as much available in terms of learning resources.

I spent 10+ years in the mainstream industry coding in C++ and continue to use it for a variety of reasons today--a few of which are: I like it, I'm comfortable with it, I like the portability it provides, I like the control it provides when I want it, and it keeps my skills sharp in the event that I ever decide to go back to the mainstream side of the industry.

With that being said, it also has its fair share of baggage.  But, that's not really the point of this thread.  If you want to do the the things you say you do--then learn C++, learn it well, and have fun doing it. It will pay good dividends in the end.
« Last Edit: January 25, 2012, 11:30:25 AM by Brian Lawson » Logged

Fallsburg
Level 10
*****


Fear the CircleCat


View Profile
« Reply #21 on: January 25, 2012, 07:40:56 AM »

Yeah, I wasn't trying to say that learning C++ was a bad idea.  I use C++ everyday and it's what puts food on my table.

That being said, I do not use C++ for my own game development, for a number of reasons:
1) I don't need the power that it provides
2) I can be much more productive with easier to use languages (such as Flash)
3) After a full day of staring at C++ code, I'd go crazy if I had to do it at night as well.

But, it's a valuable tool to have, and learning new languages is never a bad thing.  In fact, I encourage people to learn as many languages as possible, as they all have something to bring to the table (ignoring joke languages such as Brainfuck).
Logged
Zack Bell
Level 10
*****



View Profile WWW
« Reply #22 on: January 25, 2012, 07:50:43 AM »

Alright, well thank you guys. I'm glad that I got so much more feedback overnight. I do find it somewhat difficult to learn and teach myself C++ things while I learn Java and other things at school. This is because I'm still somewhat new to all of this in general and it's not easy retaining so much information all at one time. Any suggestions?
Logged

mduffor
Level 0
**



View Profile WWW
« Reply #23 on: January 25, 2012, 10:35:26 AM »

I don't use templates (well, apart from STL containers) and I'm not missing them. And you don't need to know C to program in C++.

I come down on this side of C++ development as well.  It is good to learn about templates and the STL because you may need to use them.  But personally I don't use STL, templates, or very deep inheritance.  They just hid too much of the implementation, and were a pain in the ass to debug when something went wrong.  There was also a time when STL wasn't exactly "standard" across compilers, and that made me shy away from it as well.  Instead, I've written my own array, string, vector, smart pointer, etc. classes and use them instead. 

I don't know the exact path of learning to suggest for you.  I worked from the basics up to more advanced topics.  This means I wrote a bunch of ASCII games before I got into 2D graphics followed in time by a 3D graphics.  I also started with Pascal and assembly language, then learned C, then learned C++.  Learning assembly before C led me to view C as a faster way to write assembly (and pointers made a lot of sense since I understood how the CPU was doing things in the background.)  Learning C before C++ allowed me to understand why C++ was developed and how it helped organize C code. 

I've also written linked lists, auto-sizing arrays, various tree structures, several script parsers & compilers, a scene graph, bitmap decoders, WAV file readers, data compressors/decompressors, and even a regular expression parser over the years.  Even if you wind up using a library for the functionality in the end, you will learn libraries faster and use them better if you understand a bit about what they are doing under the hood.

So I guess you should just pick a simple project, implement it, finish it, and move onto something slightly more complex.  Challenge yourself to learn and implement something new each time.

Cheers,
Michael
Logged

Blog + website = www.mduffor.com
BrianSlipBit
Level 1
*



View Profile WWW
« Reply #24 on: January 25, 2012, 11:38:35 AM »

Alright, well thank you guys. I'm glad that I got so much more feedback overnight. I do find it somewhat difficult to learn and teach myself C++ things while I learn Java and other things at school. This is because I'm still somewhat new to all of this in general and it's not easy retaining so much information all at one time. Any suggestions?

Suggestions--yes.  When I "learned" C++ in college, almost all of it went over my head. I took it as a 4-5 week summer course, so it was a major cram session.  I didn't truly learn the language and the ins and outs of it until I started working in the industry.

However, I actually took an intro to C course that was for an entire semester (prior to the C++ summer course), and I think the intro C course actually helped the most with regard to my eventual grasping of C++. Most people learning C/C++ seem to really struggle with the concepts of pointers and references. Beyond that, they likely struggle with things like when constructors/destructors run, virtual destructors, templates, etc.

The best solution for all of this though, is simply time in the saddle--i.e. use it, struggle with it, master it.

Quote
Instead, I've written my own array, string, vector, smart pointer, etc. classes and use them instead.
P.S. This!  I've done the same things for the same reasons. I'd highly recommend doing this as well, if for nothing else, the learning experience.  When you can show up to an entry level interview and demonstrate working knowledge of why these types of utility classes are useful, how they might be implemented, etc, you'll be a step ahead of the guy who's been using nothing but pure STL and BOOST for his learning.
Logged

Zack Bell
Level 10
*****



View Profile WWW
« Reply #25 on: January 25, 2012, 12:01:07 PM »

I have already written a vector, linked list, doubly linked list, hash table, trees, searches and sorts in C++. It was one of my goals when I started learning and it has made my java class SO incredibly simple.
Logged

Chromanoid
Level 10
*****



View Profile
« Reply #26 on: January 25, 2012, 12:04:54 PM »

Chromanoid mentioned only learning C++ if I wanted to be an engine developer in the AAA industry. Is it true that C++ isn't as important for someone who wants to be a gameplay or graphics programmer? I haven't seen or heard that elsewhere.
Oh, I didn't mean C++ isn't important, I just think that C++ is something for professional (oldschool) game developers. As a normal (professional) programmer it is always useful to know C++, but in many "normal" software development companies the language of choice is not C++ but Java, C# or similar languages.

IMO C++ is dangerous for indie projects because of its complexity, I also have the impression that the use of C++ often indicates a tendency to reinvent the wheel and an urge to optimize everything for performance. This may lead to a huge waste of time.

Good C++ programmers know the pitfalls of C++ and can handle them, but it takes time to become a good C++ programmer. If you want to make games in near future I would recommend a language or even better a framework that is not such a complex beast.
Logged
Zack Bell
Level 10
*****



View Profile WWW
« Reply #27 on: January 25, 2012, 12:17:57 PM »

I totally understand your point, I just believe that I will need a string understanding of c++ in order to be a AAA programmer.

Like I mentioned before, I am using Game Maker and Flash for my personal games, and I'm in the middle of my fourth and final java course  Coffee
Logged

Chromanoid
Level 10
*****



View Profile
« Reply #28 on: January 25, 2012, 12:28:24 PM »

That is true. Seems to be a good learning trail Hand Thumbs Up Right

BTW interesting style guide for C++ by google: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
Logged
ThemsAllTook
Administrator
Level 10
******



View Profile WWW
« Reply #29 on: January 25, 2012, 12:47:32 PM »

In fact, I encourage people to learn as many languages as possible, as they all have something to bring to the table (ignoring joke languages such as Brainfuck).

Actually, I'd totally include esoteric languages. While it doesn't have any direct practical use, you'll learn a lot of stuff and find new ways of thinking about things if you try to write something in Brainfuck. (Also, learning Brainfuck takes just a few minutes, since there are only 8 instructions; figuring out how to write something in it that actually works with those limitations is the time-consuming part.)
Logged

ChevyRay
Guest
« Reply #30 on: January 25, 2012, 01:04:04 PM »

Super Meat Boy was probably built using XNA, though I'm not sure.

SMB was C++, not C#/XNA.
Logged
Ivan
Owl Country
Level 10
*


alright, let's see what we can see


View Profile
« Reply #31 on: January 25, 2012, 01:30:08 PM »

To me, it's a pretty simple breakdown. If you are a programmer at heart, (you enjoy the process of writing code for the sake of the process itself), then C/C++ is where you will ultimately be happiest. If writing code is not your favorite part of the process of making games (you just look at it as the necessary glue that you need to write to create a game) then you should use other tools.

Actually, I think that writing interesting code and writing code for interesting things are two very different (though of course not always mutually exclusive) things. I love both C and C++ and I've written a huge engine (see my sig.) in C++ and loved every second of it, but often when I work on games, when they are not interesting programming challenges, the programming of them is a tedious part that I'd rather not do (it's almost like content creating than programming) and that part is always a strong case for high level languages.
Logged

http://polycode.org/ - Free, cross-platform, open-source engine.
Zack Bell
Level 10
*****



View Profile WWW
« Reply #32 on: January 25, 2012, 01:58:16 PM »

I understand where you're coming from. That is similar to the feeling that I get when I'm working on games, sometimes. Figuring out an algorithm for a homing missile or organizing an enemy hierarchy in a new way sounds interesting to me the first time that I do it, but something like writing tedious case statements to handle tons and tons of different states of animation usually bores me.

I think that in the long run, I'll probably enjoy something like engine or physics programming over gameplay, but that could always change I suppose.
Logged

Vino
Level 3
***


View Profile
« Reply #33 on: January 25, 2012, 11:26:35 PM »

Personally I started with C++ hacking the HL1 SDK. I already knew a good bit of C going in. It was a bit over my head at first, but by starting small and building up I was slowly able to build up a good understanding of what was going on. I wouldn't recommend the Source SDK or coding in another large C++ engine, but I would recommend to start by modifying other people's code. Studying others' code is a great way to learn how to do things quickly and easily. Try a smaller engine, first, like perhaps one of those indie games that went open source back during the first humble bundle.
Logged
Mikademus
Level 10
*****


The Magical Owl


View Profile
« Reply #34 on: January 26, 2012, 03:45:36 AM »

interesting style guide for C++ by google: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml

I'd be very careful with this style guide. It is not a general style guide but rather a Google code compatibility guide with instructions for how code should look to fit in with other Google projects. Because of historical reasons it is incredibly restrictive and Google disallows f.i. exceptions, streams and templates, as well as most of Boost and any 3rd party code.

If you want general style guides to help you with good, readable and pedagogical C++ code formatting and coding principles, look at the Qt and WARTBED styles (note that Qt also disallows exceptions (I'm not taking sides in the do-or-don't on exceptions debate) but is nonetheless preferable to the Google compatibility style guide).
Logged

\\\"There\\\'s a tendency among the press to attribute the creation of a game to a single person,\\\" says Warren Spector, creator of Thief and Deus Ex. --IGN<br />My compilation of game engines for indies
Moczan
Guest
« Reply #35 on: January 26, 2012, 04:51:36 AM »

To me, it's a pretty simple breakdown. If you are a programmer at heart, (you enjoy the process of writing code for the sake of the process itself), then C/C++ is where you will ultimately be happiest. If writing code is not your favorite part of the process of making games (you just look at it as the necessary glue that you need to write to create a game) then you should use other tools.

Actually, I think that writing interesting code and writing code for interesting things are two very different (though of course not always mutually exclusive) things. I love both C and C++ and I've written a huge engine (see my sig.) in C++ and loved every second of it, but often when I work on games, when they are not interesting programming challenges, the programming of them is a tedious part that I'd rather not do (it's almost like content creating than programming) and that part is always a strong case for high level languages.

I think of myself as a programmer at heart, but I don't really enjoy C/C++ that much. I prefer managed languages (AS3, haXe, C#) more than fighting with C/C++. Maybe it's a difference between micro and macro management. I enjoy feeling like a supreme overlord "those object are all connected and work in a spectacular manner, haha!" instead of "f*ck, I forgot to free a pointer somewhere here..."
Logged
Klaim
Level 10
*****



View Profile WWW
« Reply #36 on: January 26, 2012, 07:05:08 AM »

I just want to say something to nuance some assertions made in this discussion:

Any C++ expert (as experienced enough to know how not write code unreadable and still powerfull)- up to date with C++ idioms and available standard libraries - will write code that will look like C# or even simpler.

The problem with C++ is mostly getting to this state. It just takes years of practice, reading expert books and non-instantaneous realizations (in your brain). (!)

It requires a lot of time and maybe it's not worth it for a lot of people.


That said, once you're their, you write simple code that works.





...then the only problem remaining is compile time. THIS is the big of C++. Consider it.
Logged

Fallsburg
Level 10
*****


Fear the CircleCat


View Profile
« Reply #37 on: January 26, 2012, 07:58:35 AM »

Any C++ expert (as experienced enough to know how not write code unreadable and still powerfull)- up to date with C++ idioms and available standard libraries - will write code that will look like C# or even simpler.

I think this is the crux of it.
1) A lot of people come to C++ in a C style of thinking, which while not a recipe for disaster, is a recipe for a lot of frustration.
2) The library issue.  I'm unsure as to what you mean by standard libraries.  Do you mean the actual "standard libraries", or do you mean commonly used available libraries (Boost, etc.)?  Because, I see the biggest problem for C++ (in the context of making games), is that it requires a lot of libraries to get up to the level of usability of a modern language.  In the long run, this isn't a problem, but it does create a much larger barrier to entry.
Logged
Klaim
Level 10
*****



View Profile WWW
« Reply #38 on: January 26, 2012, 08:23:26 AM »

Any C++ expert (as experienced enough to know how not write code unreadable and still powerfull)- up to date with C++ idioms and available standard libraries - will write code that will look like C# or even simpler.

I think this is the crux of it.
1) A lot of people come to C++ in a C style of thinking, which while not a recipe for disaster, is a recipe for a lot of frustration.
2) The library issue.  I'm unsure as to what you mean by standard libraries.  Do you mean the actual "standard libraries", or do you mean commonly used available libraries (Boost, etc.)?  Because, I see the biggest problem for C++ (in the context of making games), is that it requires a lot of libraries to get up to the level of usability of a modern language.  In the long run, this isn't a problem, but it does create a much larger barrier to entry.


Well I mean the C++03 STL (that provide some smart pointers at least, and other useful construct), the C++11 STL (that provide a lot of what Boost provides) and, if you can and want, a recent Boost setup, as Boost  can be considered the STL++.

However, C++11 library is already quite powerfull.

But anyway yeah it's just plain hard to most people to even understand how such libraries can be written, or even know that they exist.
It feels like getting to C++ is a full time discovery of both the language, it's possibilities and tools available around. So this time you need to constantly learn is taken and can't be spent on "JUST MAKING THE DAMN GAME".

I think it is well worth going with C++ if you run for long term and want to achive things that technically might be complex or scalable, but that's not really interesting for most indies I guess.

I'm  in such a case for at least one game, and I like to learn tons of things constantly (programming languages included) so I lose a lot of time on it and I'm fine with it (I do it at my dayjob anyway, while absurd compile times keep me from even working - so it's only a win until I get full indie).

But who really need heavy powers?



...


I just want to be able to generate MMOS on the fly one day.   EpilepticHand Money Right



Ok ok I'm joking but yeah C++ is a long-term perspective, while if you just want to make this game for the coming year, keeping focus on any other language that get the job done that shouldn't become a bottleneck itself (like, don't make 3D shooters in Ruby...yet).

As said, you can get to this point of making C++ just getting the job done but you have tons of understanding to get to be able to do that. And then you just want to kill the guys who designed the compilation process. (note that it's a big subject for the next C++ standard so maybe in 3-5 years C++ compilation times will get decent and it will be less of the productivity killer)
Logged

Average Software
Level 10
*****

Fleeing all W'rkncacnter


View Profile WWW
« Reply #39 on: January 26, 2012, 09:10:58 AM »

And then you just want to kill the guys who designed the compilation process.

That would be Dennis Ritchie, and he's already dead.

I've been saying for years that the biggest problem with C++ is that it inherited C's compilation model.  This worked OK until templates and inline functions were introduced.  I just hope that whatever new system the C++ committee introduces still allows something like header files.  Header-less languages like Java make me want to shoot myself.
Logged



What would John Carmack do?
Pages: 1 [2] 3 4 5
Print
Jump to:  

Theme orange-lt created by panic