Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

999641 Posts in 39235 Topics- by 30649 Members - Latest Member: 7yp

April 24, 2014, 02:01:59 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Moving towards C++ development
Pages: 1 2 [3] 4 5 6
Print
Author Topic: Moving towards C++ development  (Read 5465 times)
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

Valaam0
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 9
****



View Profile
« 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 Email
« 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
Level 5
*****



View Profile
« 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

http://www.klaimsden.net | Game : NetRush | Digital Story-Telling Technologies : Art Of Sequence
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

http://www.klaimsden.net | Game : NetRush | Digital Story-Telling Technologies : Art Of Sequence
Average Software
Level 10
*****

Fleeing all W'rkncacnter


View Profile WWW Email
« 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

Franchise - The restaurant wars begin!

What would John Carmack do?
mduffor
Level 0
**



View Profile WWW Email
« Reply #40 on: January 26, 2012, 09:52:57 AM »

Just as a note, if you don't use templates, C++ compile times are pretty fast.  My libraries have about 180,000+ lines of code in the cpp files (another 32k lines in the headers, including comments), and do a clean compile with gcc in about 3 and a half minutes on a single core Atom driven netbook.  And I only need to do full clean compiles if I've been monkeying around with the header files that are used by multiple source files.  IMHO that's not too bad, and it goes even faster if you have a decent computer.

Note that these line counts are just from doing a "wc -l" on the command line, so it just counts newline characters.  So the lines-of-code is only a rough estimate, but gives the size of the files the compiler must deal with.

Cheers,
Michael
Logged

Blog + website = www.mduffor.com
Zack Bell
Level 9
****



View Profile
« Reply #41 on: January 26, 2012, 09:56:14 AM »

How would you guys suggest going about learning more and more C++ while I try to keep up with Java studies for school? I have enjoyed Java so far and like staying ahead of the class, but it will be difficult for me if I am also learning new libraries and cramming C++ down my throat at the same time...

Should I hold off? Or should I just work harder? Probably a stupid question, but I hope you can understand my dilemma. 
Logged

Impossible
Level 3
***



View Profile Email
« Reply #42 on: January 26, 2012, 10:13:50 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..."

I completely disagree that people who are "programmers at heart" should like C++ and I've written C++ everyday for a living for the last 10 years. Most professional software engineers do not work in C++, people that work in Java, PHP, C#, Python and Ruby are just as much programmers at heart as people that work in C or C++. Actually, if someone is a hardcore computer scientist or software engineer type I'd expect them to not like C++ and instead be fans of Lisp, or Haskell or ANSI C or something. There are also some people that are artists at heart that work mainly with C++ (Zach Gage and Chris Makris for example), so a lot of it comes down to use the best tool for the job.  If you are making a pixel art platformer for PC and Mac you probably don't need to write it in C++ except for portability reasons.
Logged
BrianSlipBit
Level 1
*



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

If compile times are killing you, then you're doing it wrong--even with template usage.  The last mainstream project I worked on had a codebase just shy of 1,000,000 lines of C/C++ code and a clean + build would take ~3 minutes or less.  Furthermore, a clean + rebuild was not something that happened very frequently--maybe a few times a day.

Precompiled headers are the solution to this "problem". Visual Studio's PCH implementation is pretty robust (and has been for some time) and gcc and its variants typically support their own implementation of PCHs these days (although, that's a more recent feature).
Logged

JOBA
Level 1
*


EZ


View Profile
« Reply #44 on: January 26, 2012, 10:48:45 AM »

I completely disagree that people who are "programmers at heart" should like C++ and I've written C++ everyday for a living for the last 10 years. Most professional software engineers do not work in C++, people that work in Java, PHP, C#, Python and Ruby are just as much programmers at heart as people that work in C or C++. Actually, if someone is a hardcore computer scientist or software engineer type I'd expect them to not like C++ and instead be fans of Lisp, or Haskell or ANSI C or something. There are also some people that are artists at heart that work mainly with C++ (Zach Gage and Chris Makris for example), so a lot of it comes down to use the best tool for the job.  If you are making a pixel art platformer for PC and Mac you probably don't need to write it in C++ except for portability reasons.
Seconded.

I only touch C++ when I need performance and it turns out I rarely need it.

There are languages that I find a lot more concise and productive.

I miss reflection and attributes/metadata.

C++11 introduced lambdas, but it still doesn't look nearly as elegant as:
Code:
players.where(i => i.age > 10).orderby(i => i.score).select(i => i.name);
I basically wrote a line that gets me names of all players over age of 10, ordered by score. I love stuff like this.

And there are plenty of powerful features and beautiful little tidbits like that in Python, C#, Groovy, Ruby, etc that makes using them a joy.

I want to do as much as possible with as little as possible code.

Logged

Instant TileEd - draw pixel art games and export them to Tiled TMX!
Looking for artist for a CRPG!
Pages: 1 2 [3] 4 5 6
Print
Jump to:  

Theme orange-lt created by panic