• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Eamonn Dev Rea

Is Python underestimated with what it can do?

33 posts in this topic

I've read various articles, blog posts, etc on Python: All of which list it's pros and cons, though they tend to either say it's slow or good. It's said to be a good beginners language: And I whole heartily agree. Any programmer can admit Python is a great beginner language. It sets a good example for OOP and encourages people not to use D&D Programs. But, alas, it is said to be bad as well.

 

Python not for game development? Panda3D, Unity of Command, Frets on Fire, Toontown, EVE Online

 

But, a lot of people argue that you should not use Python because of speed. Some say it's too slow for anything, others say it's good at some things.

 

So, my question is: Is Python underestimated? From what I can tell, it seems to be a fairly good language, and it being so simple to pick up makes it a great language. Google Chrome is partially written in Python. Some of Linux is written in Python.

 

Obviously Python would not be capable of a high-end Call of Duty clone, but really, the only language suited for that is C/C++ simply due to it's speed.

 

So, what is Python's limits? Is it as good/bad as people make it out to be? I recently finished a programming tutorial series on Python 2.7.2, and it's really got me into Python.

 

A lot of programmers start with Python now-adays, but they tend to only start with Python.

 

I'm not sure if it's true, but I've heard of some viruses being written in Python as well. I've heard you can do a man-in-the-middle attack with Python, using a certain library. I wouldn't like to do this; not only because it's illegal, but because I believe there are other languages better suited toward this. Also, I'm not so sure it'd be easy to cover your tracks in Python.

 

Python is also meant to be quite good at making the GUI's, and letting another language like C or C++ do some of the heavy work.

 

All in all, this is just to satisfy my own curiosity. In my opinion: Python is a great language! I often use it to test some ideas for game development quickly. It's fast at prototyping ideas, I'll give it that.

 

Also, I'd like to point out that Gimp was written in C/C++, and it's quite slow at responding a lot of times. I find that writing GUI's in Python is actually quite fast(for the coding of it and for the response time). So I guess some of it depends on how efficient your program is.

1

Share this post


Link to post
Share on other sites

You described it well: Python is good at making tools. Integrating it with Java could mean making GUI's in Python(since it's so simple to do so), and have Java do the heavy stuff. I believe Minecraft uses Jython.

0

Share this post


Link to post
Share on other sites

Obviously Python would not be capable of a high-end Call of Duty clone

Some parts of call of duty ARE written in a slow, interpreted language... So actually, python definitely could be used to replace those particular parts of the COD code base.
AAA games are made using many languages, exploiting the strengths and mitigating the weaknesses of each of them.
2

Share this post


Link to post
Share on other sites

Some very interesting replies. Python will never replace C or C++, but it doesn't need to. You can write C in Python, and C is pretty much as fast as Python. I think you can also write C++ in Python, though you might need a library or something. I've never looked into it(mostly because I'm not too fond of C++, and just really don't want to look into C Python until I've learned a lot more of Python(e.g. How to parse XML and JSON and such)).

 

It's fast prototyping makes it a valuable language, as a few people mentioned.

 

It's good to know there are efforts to make it faster. I saw a benchmark somewhere, and it said that Java 7 was slightly faster then Python, but Python's catching up. Java is a good language for game development(at least IMO), so does this mean if Python gets "much, much" faster, it would get as fast(if not faster) than Java? Either way, if it's almost as fast as Java, that's proof enough for me that Python is underestimated and under-ranked.

 

I'd also like to say that Python might not be good for writing games entirely, but maybe as a scripting language for games. For example, World of Warcraft was written in C/C++, but uses Lua for scripting.

 

Another thing: Python is faster than Lua, I think. I saw a benchmark somewhere comparing Lua, Python, Java and C#(C# won, By the way). This is strange, because Garry's mod is mostly(if not entirely) written in Lua. I've briefly played Garry's Mod, and I didn't see any performance issues. At the very least you can write add-ons in Lua, but even then they are very responsive. I'm not sure about this, and haven't seen anything to back this up, but apparently the guy that wrote Garry's Mod made a language based on Lua to code it. What leads me to believe this is false is that when the game is loading, I see it says "loading *.lua". If it was written in Lua, and Python is faster then Lua, then could you not write a game like Garry's Mod in Python? AFAIK Lua is interpreted too. I did get a little side-tracked, but it's still got to do with Python.

 

If Python got faster then Java, it'd be the ultimate beginners language because:

 

1) Easy to learn

2) It'd be fast -- Assuming we're in the future when it's "much, much faster"

3) You could write basic 3D games in it(Panda3D)

4) You could write an awesome 2D game(PyGame, PyGlet, Cocos2d)

5) It can be used as a scripting language in games

6) Kids can learn it easily, helping young people get into code the right way(not using GameMaker or anything)

 

Also, CoD games are usually not written in a language at all from the developer, from what I've heard. If they are, it's usually C/C++, but not often. They usually use Game Makers like Unreal Engine or UDK or something. Maybe this is false, but I thought'd I'd put that out there.

 

Don't get me wrong: I love Python, I really do, but I just wish it could be used for more uses and people saw how much of a good language it is - For beginners and Experts alike.

-4

Share this post


Link to post
Share on other sites


I think it's hard to work with on projects of scale.

 

I agree with most of what you've said, except for this statement. Although I don't know understand exactly what you mean by "projects of scale", I'm going to guess that you mean "large projects". Feel free to correct me if that is not what you meant. If it is what you meant, this is simply not true. OpenStack, for example, is written in Python: http://www.openstack.org/. I would consider this to be a large project, anyway.

 

As a side note: Python is great for scripts, one-off tools, and quick-and-dirty prototypes, but anyone who says that's the _only_ thing that it's good for has probably never written a significant application with it. (Source: In my day job I develop on an open-source seismic hazard assessment engine, which can run regional and global scale calculations and is entirely written in Python. See http://openquake.org/.)

1

Share this post


Link to post
Share on other sites

All languages seem to get degraded, lets just call it language insecurity or e-religion, I mean if you compare the language comparison threads with theological comparisons you would actually be quite amused on how similar they are, which would probably explain why some people are obsessed with defending their language of choice while criticising others and religiously sticking with it lol.

 

The important thing is that you are learning / increasing your knowledge, it doesn't matter if its C, Python, C++, C# or even assembly, the more you practice the better you get (providing ofc you are actively learning and not just assuming stuff in other words making mistakes) and the closer you will get to your compiler God.

Totally agree with this. I think that instead of discussing "what makes language X is better than language Y, Z, etc.", I think it's more worthwhile to discuss "what makes language X good", period. Otherwise, it's just religion, complete with witch hunts and stoning. =P

2

Share this post


Link to post
Share on other sites

We use Python for our build server and it works great, as for games, it is certainly a powerful scripting language but we prefer lighter alternatives such as using native C++ (which the rest of the game is written in anyway) for (compiled) game scripts. Less effort needed for writing binding layers and there are very little speed issues ;)

 

One great example of where python was used was Vampire the Masquerade Bloodlines. It allowed the community to fix the bugs and expand the game, long after support was dropped by Troika Games (RIP). If I was writing a heavily scripted RPG game, then python could possibly be a great choice because I personally find Lua a little too light on standard functionality (i.e it can be fantastic but only if effort has been spent creating i.e maths libraries for it).

Edited by Karsten_
0

Share this post


Link to post
Share on other sites

I often thought "Well, if you can write C in Python, does that not mean you can write a game library in C and call it from Python? Then, really you're using a C library, but with the beginner friendliness of Python!". A great example of this IMO is PyGame: Basically a very thin wrapper of SDL for Python. I, personally, don't like SDL, and maybe that's why I dislike PyGame. You have to do a LOT of stuff yourself e.g. function intervals(for an update/draw function), you have to check for key presses yourself, etc. For C++ I think SFML is a great choice. There is a Python wrapper for SFML, which is probably due to SFML being based on C++, and like mentioned before, you can easily port a C/C++ library to Python with effort. Lua is meant to be great for porting C libraries. I agree, Lua is a little light on the base, but isn't that the point of Lua? It's designed to be lightweight, and part of that is good and part is bad. Good, meaning it's easily implementable in your project(part of the reason a lot of game companies use it over other things like Python or Squirrel), but bad because it doesn't have stuff like OOP or '+=', '-=', '*=', '/=', '++', '--', etc. OOP is easily implementable via tables and metatables though. I, personally prefer Python's way of handling OOP. 

-1

Share this post


Link to post
Share on other sites

It's quite easy to spend a large amount of time describing small features that, for you, mean your language of choice is "the best".

I will start by saying that I love Python. I find I enjoy writing Python more than C++, JavaScript or PHP (and a few other languages in the mix).

Firstly, one of the reasons that we have so many languages is in simple terms, because one person may write a language around one core concept, and thus realising applications / libraries that work with that concept is much easier / runs a lot faster.

 

One of the significant misconceptions about Python is speed. To some extent these are unfounded. A large proportion of benchmarks that "observe" this result involve a script which is unoptimised. Now, first of all, by unoptimised I don't mean squeezing every last processor cycle out of your application. But, I find that in Python, it's easier to write a slow application because there are many ways of realising an end goal, and not all of them are a good choice in respect to the speed of the application. 

However, some of the concerns are valid. Python is interpreted, and with that there comes a loss in performance, with a gain in flexibility. I'm very much interested in PyPy, because there benchmarks (and others using it) are converging upon that of C, and in some optimised cases, outperforming it for certain tasks. Now, the latter is a case of optimisation, as mentioned by a previous poster. It's hard to compare language speed overall because it comes down to where you want to compare (the sample application). 

 

Anyway, I believe that it is inevitable that Python will find itself increasingly at the core of games and large scale software, but whether that's in CPython, PyPy or another implementation remains to be seen.

0

Share this post


Link to post
Share on other sites

[Lua is] bad because it doesn't have stuff like OOP or '+=', '-=', '*=', '/=', '++', '--', etc.

Operator overloading has nothing to do with Object Oriented Programming. Absolutely nothing.

^This. Also, in my engine's Lua bindings, I choose not to use the ":" operator.
i.e. instead of writing object:method(arg), i write class.method(object, arg)
...but it's still OOP tongue.png
1

Share this post


Link to post
Share on other sites

As a programmer who's been using Python to make games for a few months now (Check out my developer blog to see the code for some basic projects like Pong and Breakout coded in Python), the performance has more to do with how aware you are of python's limitations. I've known since I started Python how fast I could expect it to run and how I would code in it, so I coded using the mindset that I should write the fastest, most readable code I can. And I would only "optimize" it whenever it was actually slow.

 

So far its been great. For Three-Dimensional games it will probably be just as good if you use the proper algorithms to render efficiently.

0

Share this post


Link to post
Share on other sites

I didn't say anything about this magical weird thing called "operator overloading". I thought they were math shorthand operators.

 

I also said "Lua is bad because it doesn't have stuff like OOP or [...]". I used OR.

 

I didn't think Python was as popular as this. There's only 1(mostly dead) forum for it. Strange and cool :D

0

Share this post


Link to post
Share on other sites

Are you  betraying Lua/Love2d ? If you keep changing  languages that does not mean you can do python games..You should be ashamed.

For 2D games you don't need a super language because you are not doing to many calculations and things like this.So don`t worry any more about performance,do games ! Anyone on this forum can say that the performance in a 2d game will always be in any language's okay,of course if you are not doing stupid calculations.]

 

Edit:Maybe if you want to make the next Limbo,Braid or Terraria you should pick C#/Monogame , Java/Libgdx or C++ if not choose anything else and it will be fine

Edited by vladmihail
-4

Share this post


Link to post
Share on other sites

I don't understand what is happening in this thread.

 

Interpreted languages and VM languages are not intended to replace their lower-level counterparts. You don't drive nails with screwdrivers and you don't screw things together with a hammer, but you use both to build a house. It doesn't make sense to try and start a competition between the hammer and the screwdriver. You use tools appropriately for the task at hand. 

2

Share this post


Link to post
Share on other sites


Interpreted languages and VM languages are not intended to replace their lower-level counterparts.

I don't see any particular reason why not.

 

Microsoft research wrote an experimental OS entirely in managed code, and there are rumours that they may be commercialising it.

 

If your OS isn't written in native code, why should anything be?

0

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0