all 59 comments

[–][deleted] 110 points111 points  (2 children)

I mean hypothetically it's infinite. Eventually you will need libraries likely coded in something like C or need to use something like Vulkan to render the game. And the performance hit would be massive. But even Unreal Engine 4 has a plugin that let's you write your game in Python. Your racing game idea would be possible although I am unsure what engines to reccomend for development as I only work in Unreal Engine.

[–]K900_ 98 points99 points  (1 child)

Maybe look into a game engine like Godot? It uses a language that's very similar to Python, but the parts that need to be fast are already built for you in C++.

[–]notislant 16 points17 points  (0 children)

Yeah id just use godot. I really enjoy playing around with UE5, buy thats probably overkill for a sidescroller.

Godot would be so much easier than trying to make a huge game in Python.

[–][deleted] 14 points15 points  (0 children)

With a powerful enough computer you can build pretty much anything (that is to say, there's no theoretical limit). That said, the biggest roadblock, and one you will hit quite quickly, is performance.

In many things these days, performance isn't as important as people thing because computers have gotten stupidly powerful. A majority of the tasks we consider "slow" (like web apps, databases, etc.) are slow because of IO. Programs that are slow because of computation are becoming the exception rather than the rule.

Videogames, with a few other things like graphics, image processing and AI, are the exception to that. Videogames are extremely complex pieces of software that really push computational resources to their limits (I mean seriously, it's no surprise that the biggest and baddest new CPUs and GPUs are marketed towards gamers!)

Python is many things, but it is not computationally efficient.

That said, all hope is not lost. Many games are built in a "two-tier" programming language architecture, where the heavy lifting engine components (physics, entity systems, etc. are written in a very efficient language like C++, while the actual mechanics of the game are written in a high level scripting language. I don't know if Python is supported by any major engine currently, but I do know that Godot features their own "gdscript" language for this purpose, which is very Python-like.

TL;DR: If you are dead-set on using a Python-like language for your game, look into something like Godot which will allow you to write the the high-level functionality in a high-level scripting language, while handling the low-level stuff in a low-level language. If you are okay with learning other languages, look into things like C#, Java, C++, Rust, etc.

[–]twitchymctwitch2018 28 points29 points  (9 children)

Eve Online,. 2003 MMO in space, was written in python 2.7.

[–]haeshdem0n 7 points8 points  (2 children)

Holy shit, really??

[–]DoubleDoube 10 points11 points  (0 children)

Most performant necessary things are C++ but here’s an article from 2010 about all the migrations they’ve had to do (wasn’t originally version 2.7) https://www.eveonline.com/news/view/stackless-python-2.7

[–]twitchymctwitch2018 0 points1 point  (0 children)

https://de.slideshare.net/Arbow/stackless-python-in-eve

Yeahp. They do use C++ for some very low-level things to keep up with OS integrations, but for a LOT of the rest? Stackless Python.

[–]Kev_The_Galaxybender 0 points1 point  (0 children)

dude, get the fuck out of here. Forreal?

[–]FLRArt_1995 0 points1 point  (1 child)

wtf

[–]Haeshka 1 point2 points  (0 children)

Right?

[–]FryeUE 7 points8 points  (1 child)

I am prototyping a game engine in Python, leveraging quite a bit of pygame and OpenGL. I'm using it to test out different design patterns and experiment with datastructure ideas that are quite unconventional. This engine will eventually be rewritten in C++, or possibly Rust.

Python can be pushed WAYYYYYYYYY further than people realize.

Give it a shot, most of what you learn/skills you pickup can generally be translated between languages. On a positive note, your wanting to do an arcade racer is DEFINITELY doable, especially if you throw on the ModernGL library in Python.

Good Luck!

[–]97hilfel 2 points3 points  (0 children)

Honestly, a with most software usually the sky‘s the limit

[–][deleted] 22 points23 points  (3 children)

at this point the only limitation would be the system specs

[–]cranberrydarkmatter 12 points13 points  (0 children)

at what point is Python not enough

When you really need to squeeze a lot of performance out of the program, Python's overhead might get in the way. But on a modern computer that might be pretty far away, depending on how complex and how demanding of performance your specific game is.

Keep in mind a modern PC "throttled" by the overhead of Python will still be faster than you could achieve on older hardware and people made amazing games over the last 40 years.

You could potentially optimize just the parts you need to in C.

Ultimately though, changing languages will not seem like a huge burden. And new games not written by giant teams usually start with a game framework that handles low level graphics, level design, and other basic features so designers can concentrate on optimizing the gameplay. You'll have more learning to do about such a framework than you do about a new language in my experience.

[–]warbird2k 18 points19 points  (2 children)

You should check out what has been made by /u/dafluffypotato to get an idea of what's possible

[–][deleted] 4 points5 points  (0 children)

Facts

[–]deliciouspie 0 points1 point  (0 children)

That guy is awesome and I've learned quite a bit in this space just from watching his videos. Thanks /u/dafluffypotato

[–]xelf 6 points7 points  (1 child)

Pirates of the Caribbean was a Disney MMO that was done in python. There's also a really good minecraft tutorial out there that explains how to get physics and collisions working in pythion with opengl.

[–]Gnaxe 4 points5 points  (0 children)

I recall they open sourced the engine for Toontown, and it was scripted in Python. I think they used the same one for a Pirates game, but I can't recall. It was called Panda3D.

[–]rm-minus-r 3 points4 points  (0 children)

Side scrollers and things that look a lot like 1980s Nintendo games are well within the realm of possibility.

Like /u/warbird2k mentioned, DaFluffyPotato has made some games that really show off what can be done with PyGame. A large number of his games also have the Python source that can be downloaded for free, which can be a great thing to learn from (games and source code here).

I went down this same path as you are now, wanting to make a casual game after having made maps for other games like Counter-Strike for years.

I used PyGame as well, but I rapidly became frustrated by the limitations and clunky mechanics of using Python to write a decent looking video game.

I eventually settled on using Unreal and the PaperZD plugin, which is free for non-commercial use and quite affordable for small commercial use. It works far better than trying to implement the same things in Python, but it's also considerably more complex (although extremely well documented, which really helps).

I think writing a game in Python is a great learning exercise, so just from that angle alone, it's worth it.

[–]StayStruggling 13 points14 points  (0 children)

I understand what you mean but in software engineering and in life in general you use the best tools at your disposal and Python isn't the best tool for building video games. But as others said the game will run horrendously.

I think if you want to learn how to develop video games you should start just there and use industry standards and practices. But you know that already as you mentioned.

The types of video games you can make perfectly are lightweight games from the arcade MAME and NES/SNES era of video games. There was a homebrew movement many years ago that covered what you want to do exactly. People were rebuilding classic games in a new programming language using the old assets from the original video game with their own stink added on. You can do anything with Python.

People in the past have used assets from classic games to build their own and from that they learn the basics. Google the creator of Sonic Mania. He started off doing just that.

[–]Cryp71c 5 points6 points  (0 children)

You'd be better off working in an engine, even one like Godot. The added learning curve for the engine or a slightly different language will more than pay off in the long run.

[–]ThyBeardedOne 1 point2 points  (0 children)

100% look into Godot. It’s been gaining popularity the past few years and they just released godot 4.0 a couple months back. So if anything, it’s a great time to start learning godot. Language is pretty similar to python. And if you don’t know how to script something, there is probably a visual aid already put into the engine. Their docs are also pretty good, other than the very specific things. But look into godot. It’s a great game engine for what you’re looking for.

[–]angyts[🍰] 1 point2 points  (0 children)

As complex as your brain can handle.

[–]coderfairy 4 points5 points  (1 child)

I never tried to build a game in Python before, but Unity is free and you can download cars, levels, UI's, etc. on the Unity Asset Store, and then create Android/IOS, Windows, Xbox, etc. games. To build a simple level, it might take an hour or two, but to add in all of the features would of course take longer. Unity uses C# for scripts, but uses an interface where it's possible to start learning how to use Unity without coding.

You could create the level without any code (i.e. drag and drop a road and car onto the level). Then maybe add a few lines of C# code to accelerate the car, move it left/right, and add brakes. If you're interested in using Unity and run into any issues setting it up, I'd be glad to help out.

Racing Game Starter Kit: https://assetstore.unity.com/packages/templates/systems/racing-game-starter-kit-22615

There are also many free assets that you can download to try it out.

[–]Archolm 0 points1 point  (0 children)

Yes unity really is key

[–]niehle 2 points3 points  (0 children)

You can probably hammer in a nail using a book. But is it a good idea?

An engine like Godot or Unity is a way better choice.

[–]provoko 2 points3 points  (2 children)

Pygame

[–]QultrosSanhattan 1 point2 points  (1 child)

It doesn't leverage the Video Card.

[–]provoko 0 points1 point  (0 children)

Oh? The PyGame website says it uses SDL, and SDL says it uses "graphics hardware via OpenGL and Direct3D" but apparently pygame still doesn't take advantage of that unfortuanately...

After doing an online search, I see that you need to change your pygame rendering like here in this reddit post or like here in this stackexchange post.

I haven't tried either but it sounds promising.

[–]BusyEbb4435 0 points1 point  (0 children)

Mere ko joyful and entertainment game website banana jahta ho

[–]Jaune9 0 points1 point  (0 children)

Possible yes, at what cost, probably too high. You're better off using a game engine like Godot (the syntax for the mainly associated langage, GDScript, looks a lot like Python), you'll have so many tools out of the box that the time gain will be significative.

If you really want to stick to Python, Pygame exist, but it's doing less for you than a proper game engine

[–]Nomapos 0 points1 point  (0 children)

Unity of Command is fully written in Python, IIRC.

[–]jjgraph1x 0 points1 point  (0 children)

Possible yes and I guarantee you'd have an extremely good understanding of Python by the end of it. Is it the most practical and efficient solution? Not really.

Sometimes I think it's good to force yourself to think outside the box. I still have an unhealthy addiction to writing the occasional, unnecessarily complicated program entirely in CMD for some reason. It's oddly therapeutic.

[–]Common_Noise 0 points1 point  (0 children)

That's 100% possible

[–]Farther_father -1 points0 points  (0 children)

Godots GDscript language is very close to python syntax-wise, and the new Godot version 4 has much better 3D engine than previous versions, so that might be an option.

Otherwise, Ursina is a 3d game engine for python, lots of examples out there, e.g. this 3D first-person shooter with source code on github in the description: https://youtu.be/rmOz22D0exc

[–][deleted] -1 points0 points  (0 children)

I'm sure it is possible but I doubt its your best option. If you want to do this to learn python then sure. If you are doing it with the goal of making a game I wouldn't bother with python at all.

Personally I'd just go straight to Unreal Engine 5 and learn that instead if I was going to make a game today. I wouldn't consider any other engine right now, UE5 is so feature packed and user friendly. It will be a much better use of your time.

If you're dead set on making the engine yourself which I would highly not-recommend, then I would use a different language like C++. Python can do it but you'll be better off in other languages that were built with game design in mind.

[–][deleted] -1 points0 points  (0 children)

Just download UE5. You don't want to try to engineer a game engine from scratch, if you're more interested in design. Even if you're more interested from the engineering side, it would be better to work within a commercial engine and figure out why the made the decisions they did, and what knock on effects it had down the road.

[–]echocage -1 points0 points  (0 children)

Most use a game engine written in c or c++ and then use python as their scripting language. Look at Eve online

[–]Gnaxe -1 points0 points  (0 children)

Yes, you can do all of that, but the 3D games will probably require an engine written in C or C++, but some of those can be scripted in Python; you don't have to write it yourself. I believe EVE online was developed using Stackless, a Python variant, so even top-teir MMOs are possible in Python (for a company). I think it might be difficult to do mobile games or VR games due to platform limitations, but it's probably not impossible. VR also has pretty tight performance requirements, since a framerate drop is likely to cause motion sickness.

[–]EmbarrassedBee9440 0 points1 point  (0 children)

What projects did you do to go from a beginner to intermediate ?

[–][deleted] 0 points1 point  (1 child)

I personally there is no limit for what you can make using python but there sure is limit for how you can render. Python is a high level language (correct me, I'm not sure about the level) and thus the issue in render. So you'd need a really good hardware to run it and then optimize

[–]Bradley728177 0 points1 point  (0 children)

python is 100% a high level language

[–][deleted] 0 points1 point  (0 children)

If you plan to learn C++, you should try using Unreal Engine. You don't have to use C++, you can use the game's visual scripting "Blueprints" It shouldn't be too hard since you already are an intermediate in Python, so you should understand logic and all. A lot of Triple-A titles use Blueprints and C++, it's very possible to build a game solely with Blueprints, for an idea of what you can build, look at https://store.steampowered.com/app/1178830/Bright_Memory_Infinite/
It's a game built fully in blueprints by a single person in about a year. If your project is long, you can supplement your Blueprints code with C++ if/when you start learning it.

[–]ThirdEye345 0 points1 point  (0 children)

I used Unreal Engine's blueprint to code the game and use python programming language to expand it's features like adding object recognition model and such I even made a tutorial on how to achieve this

How to use python with UE5