Python and game programming

iDevAwesomeGames
Unregistered
 
Post: #1
Ok, I am 12 years old and I started programming about 2 years ago. At the time I learned python and dipped into C++. I had to give up programming due to school and personal life. Now I'm back anyway and have been playing Eve-online for a while which I think is an awesome game.
I have decided that I would, in the future, want to attempt at creating an MMORPG. I know that this requires a lot of hard work and time and that it is an enourmous project to attempt.
I would like to start creating games in Python since that is what I know best and seems to be a good programming language. I do however want to then later on create my mmorpg in python aswell of course so I don't need to learn a whole new language.

Is this possible to do with python or should I learn a different language? If I should learn a new one which one would you recommend?
Quote this message in a reply
Member
Posts: 283
Joined: 2006.05
Post: #2
You probably wouldn't want to do the whole game in Python, because it's likely to be slow. But lots of games have the engine written in C or C++ and then use a scripting language like Python to control the game logic and AI, and to make it easier to add to. You might want to consider doing something like that.
Quote this message in a reply
iDevAwesomeGames
Unregistered
 
Post: #3
That sounds good. I have gone through several C++ tutorials and most of them were interesting but not a lot of fun to read. Would anyone know of any "fun" to read tutorials for C++ or Cocoa?
Quote this message in a reply
Moderator
Posts: 1,560
Joined: 2003.10
Post: #4
Once you've learned one programming language and worked with it for a while, learning a new one is significantly easier. Many concepts carry over quite cleanly. In terms of developing such a large-scale game, having to learn a new language is going to be one of the least of your worries.

If Python is working for you at the moment, you may be best off sticking with it and learning the basics. Once the environment becomes a limitation for things you're doing at the time, it may be time to move on to something else. Getting a strong background in all aspects of game development is far more important than mastering a single programming language.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
As has been said, once you know one language, learning more is easy. And yes, Python is a perfectly good language for programming games.

PyGame is a game development environment for Python; I haven't used it personally, but I believe other people around here have.

Good luck with your learning Smile
Quote this message in a reply
iDevAwesomeGames
Unregistered
 
Post: #6
I somehow haven't been able to find a compiler for python. It seems I need to have python installed to run whatever I right in it. Is this correct or am I missing something? 0.o
Quote this message in a reply
Moderator
Posts: 682
Joined: 2002.11
Post: #7
Python comes preinstalled with OS X. You'll need to download the compiler from python.org though, I think.

My web site - Games, music, Python stuff
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #8
There is no "compiler" for python. Everything you need comes preinstalled.

At a terminal, run "python yourpythonfile.py"
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #9
You might be confused with the fact that you can "compile" .pyc bytecode files. This isn't compiling in the usual sense, but more of a pre-parsing step. It's not necessary, and I seem to remember it being somewhat complicated.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
iDevAwesomeGames
Unregistered
 
Post: #10
Yeah you have to open the source file and press run. Meaning that you couldn't distribute a game without giving people the source code. Thank you for all the responses as well. Smile
Quote this message in a reply
Moderator
Posts: 529
Joined: 2003.03
Post: #11
There is py2app which I freely admit to not quite understanding how to use.

"Yes, well, that's the sort of blinkered, Philistine pig-ignorance I've come to expect from you non-creative garbage."
Quote this message in a reply
Moderator
Posts: 453
Joined: 2008.04
Post: #12
I would not rule out using python for the whole project. You're probably planning a pretty small mmorpg (in terms of number of users). There is a much greater advantage in the ease of development in higher level languages and that will outweigh performance issues at this stage of the game. Unless you have a client that has a very expensive 3D redraw loop, I wouldn't worry about it. If you do expect a lot of fancy graphics, consider writing the client in C or look at how python can interface with opengl and native code.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #13
However you look at it, you're going to be drawing with GL. That should be fast whatever language you use to call the GL functions from. The speed of the clients is unlikely to be a problem, and if it turns out to be, you can always selectively rewrite bits in C.

The speed of the server is a different question entirely, but not one I have any way of guessing, having never written an MMORPG... but heck, by the time you're at that stage, computers'll be a heck of a lot faster anyway Wink

Python automatically "compiles" .py files into .pyc and/or .pyo files as it runs them. If you don't want to ship your source code, you can ship just the .pyc files, which are somewhat harder than Java to reverse-engineer (and there are plenty of commercial outfits shipping Java games).
Quote this message in a reply
Member
Posts: 28
Joined: 2006.12
Post: #14
I like using python for high level programming so I'm wondering is pyGame fast enough for complex 2d graphics?
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #15
Ummon Wrote:I like using python for high level programming so I'm wondering is pyGame fast enough for complex 2d graphics?

How complex is complex? If you used OpenGL, you could get pretty fancy. In a 2D game, you'll likely end up with the video card's fill rate being the main bottleneck if you keep the number of method calls down.

A language like C will always be faster, but Python might be sufficient for what you want to do. The only way to find out is to try.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Upcoming Multiplatform Game Programming Book for Beginners JazonYamamoto 3 1,404 Apr 14, 2014 05:55 PM
Last Post: JustinFic
  Game engines with object programming JonnyThunder 3 8,186 Aug 16, 2010 10:42 AM
Last Post: SethWillits
  free mac game programming book jaked 4 6,757 Jun 8, 2009 12:48 AM
Last Post: SethWillits
  Game Programming Tutorial markvw 0 4,293 Jan 27, 2009 05:10 AM
Last Post: markvw
  Game Programming for iPhone? Help with Cocoa and MVC. holografix 7 6,641 Jan 22, 2009 08:17 AM
Last Post: AnotherJake