Crystal Space
Welcome, Guest. Please login or register.
October 21, 2014, 11:28:23 am

Login with username, password and session length
Search:     Advanced search
9010 Posts in 2044 Topics by 8774 Members
Latest Member: Amsore
* Home Help Search Login Register
  Show Posts
Pages: [1] 2
1  Crystal Space Development / Support / Re: Python and Pixmaps on: May 06, 2006, 03:59:48 am
That's great! You see to understand this a lot better than I do. I've run into a few similar issues with Python that I've managed to get around, but where are we supposed to write down this sort of thing?
2  Miscellaneous / Article/Tutorial Discussion / Re: Writing Python tutorial... problem on: May 02, 2006, 01:35:55 am
Well... here it is. I still haven't figured out the iGenMeshSkeletonControlState, so if anyone wants to correct that, please do!  Likewise, I haven't figured out how to use the shift keys in Python, because the CrystalSpace constants for the shift keys are undefined.

My purpose here was to take the isotest demo script included with CrystalSpace and rewrite it in Python. They are presented side by side, so the reader can compare the C code to the Python code.

Suggestions for better presentation (I'd love to color it like an IDE) or fixes are appreciated.

Here's the link. Should I upload this somewhere? Maybe the CrystalSpace Wiki I've heard about (but can't find)?

3  Crystal Space Development / Support / Re: Python and Pixmaps on: April 27, 2006, 05:13:19 am
There's the python examples that come with the download. Although perhaps you already knew about those.

I agree, the information available to Python users is often insufficient. I'm trying to remedy this by writing a few tutorials, but I'm still a beginner myself. As far as the csSimplePixmap() function, I can't help you. I've run into similar issues where the normal C functions just don't exist in Python.
4  Crystal Space Development / General Crystal Space Discussion / Re: Making Crystal Space Easier: Tutorials, documents, wiki, demos on: April 23, 2006, 02:38:35 pm
Hmm... well, I don't have the latest CVS, so that might be the problem.  Likewise, I'm using Python which seems to be a little finicky, since it demands the latest argument loading (it doesn't let you use deprecated functions).

However, I've run into multiple cases where the documentation on the website was not exactly correct. The information was mostly there, but the specifics were insufficient. For instance, the HitBeamObject problem above. In the code, it is described as deprecated. The web documentation didn't make that clear. Or the CreateLight issue I mentioned over in the TutorialDiscussion forum. The web doc says I can give it a name of 0, which doesn't work. In both cases, I had to go to the actual code documentation and read that before I could figure out what was wrong. Then I had to use trial and error to figure out how to use these functions correctly.

Considering the number of such issues I ran into while transcribing isotest, I imagine these aren't isolated occurences. Take this with a grain of salt. Isotest works just fine in C. However, the same functions used in Python were hanging for the reasons mentioned above. I think the problem may be that Python is just going to be more exacting.

In any case, the documentation problem is a lesser concern. I believe if the other issues are improved, the documentation will begin to take care of itself.
5  Crystal Space Project Development / Feature Requests / Re: Distribution Resource Analyzer (which DLLs?) on: April 23, 2006, 02:24:36 pm
Ah. Thank you!
6  Crystal Space Development / General Crystal Space Discussion / Re: Making Crystal Space Easier: Tutorials, documents, wiki, demos on: April 22, 2006, 10:27:38 pm
I'm still a noob, but perhaps that is who you need to comment here. I'm very pleased with CrystalSpace. From my experience so far. You have an excellent set of tools, but they are very difficult to figure out.

Just getting CrystalSpace to run the first time caused a bunch of frustration. At one point, I turned off the computer and just walked away. Most new users are not going to take that sort of treatment, but they don't have the experience to avoid it. Likewise, programming for CS has been rough. Over the last week, I've rewritten the isotest example script into Python. During that time, I've run into bunches of snags, some of them unavoidable. For instance, the HitBeamObject code is deprecated, and now ouputs a csHitBeamResult instead of a boolean (so the only choice using Python). This is not documented anywhere except in the code itself. I still have a one last snag that I haven't figured my way through. This is mentioned in the Tutorials Discussion forum since that was the intent of this endeavor.

Making CrystalSpace easier is a multi-fold problem.

First, consider who you are making it easier for. New users. What will be their primary complaint? Problems installing. My guess is that this should probably be goal number one. We can't lose users before they even get their feet wet. It's like a flower shop with a booby trap on the front mat. It looks pretty on the outside, but getting in the door...

Second, if you compare the CrystalSpace website with other 3d engines (I'm thinking of Ogre), it isn't as well organized. When I installed Ogre, I ran into many similar issues, but their website was clear and put together well, so I was able to find help quickly without even asking anyone. Helpful information on the CS web is often hidden several layers deep, or only available on the forums. And getting from spot to spot can be a pain. For example (of many), you are currently reading my post. What do you have to do to get back to the CrystalSpace site? I've been biting the bullet and typing the URL in. Why isn't there a link there from here?

Third, documentation. You've written all this great documented code, but the documentation on the website doesn't match.
Basically, until the first two problems are beaten, we can't really expect much from the community. Without users, nobody is going to help you write documentation. And if the process is painful, they won't do it anyway. I want to help, but I don't know where to start, how much authority I have to make alterations, or even where the Wiki is that you mentioned. I see where I can put in comments in txt2html or doxygen. Is that what you are talking about? I'm a stupid noob, but unless you tell us what to do and how, we CAN'T help. Perhaps, a good "GoogleSummerOfCode" would be to get someone to read through the code (documenting as they go) and bring the website documentation up to match.

Please don't take my comments negatively. I'm just trying to help, saying what I see from the "new user (but learning)" perspective. I really like the CS engine. I've tried some of the others. They may have been easier, but they just didn't generate the same sort of application appearance (or design philosophy) that I was looking for. I'm also trying to do my part. I'm writing a tutorial in which I translate the isotest code over to Python. I'll post it sometime soon, probably next week.

I do have two additional suggestions: First, it would be nice if the Python users had our own forum for Python specific issues. "CrystalPy" or something. Mmm... Pie... with Crystals in it! *grin*   If you look over at Ogre3d, the Python users have their own sub-website. Second, concerning tutorials. It would be really nice if the new users could work out some sort of "tutorial trade" with the more experienced users. New users don't understand advanced subjects such as shaders, but they want to learn. However, they CAN write basic tutorials (on basic subjects) to help out other new users! Such a trade encourages new users to get involved. It also helps them learn as they write their own tutorials. As they become more experienced, they add to the community, so the advanced users can spend more of their time NOT helping noobs. Plus, there would then be twice as many tutorials (and tutorial writers). Seems like a win-win proposal to me.
7  Crystal Space Project Development / Feature Requests / Distribution Resource Analyzer (which DLLs?) on: April 22, 2006, 09:34:06 pm
The subject title is vague, because I don't know the correct words for what I'm trying to describe. I will explain:

Yesterday, I put together a distribution of a CrystalSpace application to send to a friend for testing on their computer. They didn't need to see the code, they were just going to run it and tell me what they see. All I needed to send was the compiled programs and the DLLs (for a Windows compile), and various other small things like vfs.cfg, the world file and textures.

Simple enough? Yes, but it ended up being 180 something meg. That's just silly. So, I started paring it down. Only about a third of the DLLs are actually used by my program. Unfortunately, the quickest way to figure out which ones was by trial and error (deleting one at a time, and seeing if the program still functions correctly). In the end, the program was down to 50 something meg (16 meg zipped). That's not half so bad.

What would be nice is a way to output a script at the end of a CrystalSpace program that tells you exactly which DLLs the program loaded. That way, when it's time to write a distribution copy (or commercial copy?), you don't have to resort to trial and error. Maybe there is already something like this, but I didn't see it in the documentation.
8  Miscellaneous / Article/Tutorial Discussion / Re: Writing Python tutorial... problem on: April 20, 2006, 07:55:42 pm
All right!  I figured out and fixed the first problem. Since I've been copying the code from isotest.cpp to build isotest.py (so I can have a comparison), I used the line "actor_light=self.engine.CreateLight(0, csVector3(-3,5,0), 5, csColor(1,1,1))" as it was written in C.  However, this doesn't work in Python. The first field MUST be given a name even if the name is an empty string.

So, "actor_light=self.engine.CreateLight("", csVector3(-3,5,0), 5, csColor(1,1,1))" works.

Now, if I can just figure out the second issue listed above with iGenMeshSkeletonControlState
9  Miscellaneous / Article/Tutorial Discussion / Re: Writing Python tutorial... problem on: April 20, 2006, 03:35:10 pm
I'm still stuck on the last problem, but I kept going so I could find any more issues.

Code:
self.spstate = SCF_QUERY_INTERFACE (self.actor.GetMeshObject (), iGeneralMeshState)
self.animcontrol = SCF_QUERY_INTERFACE (self.spstate.GetAnimationControl (), iGenMeshSkeletonControlState)

The first line works fine, the second generates this Traceback:

Quote
File "C:\CS\isotest.py", line 190 in CreateActor
  self.animcontrol=SCF_QUERY_INTERFACE (self.spstate.GetAnimationControl (), iGenMeshSkeletonControlState)
NameError: global name 'iGenMeshSkeletonControlState' is not defined

Sounds like Python doesn't recognize the keyword for the 'iGenMeshSkeletonControlState' structure. Not sure how to approach this problem. I assume the isotest.cpp include for gmeshskel.h isn't loaded by cspace.pyd.  Or it wasn't SWIGed properly. Any ideas on what to try next?

You know, it'd be nice if we had a forum dedicated to Python users and issues. Maybe call it CrystalPy?  Hehe...
10  Miscellaneous / Article/Tutorial Discussion / Writing Python tutorial... problem on: April 20, 2006, 02:51:11 am
I'm trying to write a tutorial for newcomers. It's also for my own good, since I get good experience out of it. My goal is to translate several of the tutorial programs that come with CS into Python scripts. Other people would probably be more qualified, but it needs to be done, so I'll do my best. The tutorial would be a line-by-line comparison between the two languages so that new users can see how to build their own programs in Python.

Right now, I'm working on a translation of the isotest program. I've gotten pretty far, but I've run into an odd snag. Specifically, it appears that you can't create a light in Python. Here's the chunk of code:

Code:
try:
  actor_light=self.engine.CreateLight(0, csVector3(-3,5,0), 5, csColor(1,1,1))
except: 
  msg=traceback.format_exc()
  csReport (object_reg, CS_REPORTER_SEVERITY_ERROR,"crystalspace.application.isotest",msg)

NOTE: for new Python users. It took me a long time to figure out a proper debug method in CS. I'm accustomed to just printing and reading error messages in the terminal window. If you haven't found your own method, the try/except clause above works quite well.

I hope someone can help me. When I run the program, it fails to create the light. It also gives a very odd traceback message:
Quote
File "C:\CS\isotest.py", line 143, in LoadMap
   actor_light=self.engine.CreateLight(0,csVector3(-3,5,0),5,csColor(1,1,1))
File "C:\CS\cspace.py", line 4269, in CreateLight
   def CreateLight(*args): return _cspace.iEngine_CreateLight(*args)
NotImplementedError: No matching function for overloaded 'iEngine_CreateLight'

As said above, I'm probably not the best man for the job, because I don't know what to do about this. It sounds like cspace.py doesn't have a proper function for iEngine.CreateLight.  However cspace.py was built by SWIG wasn't it? Any ideas?
11  Crystal Space Development / General Crystal Space Discussion / Re: py2app or py2exe with CS? on: December 15, 2005, 07:34:24 pm
I got a spare moment today, so I put in a few minutes, and I got it to work. Big thanks to Sunshine for explaining what my problem was!

For future users, here's what I did:
Since CrystalSpace was using the same name for one of Python's modules, I copied the Python module (opcode.py) renaming it (disopcode.py). Then, I changed dis.py to import disopcode.py instead of opcode.py. This worked perfectly, although it's not the best solution because if I ever reinstall Python or future modules try to call opcode.py, I'll run into the same problem again. However, it works for now. I now have a finished proof-of-concept compiled into a finished .exe file. It's only 23kb, but comes with ~8 megs of DLLs and PYDs and compressed PYCs.

I did try switching Python's path order as suggested, but this didn't achieve quick results, so I switched it back and moved on. I also looked at changing CrystalSpace's opcode module's name, but since I wasn't certain of all the spots that referenced it, I decided my method would be easier.
12  Crystal Space Development / General Crystal Space Discussion / Re: py2app or py2exe with CS? on: December 15, 2005, 04:20:08 pm
Ah! That definitely explains the problem. Now that I understand better, I will try to fix it. I'm kinda busy for a while, so it may be a week or two before I can address it properly.

Thank you!
13  Crystal Space Development / General Crystal Space Discussion / Re: py2app or py2exe with CS? on: December 15, 2005, 02:41:05 am
Since I still haven't heard any py2exe success stories, I suspect that nobody has ever prepared a CrystalSpace (using Python) script into an exe file. This is an important issue for anyone wishing to use Python for CrystalSpace, because if you can't freeze it to an exectuble, you have to copy the whole thing (uncompiled, with all the libraries) to other users.

I'm still stuck at the same error despite reinstall of Python (including older versions). py2exe has been able to handle any other file that I've thrown at it (including some test cases), so to me, it seems like the issue must be a failure to handle CrystalSpace's code. For example, I've used py2exe on some other games that I've made using the pygame libraries and a proof-of-concept using Ogre3d.

However, I like the design philosophy and the visual results from CrystalSpace best, so I still want to follow it. Unfortunately, I do not have the background to approach this level of problem. Possibly, I'm just doing something stupid. However, I'm forced to proceed with my effort using other engines. But I'll definitely keep an eye here for any updates.
14  Crystal Space Development / General Crystal Space Discussion / Re: py2app or py2exe with CS? on: November 18, 2005, 09:38:01 pm
I will try to explain, although I'm still very new and Grimventions clearly knows what he's doing better than I do.

When you have finished a Python script, and you want to make it accessible to other users that don't have Python (and all the libraries) available on their machine, you compile it as an executable (in Windows) so it can be run on any computer. This is a critical step to making useful programs in Python, since you can't expect your users to go download (and install) Python before they can run your program.

The problem arises in that we don't know how well py2exe will handle the complex CS environment. From his post, I think Grimventions is initially having trouble getting the executable to recognize where to look for the VFS.

In my case, I'm stuck at a much earlier point, as I can't even get py2exe to start a compile. Here's the error message, unfortunately it doesn't reference any part of CS, so  I don't know if the problem is even related to CS, or it's somewhere within py2exe itself. Though since py2exe can handle anything else I've thrown at it, I'm not really sure where to start.

C:\CS>python gamesetup.py py2exe
Traceback (most recent call last):
  File "gamesetup.py", line 2, in ?
    from distutils.core import setup
  File "C:\Python24\lib\distutils\core.py", line 21, in ?
    from distutils.dist import Distribution
  File "C:\Python24\lib\distutils\dist.py", line 13, in ?
    from copy import copy
  File "C:\Python24\lib\copy.py", line 65, in ?
    import inspect
  File "C:\Python24\lib\inspect.py", line 31, in ?
    import sys, os, types, string, re, dis, imp, tokenize, linecache
  File "C:\Python24\lib\dis.py", line 6, in ?
    from opcode import *
ImportError: dynamic module does not define init function (initopcode)
15  Crystal Space Development / General Crystal Space Discussion / Re: py2app or py2exe with CS? on: November 18, 2005, 12:11:19 am
I've been waiting to see if you would get any replies.

I only started a few weeks ago, so I won't be much help. However, this is the last critical step in my decision whether to choose to continue with CrystalSpace. I've brute-forced my way through most of the other Python issues I ran into, but this problem is just too far over my head. I now have a few proof-of-concept apps built, but without the ability to compile and give the final application to someone that doesn't have CS and Python, there isn't much point in continuing.

Eagerly awaiting any news on this front.
Pages: [1] 2
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 9.456 seconds with 15 queries.