Python In Realtime...

Hey…Okay I’m learning python
and I’m not very far into it yet but i’ll ask in advance so i can get on the right track…Ive read here that your game goes alot faster if you use python. Is that true?and how would i incorporate than into the game engine…Thanks Chuck

Saluk has written a very good tutorial for beginners:
http://mysite.iptic.com/spinhead/blender.html#python1
I don’t really know whether games run faster with python, I haven’t tried it yet, but probably Python makes it run faster.

converting logic bricks to python does indeed make your game faster. although im not sure how much though.

Hey thanks for the replys…
I’ll check out the link…

Chuck

python does not make your games faster than logic bricks. However, imagine your character has two modes. and certain buttons can do different things depending on the mode. with logic bricks a property logic brick would be test to check your MODE property you have set up, and check if every other sensor was true or not.

In python you could have an If statement which said

IF mode = 1 then check all this logic sensors
Else, then check all this logic

This means that each frame depending on the mode it only has to work out that modes logic rather than the whole lot.

However in certain cases python would make no differnce.

in more advanced terms. in python you can have nested logic. logic bricks cannot be nested. nesting saves processing power
-Luke

hmmm…i thought i read ages ago that python scripts can be evaluated faster than a lump of logic bricks, not just because of nesty stuff but just in general. Awwww i don’t know, it works so what the hell! :slight_smile:
But, never the less i got a 10 - 15 fps increase last time i switched from logic bricks to python so its definately worth it

cheers
Piran