Pygame's Performance - What You Need to Know

preview_player
Показать описание
Many people say that Pygame is slow. Is it really?

Patreon:

My Projects:

Discord:

Potato Tier Patrons:
Keill
eivl

Timestamps:
0:00 - intro
1:59 - SDL's impact on performance
4:05 - Python's impact on performance
5:15 - other importants things to note
5:58 - what can you do with Pygame?
7:16 - things you shouldn't do with Pygame
8:15 - making games with Python but not Pygame
8:50 - outro

#python #pygame #gamedev
Рекомендации по теме
Комментарии
Автор

All gameplay footage shown in the background is from my own games. They're all open source (at least the ones that are released projects):

For those of you who are saying I’m wrong about SDL. Read the docs for the update from 1 to 2. It *says* it added hardware acceleration. SDL2 is very different from the SDL Pygame originally used (and I mentioned that in the video). SDL2 adds hardware acceleration and Pygame 2 will give access to that functionality. Pygame was created in 2000 and the development stalled for a long period of time, so it was never updated to use SDL2. Pygame 2 is a huge improvement over 1.9.x.

DaFluffyPotato
Автор

Description: Many people say that Pygame is slow. Is it really?

First Few Seconds: People say the Pygame is slow, *and that's because it is*

Geofinnstar
Автор

Small tip for pygame performance is to prerender images, if you´re drawing shapes and lines, draw it on a surface on load and then paint that surface on screen every frame, it will be a lot faster then drawing lines every frame... this is only for the case the lines aren´t moving relative to one another, because if not, it won´t make much sense to do that

badjano
Автор

You may not have heard of it, but there was a game engine developed using Python called Zero Engine, which was a proprietary engine used and created by DigiPen Institute of Technology whom I worked for and went to tech classes at. It was pretty alright. I don't remember too much, and I believe it was either discontinued or is simply no longer in use as many of the classes teach Unity instead.

Orionhart
Автор

Thanks for shouting out PyMunk!
Chipmunk is an amazing little physics engine and really deserves more love.

superscatboy
Автор

Cython is also perfect to optimize your games, :) and it's wonderfully easy. Cython translates your Python code to C. For a beginner it is as easy as just compile a pure python file with Cython. This alone can increase your execution speed by 2 - 5 times! You can then start to slowly add C-Types and functions. Cython in fact is so good that it beat most code written directly in C, at least if you are just an average programmer.

prometheus
Автор

A nice and informative video. Just to add some more, there are a lot of ways to increase speed of python code, like using numpy for heavy array and matrix calculations, writing your own C extensions, using another python implementation like PyPy or mixing your code with language extensions like Cython.

luisernestodeltoropena
Автор

Just discovered this channel and im already a big fan of it.

luisangel-ztop
Автор

You have some of the most awesome videos on game dev. It's awesome you've been able to monetize your products as well.

PerryBattles
Автор

Thank you, this argument has been a pain since the beginning, even tho, for the moment, I’ve never had performance issue with pygame (always converted image and avoided to write useless code)

dicember
Автор

since i started working on shader work, i moved to godot, but i'll always have a special place with learning pygame as it taught me all the basics of programming

snesmocha
Автор

Honestly. PyGame for 2D games is perfectly fine in terms of speed although I would say that a language that desperately needs more libraries or docs for existing libraries is the nim programming language. It manages to get that beginner friendly rapid code development down, while still being a fairly high performance statically typed language and yes I am a little biased, cause it is similar to Pascal mixed with Python. Bite me for likeing Pascal I guess XD. SDL2 does already have a wrapper in nim for those who are wondering.

corelysium
Автор

Big fan of your content. Do you plan on making more in depth pygame tutorials in the future and advice to beginner programmers?

Moon-wnrm
Автор

I always enjoy these discussion vids from you

CDcodes
Автор

Your pixel art and animations look great!

stickzman
Автор

6:11 Randy: I'm gonna pretend like I didn't see that...

jfklittle
Автор

Amazing video, as always! At 8:35, UPBGE (basically blender game engine) is a 3D game engine that uses python. I'm also writting my own free engine (Cave Engine) in C++, but scriptable in python.

UnidayStudio
Автор

Great video!! You really show off its full potential!

dawndev
Автор

Pretty much answered all my questions. Excellent

thecombatcactus
Автор

with my optimized tile system when i stress test, i can load around 1.3k individual tiles with around 70 fps
i guess i have to check out your video on the particle system

TheHungarygamer
welcome to shbcf.ru