Jump to content

  • Log In with Google      Sign In   
  • Create Account


Learning C++ or Python


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
14 replies to this topic

#1 Gasoline   Members   -  Reputation: 115

Like
0Likes
Like

Posted 29 June 2011 - 06:10 AM

Hello all, first post here.

Ive had very little experience with PHP, Java, C++ and Python in the past and I know some of the basics, Ive done a Hello World program in all of these that worked too. Posted Image
I am not sure whether I should pick up the 1000+ page C++ book that has been collecting dust in the bookshelf or should I dive into learning Python. I would like to write games as a hobby in my spare time. I would like to write small games and when I have some experience I would want to join an indie team and write something bigger and learn it further.

I know that Python is a lot easier to learn and would be good language to learn the basic game related algorithms with minimal effort and complications from language while C++ is a lot heavier and harder to learn.

I would like to hear your tougths on the matter. If you were a guy with the similar background as me and had a similar experience in the past, what did you choose and how did it work out?
C# .NET

Sponsor:

#2 FelixK15   Members   -  Reputation: 238

Like
-2Likes
Like

Posted 29 June 2011 - 06:51 AM

Both.

As far as I know (I didn't wrote one line in Python so far) Python is a script language whereas C++ is a 'real' programming language.

I recommend you to take a look at Lua. It's (like Python) a script language and is very popular within the game programming industry.
When Lua is used together with C++, one can do some serious shit.
Visit my blog or follow me on twitter.

#3 Gasoline   Members   -  Reputation: 115

Like
0Likes
Like

Posted 29 June 2011 - 08:06 AM

What is easier to bind together: C++ and Lua or C++ and Python?

// Found this topic on the matter: http://www.gamedev.net/topic/375497-python-vs-lua-for-a-scripted-game-logic/
C# .NET

#4 NEXUSKill   Members   -  Reputation: 456

Like
0Likes
Like

Posted 29 June 2011 - 09:04 AM

If you aim at writing small games on your spare time, I would recommend neither, It might be much better suited for you to go into XNA C# or Unity.

These two frameworks already provide the basics and allow you to dive right into GAME programming, learning c++ will require a lot of time for programming the basic engine before even thinking of game code.

Flash might also be a good option, specially backed up by some framework as flixels.


Game making is godlike

LinkedIn profile: http://ar.linkedin.com/pub/andres-ricardo-chamarra/2a/28a/272



#5 EvilTesla-RG   Members   -  Reputation: 114

Like
1Likes
Like

Posted 29 June 2011 - 09:20 AM

I've done game programming in flash, python and C++.


Flash sucks. Don't do it.


It is slow, horrible syntax, and has way too much going on in the background.

As such, I'm very skeptical of anything that is higher level than python. Havn't tried Unity, but it sounds WAY too much like flash for my taste.



Python is easy to learn, and easy to write.

With PyGame, game development is very easy. But, python is big and slow (not quite as bad as flash), don't expect to do anything complicated.


C++ isn't a whole lot harder to learn. But programming in it is like trying to jog through waist deep water. However, it is very small, very fast, and their is lots of support for it. Once you finally get into it, you could theoreticly build industry quality games. (Not possible with anything higher level).



Currently I'm using C++, as I want to write large games, but Python is a very good place to start.

#6 NEXUSKill   Members   -  Reputation: 456

Like
1Likes
Like

Posted 29 June 2011 - 09:38 AM

While there are attempts at making entire games out of python, its best fit is for scripting purposes, for that you'll need a strong c++ engine and game framework that uses the script, flash is very often integrated into c++ games to implement graphic interfaces, this is used in many AAA titles.

Flash is quite a bitch, I agree, but if you aim at small and simple games it is still a more direct approach than going full c++ without having a base engine.

Unity is nothing like flash, its more like game maker on steroids, its a fully game oriented edition tool heavily scripted with C#, free license, easy to learn and best of all, works on most conceivable platforms with little work other than designing your game to be playable on such platform.


Game making is godlike

LinkedIn profile: http://ar.linkedin.com/pub/andres-ricardo-chamarra/2a/28a/272



#7 Telastyn   Crossbones+   -  Reputation: 3726

Like
0Likes
Like

Posted 29 June 2011 - 09:49 AM

Anything but C++ should be fine.

#8 Storyyeller   Members   -  Reputation: 212

Like
1Likes
Like

Posted 29 June 2011 - 10:14 AM

I'm also making some games for fun. I started with C++ and have made several games, including one that I've been working on for almost two years. I haven't made any games in Python, but I do find it useful for automating other tasks involved in game development. For example, I wrote a script which takes in a description of a level and automatically generates the background image and collision data, which I can then put into my C++ game.

Python is really useful when you want to code stuff quickly and the task isn't performance intensive. I've heard there are ways to improve it, like Psyco or adding C modules, but I think these are way beyond the scope of a beginner. I haven't managed to do either of those successfully yet.
I trust exceptions about as far as I can throw them.

#9 Serapth   Crossbones+   -  Reputation: 5333

Like
0Likes
Like

Posted 29 June 2011 - 10:35 AM

Use Panda3D free engine, and you can do both! Write the majority of your game logic in Python, but you can drop to C++ if performance becomes critical. As the engine composes most of the performant code, you should be able to do 99% of the work in Python.


As to interfacing Lua/Python with C++, both are fairly comprable. Its a relatively simple task, but can result in having to write a large amount of tedious "glue" code. You can use generators, but they tend to be problematic. That said, the glue code is horrifically easy to write, just as I said, tedious.

#10 DvDmanDT   Members   -  Reputation: 858

Like
0Likes
Like

Posted 29 June 2011 - 10:35 AM

I would recommend against C++. It lacks way to much of newer language features and easy-to-use libraries (there are tons of libraries, but rarely as easy to use as in Python).

Python is very nice for small programs/games/apps but for larger projects it can it can easily become messy. That goes for most dynamic languages which is why they are usually used together with engines written in lower level languages, at least in gamedev. My engine is written in C# and features Python scripting through IronPython.

I would personally recommend C# though. Simple, powerful, great toolchains, great samples/libraries/documentations and quite popular.

#11 Gasoline   Members   -  Reputation: 115

Like
0Likes
Like

Posted 29 June 2011 - 11:26 AM

Thank you all for the replies. I am looking into C#. I had always the idea that C# is pretty much Microsofts thingie and running it on anything but Windows would be problematic however after some quick research it looks like it is the right thing for me - easy, fast, flexible.
C# .NET

#12 Zahlman   Moderators   -  Reputation: 1682

Like
0Likes
Like

Posted 29 June 2011 - 04:37 PM

Python is a script language whereas C++ is a 'real' programming language.


Never mind whether this is an accurate description of the languages in question: this distinction hasn't been meaningful for years, to be honest.

#13 rip-off   Moderators   -  Reputation: 8121

Like
1Likes
Like

Posted 29 June 2011 - 05:46 PM

If you are serious about learning to program, you won't learn a single language, you'll eventually learn a dozen. Your first programming languages isn't a final choice.

I generally advise against C++ as a beginner language. This is because the language is designed around the principle "The programmer is always right", and makes no attempt to shield or alert you to many common but subtle errors. This principle is never true for beginners, and rarely true in general.

I feel that Python or C# are better places to start writing games. They don't present the same burden to start with, while being full, capable languages that you'll continue to use throughout your career.

Ignore comments about "real", "powerful" or "fast" languages. These statements, where they aren't totally meaningless or irrelevant, are often highly dependent on the state of the art at a particular time (often, that time is 5 years ago, ignoring advances in tech since). Often overlooked is the fact that a beginner won't be making a game that should* tax the system for quite some time.

* Its possible to write atrociously slow games in any language, by using poor algorithms. Using a naive collision detection in a simple 2D game can slow down a computer, even if hand optimised using assembler.

#14 Storyyeller   Members   -  Reputation: 212

Like
0Likes
Like

Posted 29 June 2011 - 06:10 PM

That depends on what you're doing. If you're say writing a chess game, you probably want the AI to run as fast as possible. It's not actually that hard to run into performance bottlenecks, though using decent algorithms helps.
I trust exceptions about as far as I can throw them.

#15 Jianju   Members   -  Reputation: 102

Like
0Likes
Like

Posted 30 June 2011 - 09:20 PM

I'm in somewhat the same boat; getting back into programming as a hobby when my main gig was always art & animation. I wish to make games & simulations, meaning speed will be of the utmost importance, leading me to want to use C++.

OTOH, I am tempted by some newer languages (including C99, Lua, Monkey, Java, Go...) & am looking for smart ways to call the many great, fast C++ libraries out there (OGRE, Bullet, etc.) to do most of the deep kung-fu for me.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS