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

Login with username, password and session length

 
Advanced search

879843 Posts in 33010 Topics- by 24381 Members - Latest Member: MinuteMan

May 25, 2013, 04:41:27 AM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Greetings! Newbie asking where to start with C++ game programming here!
Pages: 1 2 [3]
Print
Author Topic: Greetings! Newbie asking where to start with C++ game programming here!  (Read 1400 times)
Halcyon
Level 2
**



View Profile
« Reply #30 on: June 28, 2012, 05:05:00 AM »

I remember when I was completely new and wanting to make games (specifically the next best MMO  Big Laff). I did a little research and found that all the 'professional' games used C++ so I was determined to learn that language. I read through many threads like this one suggesting that I learn something easier etc.. And typically I ignored them all and went straight to learning C++.

What has resulted in this? well a couple of years after beginning my endeavour I have learned the language to a decent extent and have made a total of 0 completed games, with not much to show otherwise. This isn't to say it will go the same for you, you may be a much more dedicated person and far less lazy then I am; but in any case you will spend years learning before you create what you really want to.

Learning a language is half the battle, programming and game development concepts (such as math, OOP, physics, data structures etc) is the other half and they will almost always translate over to whatever language you want to use. I would say that learning these are far more important then learning the language itself, therefore learning a simpler language is indeed a good idea. Even using programs like Game Maker or Unity are good for beginners to game development. Ultimately C++ will give you more control, power and freedom in the long run but you don't need that as a beginner.

But if you are determined to stick with C++ then I would user one of the aforementioned libraries such as SFML, SDL or Allegro; the latter being the only I have little experience with.

Anyway here are some tutorials that may give you a start:
http://www.dreamincode.net/forums/topic/109001-beginning-sdl-part-1/
http://www.gamefromscratch.com/page/Game-From-Scratch-CPP-Edition.aspx
http://javilop.com/gamedev/tetris-tutorial-in-c-platform-independent-focused-in-game-logic-for-beginners/
http://www.sdltutorials.com/
Logged
_Tommo_
Level 7
**


frn frn frn


View Profile WWW
« Reply #31 on: June 28, 2012, 05:13:40 AM »

Yep. No java on iOS and any console. You can get Java games to work on Android but there are some major library differences, and probably a Java game will be pretty slow on a low-end android device.
For C# there's Mono, so I guess that sticking to that part of .NET that Mono supports you can get decent/good crossplatform support with it. But still you can't use XNA with mono, and you should go with bare-bones OpenGL to support other platforms.

and no, I don't see why porting a managed language should be easier than porting C++.
Logged

Moczan
Level 5
*****



View Profile
« Reply #32 on: June 28, 2012, 06:11:41 AM »

For C# there's Mono, so I guess that sticking to that part of .NET that Mono supports you can get decent/good crossplatform support with it. But still you can't use XNA with mono, and you should go with bare-bones OpenGL to support other platforms.
There is also MonoGames which tries to mirror XNA, but it's not yet complete

Quote
and no, I don't see why porting a managed language should be easier than porting C++.
Because with stuff like Flash it works out of the box most of the time, while with C++ you get so much inconsistent behaviour even on same platform. For small indie teams or lone developers it's really kinda impossible to have 30 different Windows hardware configurations to test, because your game can go fuck itself on specific graphics card or driver, not even talking about porting.

Logged
Dacke
Level 10
*****


I have never been to Woodstock


View Profile
« Reply #33 on: June 28, 2012, 06:58:12 AM »

GODS DAMN Language Wars. Screw that crap right there buddy.  Every. Damn. Time.  Just ignore all that.

Yes. Sorry about that. I tried to make basic point you were making. Most languages are good enough to make games with. Then I had to defend that point and a language war broke loose. I should have tried to defuse it earlier Concerned

@Klaim: Thank you for the pointers. "Modern C++" sounds fairly interesting.

@Rivon: You may be right, it's possible that my memory measurement was sloppy. But I think that the memory measurement showed actual memory occupied by the program, with the garbage collector cleaning up any overhead as you go along.

@_Tommo_: Almost all Android apps are written in Java. I work as a professional Java programmer and we compile to HTML5. There are embedded devices, BluRay players and cars that run Java. Java can be complied to target iOS with some effort. Technically most of these aren't Java™ because they don't support the entire standard library. But it's really just a matter of using (slightly) different libraries for different platforms, which is exactly what you'd do for C++ anyway.

Logged

vegan • socialist • atheist • humanist • liberal • FOSSer
programmer • feminist • animal rights activist • pacifist • teetotaller
_Tommo_
Level 7
**


frn frn frn


View Profile WWW
« Reply #34 on: June 28, 2012, 08:29:22 AM »

Because with stuff like Flash it works out of the box most of the time, while with C++ you get so much inconsistent behaviour even on same platform. For small indie teams or lone developers it's really kinda impossible to have 30 different Windows hardware configurations to test, because your game can go fuck itself on specific graphics card or driver, not even talking about porting.

Well, you're using the same driver with LWJGL or JGL or whatever you use to expose OpenGL to C#, so the drivers can fuck themselves pretty good in any language Smiley
But yeah, C++ is more bug prone when you dabble with low level stuff, eg: pointer math can get VERY wrong on different platforms. Some platforms zero their memory, or are less strict about out of bounds access, or won't crash with a double delete, leading to lots of hate when you happen to compile for a platform that's stricter.
Still, using "modern" C++ this is much less likely to happen, and having just ported a very big project I can say that these kinds of problems were the least common.

@_Tommo_: Almost all Android apps are written in Java. I work as a professional Java programmer and we compile to HTML5. There are embedded devices, BluRay players and cars that run Java. Java can be complied to target iOS with some effort. Technically most of these aren't Java™ because they don't support the entire standard library. But it's really just a matter of using (slightly) different libraries for different platforms, which is exactly what you'd do for C++ anyway.

Cool, I didn't know iOS could run Java, is that a terrible hack or something production ready?

Anyway ok, you convinced me, C++ is the most portable language only by a bit Smiley
But let's say that I still prefer C++ for being the "latin" of languages, and for being tied to noone.
Seeing how much each of those Java and C# ports depends on huge efforts from random companies and individuals in emulating the specs of the "real thing", I can't be confortable with it Crazy

PS: yeah sorry for the language war Beer!
Games can be made in any language, even "indie AAAs" as long as they are 2D or even simple 3D... people even consider using HTML5 for games, so this has definitely to be true Durr...?
Logged

Dacke
Level 10
*****


I have never been to Woodstock


View Profile
« Reply #35 on: June 28, 2012, 08:53:07 AM »

Java (the language) can be compiled to different targets using special compilers. Google PlayN uses different compilers to compile from one code-base to different targets. So from a single codebase you can compile to Java Bytecode (for desktops), JavaScript/HTML (for browsers), Dalvik (for Android), SWF (for Flash) and iOS-ARM-nonsense (for iOS) (or are they just using HTML5 to target iOS?).

The drawback: PlayN is a bloody pain to set up.

edit: I have no idea how the performance is for different targets. But my experiences with using GWT to compile Java to HTML5 are quite positive.
« Last Edit: June 28, 2012, 09:09:19 AM by Dacke » Logged

vegan • socialist • atheist • humanist • liberal • FOSSer
programmer • feminist • animal rights activist • pacifist • teetotaller
Pages: 1 2 [3]
Print
Jump to:  

Theme orange-lt created by panic