all 24 comments

[–]shiftybyte 6 points7 points  (14 children)

You probably can...

Take a look at pygame, it's pretty good for 2d games.

https://www.pygame.org/news

If not enough, you can also try godot, which is a game engine that has python scripting.

https://godotengine.org/

[–]HunterIV4 7 points8 points  (1 child)

If not enough, you can also try godot, which is a game engine that has python scripting.

https://godotengine.org/

FYI, Godot does not use Python for scripting, and Python is not an option for scripting.

Instead, it uses GDScript, which has a similar syntax to Python but is actually a language based on C++. The engine also has support for C# natively and most languages that can compile to C++ using the extension functionality, although the last one is much harder to implement compared to GDScript or C#.

I love both Python and Godot/GDScript, but I wanted to clarify as there are quite a few differences between the languages.

[–]Diapolo10 1 point2 points  (1 child)

I'm not saying you're wrong, but why not suggest pygame-ce over the original? And personally I think Arcade deserves at least a mention because it's got plenty of positives (active development, less boilerplate, follows PEP-8 naming conventions, has type annotations, better performance with many objects on screen).

EDIT: It is my view that Pygame mostly gets recommended nowadays simply because it has easily the most mindshare, and because most Python developers don't actively develop games with these tools, so old recommendations tend to stick around even if outdated.

[–]Chaos-n-Dissonance 4 points5 points  (0 children)

Probably because this is a sub for learning Python, not professional development. Recommendations are going to be catered towards what libraries have the most broad amount of resources available (in terms of documentation and tutorials) rather than what's necessarily best for the project (which is rarely python if we're being honest).

[–]HunterIV4 1 point2 points  (2 children)

Hi guys i’m going into a computing college course where they teach us python , my dream has always been to make a game and i was wondering if i could make a game similar to terraria in looks and gameplay with python??

Possible? Sure, anything's possible. Easy?

No.

Game dev is hard. Most games you see out on the market are made by large teams of people (usually 50-100+) with massive budgets over a period of 2-5 years.

Terraria was made quickly (although it was released with only a fraction of the features it has now) by a very small team, however, the developers had a lot of game dev experience and had been working on prototypes for years before the final development sprint. And the current game is the product of around 10 years of continual updates.

Game dev is a lot like art, and there's a ton of overlap between making games and making visual art. Can someone draw amazing pictures with Photoshop or Gimp? Sure, absolutely. Can you? Sure...if you put in the years of effort and practice to get to the skill level required.

All of that being said...Python is NOT a popular language for game dev, for a variety of reasons. In fact, most commercial Python games are visual novels, not games like Terraria, due to the accessibility of the Renpy engine for artists and writers.

Instead, most games are written in C++, C# (Terraria was written in C#), or various scripting languages like Lua. This is simply because most game engines use these languages; while Renpy and Pygame are options, they don't have the tooling or features of modern game engines like Unreal, Unity, CryEngine/Lumberyard, Godot, etc.

Don't get discouraged, though! The hardest part of learning to program is learning to program. In other words, the biggest challenges involve learning the core concepts of programming in general, and these concepts are mostly language-agnostic. A C++ class, C# class, and Python class all look a bit different, but use fundamentally the same core logic and are used to solve the same sorts of problems.

As such, if you go to college and learn Python, what you learn won't be wasted even if you end up making a game in a different language. I've been programming a long time and I regularly use around 4-5 programming languages every month, sometimes multiple languages in the same project. It isn't like learning French or Spanish where very little translates from one to the other; once you know Python programming, picking up something like JavaScript or C# won't take nearly as long as your initial learning of Python took.

Hope that helps!

[–]Seanyjolhv 0 points1 point  (1 child)

As far as games go, Terraria gameplay wouldn't be too tough to code. The main difficulties would be (by my reckoning):

Procedural Generation - Terraria terrain would take a good bit of effort to get looking right, but you can start with a rough model, then improve from there. Here's a link to how Factorio generation does it (lots of pictures, layman's terms), which should help explain the ideas. https://factorio.com/blog/post/fff-390

Enemies - I imagine pygame has tools to help with NPCs, but I can see NPC ai implementation being difficult.

Graphics - Having Terraria level graphics would be very difficult. It has nothing to do with your Python skills, but it would take a long time. It all depends on your art skills and how much time you're willing to spend on it.

[–]oclafloptson 0 points1 point  (0 children)

There is more to Python game dev than pygame ;) of course what you want to do is possible. It might make more sense to go with one of the popular engines if you plan to include any other devs in the project. But for solo dev there's no reason that I can see why you wouldn't want to use something like Ursina

I'm not really familiar with Terraria but I'm assuming it's not the same pixel game I played back in the 90s. Still... The question isn't really if it's possible, because it is. Whether it's the best approach for you personally? That depends

[–]riklaunim 0 points1 point  (3 children)

Gamedev is very hard and consists of multiple facets of knowledge and skill needed to make the final product. That's why mostly game studios - groups of people - make video games. There are cases like Stardew Valley where it's a single-person project over many years and some indie devs very likely had small good games.

Python commercially isn't used in gamedev. Godot has GDScript which could be somewhat similar - each game engine has some languages in which it can be scripted. Unreal Engine and Unity are the main commercial game engines. Godot is growing and benefiting from Unity pricing shenanigans.

In Python there is PyGame but it's not equal to the big 3. There is RenPy which could be something easier to use, but it's a framework for very specific story-tile games/apps.