PDA

View Full Version : Python



edyzmedieval
04-23-2006, 19:26
So, I started learning the Python language.:book:
www.python.org

Anyone know this language? Any feedback on it? Easy or hard to learn?
I want to learn this, along with modelling, so I can maybe start my own game in the summer. A couple from Turkey did that, which resulted Mount&Blade. Why can't I do that?

Thanks. :book:

LeftEyeNine
04-23-2006, 23:19
Sorry, I'll not be directly helpful but all I can say is that you have a good ambition, keep it going. Civilization 4 masterpiece is a game coded in Python and that should be enough to demonstrate its strength indeed. What's more, my homemate is a coding freak and he told me that his uncle had advised him a year ago, to start learning Python telling him that it was a really promising language to be very popular through the following years. And so it seems..

Keep it up! :2thumbsup:

edyzmedieval
04-24-2006, 20:41
So it seems. Mount&Blade is also made in Python.

Ok, started learning. ~D

_Martyr_
04-25-2006, 13:04
I'd say start with C++ and SDL, to write your first few games. C++ is still by far the most used language for gaming (and most other things at that...). SDL ( Simple DirectMedia Layer) is, from the website... "a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer", basically its a great set of libraries that takes care of most of the media and input/output of your game. Its a great place to start in my experience. Plus, having c++ under you belt will stand to you very well.

Believe me, no matter how tallented or hardworking you are, you wont be able to just start programming and come up with something like M&B. It takes years of programming experience, lots of experience with the process of creating games and lots of technical know-how. I'm not trying to dampen your enthusiasm. Just dont expect to be able to program anything too complicated in the very near future. Its a LOT harder and infinitely more complicated than it appears. Im a few years into my Electronic Engineering degree and Ive just completed my first real game, its pretty much a glorified Space Invader clone, but it took me a good few weeks, if not months of hard work, and long hours of coding, and Id consider myself not too shabby at programming with c++.

So in otherwords, my advice to you is to not aim too high at the beginning, whatever language you choose. The games you will be able to make in the first year or so will be more in the Tetris/Pong realm rather than something like M&B. If you aim too high you will just get really frustrated and quit. Good luck with whatever you do! :2thumbsup:

edyzmedieval
05-03-2006, 17:28
Constructive criticism. I appreciate that very much at a person. :thumbsup:

I thought of all the aspects you have told me. I am fully aware of what is necessary and what is what with all the programming around here.
I've been studying programming since the 6th grade(I'm now in the 8th grade), so I know how do you eat this thing. On the bad side though, unfortunately, I kinda slacked off the "writing" part of the programming, so I have to start the algorythmic stuff again.

I started C++ in the 5th-6th grade, in private. I went on really well, till I got to the informatics school, which unfortunately, was doing Pascal. This thing really messed up my brains, and I basically mixed up everything I learnt.

I still know the pseudocode, and how it works the stuff, but I need to learn again the "conversation".

As for my project, I hope I can learn and do something small first, then progress steadily.

Thank you for the tips again Martyr. :thumbsup:

_Martyr_
05-03-2006, 19:19
Sounds like you will be well on track then once you familiarise yourself with C++ again. As I said in the previous post, a great place to start is with SDL. It takes the sting out of making a simple game and lets you focus on your game itself rather than testing specific hardware conflicts or something, while still involving you enough so that you learn whats going on.

Download the library here: http://www.libsdl.org/index.php

Good luck! :2thumbsup:

edyzmedieval
05-04-2006, 09:55
Thanks for the appreciation and feedback.
I really need to get my "minds" back, as I need to learn again C++, on the algorythm part. Even though I did 2 years, I still don't know much unfortunately. Guess I'll have to start again. :embarassed:

Thanks for the SDL Library.

ZombieFriedNuts
05-05-2006, 12:47
I’m learning python in university good luck to you, still haven’t got the hang of it.
I was going to give a link to the worksheets we were using then I realised the lecturer didn’t put them on the web.

edyzmedieval
05-08-2006, 11:33
You need to read those tutorials carefully to understand Python. :skull:

I wonder how CA built their TW engine.... :help:

doc_bean
05-08-2006, 16:32
Well you probably know this already, but, some general programming advice:

1. learn object orientated programming (if you're using an object orientated language), NOT procedural programming in an object-orientated language. Of course, knowing procedural programming is pretty much essential in itself, but do know the different 'âparadigms of coding and when to use them. Learning how to program is different from just learning a language.


2. Document your code: you have to understand what everything does a year from now, at least, write what your code expects as input and what it gives as output: be complete and write in logic code if possible. This is the part about programming I really hate, but i've seen the benefits...

3. write simple tests for pretty much every function you implement, and keep running them when you change or add things. Correcting a 'completed' program is a *****, even correcting one class can be a huge undertaking. Intermediate testing will save you time in the long run.

4. Have fun ! Don't start a big project where you will only see the results years from now (it takes a year for a modern 3D engine to be build I think, and those are done by experts). Start with little projects and work your way up, or divide a bigger project into little pieces that have results of their own (like a graphical representation, a basic form of abstract game mechanics, a data handling system, input interface, etc.).

Good Luck !

edyzmedieval
05-08-2006, 18:19
1. learn object orientated programming (if you're using an object orientated language), NOT procedural programming in an object-orientated language. Of course, knowing procedural programming is pretty much essential in itself, but do know the different 'âparadigms of coding and when to use them. Learning how to program is different from just learning a language.

Python is an object orientated programming, so that's a big plus. :thumbsup: Plus, it says here it's easy to learn. It might be, but the tutorials are stuffed with material. :book:


2. Document your code: you have to understand what everything does a year from now, at least, write what your code expects as input and what it gives as output: be complete and write in logic code if possible. This is the part about programming I really hate, but i've seen the benefits...

At least I know the logic code good... That's a plus, makes you understand how the stuff works.

Well, I'm learning Python and C++ in parallel with other stuff, and I learn these in my free time. I gave up gaming for these, so I can do my own projects in the summer. :balloon2:

doc_bean
05-08-2006, 18:28
Python is an object orientated programming, so that's a big plus. :thumbsup: Plus, it says here it's easy to learn. It might be, but the tutorials are stuffed with material. :book:

From what I've read about Python it certainly seems like an interesting language. I don't like tutorials much since they're usually to slow for my taste, but they're a necessary evil, most of the time.


Well, I'm learning Python and C++ in parallel with other stuff, and I learn these in my free time. I gave up gaming for these, so I can do my own projects in the summer. :balloon2:

What's the project you are planning, if you don't mind me asking ?

edyzmedieval
05-08-2006, 18:42
First of all, I'll start something like Tetris, to keep my interest up.
My bigger project is a sort of RPG, Mount&Blade style only.

edyzmedieval
05-09-2006, 13:02
So I'm sort of halfway to making the Tetris in C++. Hope it works. Wish me luck.

If the mods don't mind(especially LEN, but he's easy to fool...Some Asian women and he's toast ~D), I'll keep my progress here.

LeftEyeNine
05-09-2006, 16:46
No probs for me as long as you feel it's suitable for forum scene. But Granpa may have something to say though.

Duke John
05-09-2006, 16:49
Have a look at Panda3D. It's a free 3D engine that can be accessed through Python.
http://www.panda3d.org/

edyzmedieval
05-09-2006, 17:05
Wow, it looks really nice. Check this project, which is so cool:
http://www.etc.cmu.edu/projects/orb/images.htm

For Python stuff, I'm learning Blender. Panda3D might be a suitable addition. ~:)

doc_bean
05-09-2006, 17:13
No probs for me as long as you feel it's suitable for forum scene. But Granpa may have something to say though.

I rather like the idea of a game development thread, it should certainly have it's place here imho.

edyzmedieval: which development environment are you using ?

LeftEyeNine
05-09-2006, 17:21
Feel free to use this for Phyton related development. Constructive and progressive threads would not bother in numbers, at least I feel so. Granpa ? ~:)

edyzmedieval
05-09-2006, 17:28
I rather like the idea of a game development thread, it should certainly have it's place here imho.

edyzmedieval: which development environment are you using ?

Yeah, it's a nice idea. ~:)

As for the environment, I am still learning Doc. Keep in mind, I dropped C++ some time ago, and I never knew anything about Python until 2 weeks ago. :juggle2:
I'll do some basic scripts first in C++, to get my skills on the track. :book:

Or what do you mean by Development Environment? :inquisitive:

ScionTheWorm
05-09-2006, 18:53
http://www.ogre3d.org/

you can't write a game like m&b in python using blender (if you mean the actual battle scenes)

python is my favourite language, though it performs about 11 times worse than a c++ application when using plain python loops. making a game as good as m&b would be very difficult alone as far as I know, if you're not experienced. c++ would certainly be required, m&b does not have that a high framerate in relatively large scale battles. using an engine like ogre3d from python could work though, but stuff like AI and other custom algorithms should be implemented in c++.

I'm starting to get pretty anxious about starting up a M&B mod, it has so much potential and yet it's so much easier to mod than rtw. wounder if I could get people interrested from this forum... :wiseguy:

edyzmedieval
05-09-2006, 18:57
I'd be interested. :book:
But only a bit, as I want to start my project.

I don't get the first parts of the Python tutorial...Any help?

doc_bean
05-09-2006, 19:24
Or what do you mean by Development Environment? :inquisitive:

Something like eclipse (http://www.eclipse.org/), which is primarily for java, but has python plug-ins I've read. Essentially a text editor for programming that points out the obvious errors and offers several functions for faster (and correcter) programming.
For instance if you have an object named thing (from a certain class) and you type "thing." it will give you a list of all the functions that could apply (like for instance thing.getName()), this way you don't have to remember every exact name you've used for your methods or variables. It will also point out every (in theory) error the compiler would give if you were to compile ate that moment, with access to a list of suggestion how to fix it (adding throw clauses for instance).


I don't get the first parts of the Python tutorial...Any help?

I don't know Python, but perhaps you could point out (and/or quote and/or explain) exactly what you don't get ?

edyzmedieval
05-10-2006, 12:09
You learn new things every day. :book:

The thing I don't get... The intepreter stuff. Chapter II of the documentation.

www.python.org/doc

:book:

EDIT: I kinda got the hang. The Interpreter is the Python program. Right?

LeftEyeNine
05-10-2006, 13:21
Oh interpeter and assembler are some very basic concepts, aren't they ?