Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How "slow" is python for game development? [closed]

I'd like to try my hand at some PC game development. I keep hearing that python is slow compared to C++. Is this something I should be worried about?

I am more familiar with python than C++. If I'm looking to make some games, should I take the time to learn C++ or just stick with Python?

like image 444
Johnny Avatar asked Jan 02 '11 12:01

Johnny


People also ask

Is Python slow for game dev?

Python is estimated to be over 25 times slower than C++, which is a really huge difference, especially when it comes to game development—after all, every millisecond is worth its weight in gold in this business! However, any Python developer who dreams of writing their own game shouldn't be put off by this right away!

Is Python viable for game development?

Python for game development provides support to 2D graphics along with 3D graphics, which makes it one of the most popular languages when it comes to programming games in general. It has many libraries and frameworks available that make game development easy.

Is Python or C++ better for game development?

For example, C++ is often used in embedded systems, game development, 3D or visual design programs, as well as for building operating systems or web browsers and portals. On the other hand, Python is a scripting language that is ideal for machine learning contexts, data analysis, and backend web development.

How much slower is Python?

For reference, there is a great GitHub project evaluating performance across a dozen+ languages. The summary table is included below, and if C++ is a baseline of 1, then Python is a whopping 227x slower on the brainf test (which is a pretty interesting Turing Machine interpreter).


1 Answers

There's a difference in being slow for development and being slow at runtime. Be careful not to get the two confused.

Many games spend most of their time waiting for user input or waiting for a timer to tick. In these cases the runtime speed is generally of little importance and more important is the development speed - getting your game to market as fast as possible and as cheap as possible, and making the game as good as you can with your given budget. For this type of game high level languages are an appropriate choice.

For games which require high performance generally the engine is written in a language like C++ but the scripting can still be done in a high level language. Python isn't the only choice. Lua is probably the most popular choice for a scripting language in games.

like image 139
Mark Byers Avatar answered Oct 05 '22 10:10

Mark Byers