Advertisement

Side scrolling infinite platformer game python or c++ ?

Started by December 01, 2016 12:50 PM
2 comments, last by davidqueen 8 years ago

I need to know the pros and cons of using python or c++ for developing a builder for infinite side scroller / platformer game.

The reason i am asking this is because I read up a few blogs where it was mentioned c++ is better when it comes to rendering graphics whereas python is better when it comes to implementing the logic.

But what about procedural generation of terrain for infinite side scrolling games with all physics parameters incorporated. Does python suit better for that as compared to c++ ?

Are there some limitations when it comes to implementing physics with pygame?

Is it possible to build an engine on top of pygame in which we can define the parameters for every object and terrain and use the physics simulation already available in pygame?

In simple words is it possible to build something like gamesalad on top of pygame? or it is ideal to create that using c++.

Python is an easier language to work with, across the board. Well-written C++ runs significantly faster than Python. Those are your 2 main concerns.

Neither is really 'better' at graphics, or logic, or procedural generation.

Pygame doesn't include a physics simulation system. There may be 3rd party ones available. Most of the physics engines are written in C or C++ and then they can often be used with Python as well. Box2D is one example.

The tooling side of Gamesalad is certainly something you could make in Python, but it would be a large undertaking to do so. But then it would be a large undertaking in C++ too. The features you need from your "builder" are even more important than the features you need in your game, when it comes to how complex this task would be.

Advertisement

It really depends on your goals.

I'll describe which goals you'll achieve with each:

C++
- Good 3D graphics.

- Usage of low level api (More control- Harder to master/learn)

- Building big games.

- Be in the industry standards.

- You have time.

Python:

- Good for 2D.

- Fast development.

- Low on budget. (In case you want to sell the game).

Other goals that are not mentinoed here are pretty much equal.

The Biggest deference is speed.. You can have a prototype of your game written in python in an afternoon. C++ executes faster. python has a super extensive third party library collection which means most of the grunt work is already done. Also. pretty much all platforms have a python interpreter available, meaning, as long as you follow pythons conventions(using the Path class, etc) your program would run on win32, linux, and mac.

HOWEVER. python has a very long( comparatively speaking) execution time. if your game is even a little graphically intense, you will have a lot of frame rate issues. C++ on the other hand is super fast check out a project called irrlicht, it is a supper easy to use graphics engine, that is lightweight and fast. To answer your question directly about the side scroller, if its is 3D and you plan to add a lot of effects to make it look cool, stick with c++. but if is going to be really simple ( or simple 3D) python will have you up and running way faster. That may be very important if you are working by yourself.

help with panda3D(popular python graphics engine)https://www.panda3d.org/manual/index.php/Performance_Tuning

irrlicht project:

This topic is closed to new replies.

Advertisement