Crystal Space
Welcome, Guest. Please login or register.
April 24, 2014, 09:29:41 pm

Login with username, password and session length
Search:     Advanced search
8990 Posts in 2037 Topics by 7628 Members
Latest Member: Majstersztyk1989
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  General Crystal Space Discussion
| | |-+  Python Experiments and Problems
« previous next »
Pages: [1] Print
Author Topic: Python Experiments and Problems  (Read 2141 times)
Ruel Haldi
Newbie
*
Posts: 18


View Profile Email
« on: October 28, 2005, 06:14:53 pm »

I've been looking for a good 3Dengine for Python scripting. Did a little jig with Panda3D, but it doesn't support Blender imports yet, so I moved on. Looking around, the best choice seemed to be CrystalSpace, but there was very little information available. Regardless, I've had enough failed engines that I wasn't afraid to try one more. Besides, it has mirrors! You can't go wrong with mirrors.

So first, I looked for a binary so I could use it as a Python module. Nope. Bummer. Oh well, I had some experience with Ming and Msys. I'd compiled other 3d engines in the past. No problem. Well... after much frustration, 9 straight hours later, it was compiled correctly. I could probably write a really good article concerning all the things to doublecheck when you are compiling. I must have hit them all. Order of installation (first the libraries, THEN the ./configure) is critical, but after 6 hours or so, I wasn't thinking straight anymore.

Regardless, it works. I tried out the sample applications (walktest) and whistled happily. Next, I moved to the Python scripts and hit the next wall. I'm using a Windows machine, so settting the PATH for Python to find _cspace.pyd was very important. Eventually, I got the right combo. TADA... it sorta works now. Since I was interested in the "Pure Python" approach, I quickly moved to the second set of tutorials. Which don't appear functional. Perhaps a bug in the latest snapshot? Anyway, tutorial 0 does nothing. Tutorial 1 blips a quick blank window then disappears. I went in to the file and turned the script's debugging on, and added some more debug statements. The progarm breaks at the line "if not csInitializer.OpenApplication (object_reg):".  I put additional debug statements both before and after the statement to confirm this. The program just ends on this line.

So finally, Tutorial 2. It works. It works! I cheer! Then I go compare it to the same tutorial (simple2) in the main CS directory. It's slower than molasses! I expected the top-level Python code to slow down the program somewhat, but this isn't acceptable. By estimation, it runs at about 1/10 framerate. Such a simple program is visibly choppy on the screen. I don't want to imagine what it would do with a full-fledged game. I shake my head sadly. Either I'm doing something wrong, as evidenced by Tutorial 1's breakdown. Or, it just isn't meant to be. Or, perhaps it's just a problem in the current snapshot?

Does anyone have any advice or are other folks' experience with Python similar? If not, anyone have any luck with any of the other Python3d engines? It's not that I hate C. It's just once I switched to Python, I never want to go back.
Logged
sunshine
Administrator
Sr. Member
*****
Posts: 294


View Profile
« Reply #1 on: October 28, 2005, 07:35:08 pm »

Did you happen to note which renderer the Python tutorial was loading? If it loaded the software renderer, it would naturally run more slowly.
Logged
Ruel Haldi
Newbie
*
Posts: 18


View Profile Email
« Reply #2 on: October 28, 2005, 09:52:44 pm »

When I compare the two, I see that the Python version is using the Software Renderer, while the C version is using OpenGL. I hadn't thought to look through the code to find differences. Regardless, after changing this, I can see a significant improvement in rendering speed. In fact, I can't really tell the difference. There are other oddities. For instance, the camera doesn't move as quickly, and the sprite looks about 1/10 the scale. However, these are likely to be similar changes in the Python code from the original.

You definitely hit the nail on the head. Thank you for the helpful response!
Logged
dingobloo
Idle Extrordinare.
Global Moderator
Full Member
*****
Posts: 125


View Profile WWW
« Reply #3 on: October 28, 2005, 11:24:12 pm »

It is good to see that you documented all your steps though, it will hopefully be a useful thing for other people in your position.
Logged
griminventions
Newbie
*
Posts: 33


View Profile
« Reply #4 on: October 29, 2005, 06:41:22 am »

I, too, was attracted by the pure Python approach and the bindings of this engine.  But I struggled a lot with CS both to build it and to get started with it. A week later I was really frustrated but I had most of the pieces together and was digging into the docs.  I didn't notice any performance issues with the demos, though.  Python Mac functionality is there, but not without problems.

I then found that OGRE also possesses Python bindings. The down side to that is that OGRE's bindings don't yet work on Mac, but I found OGRE to be a lot simpler to build (less than 2 hours as opposed to 2 days for CS) and use.  I didn't have to get anything from CVS (the CS snapshots are painless, but the dependencies are not). The community is very large and very active with gobs of answers archived in the forums. The wiki is fairly well maintained, the docs are mostly up to date.

I'm not saying OGRE is better, because both engines are good and they do different things (CS provides more game infrastructure out of the box whereas OGRE focuses only on rendering). CS has a lot of potential--especially with the CEL module--but it's currently too hard to get into IMHO. And that's holding back the building up of a community. There's just not enough of a community to feel comfortable if I run into trouble in the middle of a commercial project. The devs are very hard-working and dedicated, that's obvious. What they've done is really amazing. With more "marketing" and some polish on the "getting started" phase, it will really shine.  I will watch Crystal Space's progress with great interest.
« Last Edit: October 29, 2005, 06:43:34 am by griminventions » Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 5.15 seconds with 15 queries.