Python, psyco & FFH

Hydrahypnotizer

Chieftain
Joined
Nov 6, 2005
Messages
38
Location
Gothenburg,Sweden
As we all know, python is a good language for modding; It's got a nice syntax and does not need to be compiled. The only problem - it's slow.

Psyco is a python compiler that compiles the code before executing, resulting in a 2 to 100 times faster code.

I installed it, put the psyco folder in the FFH /assets/python, and edited some .py files to include psyco. Sure enough, it worked, but the interface was gone! :crazyeye:
After a few edits, i found out that putting psyco in one .py file bugged the promotion system, another the interface etc. Some files seemed to work.
On the positive side, the game was noticeably faster! Especially the between-turns wait. :)
(Okay, it could have been placebo, as i didn't do any statistics... ;) )

The questions i have are:

The python version shipped with Civ is 2.4; can i replace this with 2.5? The 2.5 version of psyco fixes a few bugs.

This page has the know psyco bugs. Does anybody familiar with the FFH python code know if these bugs apply to FFH/Civ?
 
Last edited:
As we all know, python is a good language for modding; It's got a nice syntax and does not need to be compiled. The only problem - it's slow.

Psyco is a python compiler that compiles the code before executing, resulting in a 2 to 100 times faster code.

I installed it, put the psyco folder in the FFH /assets/python, and edited some .py files to include psyco. Sure enough, it worked, but the interface was gone! :crazyeye:
After a few edits, i found out that putting psyco in one .py file bugged the promotion system, another the interface etc. Some files seemed to work.
On the positive side, the game was noticeably faster! Especially the between-turns wait. :)
(Okay, it could have been placebo, as i didn't do any statistics... ;) )

The questions i have are:

The python version shipped with Civ is 2.4; can i replace this with 2.5? The 2.5 version of psyco fixes a few bugs.

This page has the know psyco bugs. Does anybody familiar with the FFH python code know if these bugs apply to FFH/Civ?

Firaxis wrote the interface between C++ and python. As far as I know it isn't possible to change the python version.
 
When i get back to my computer at home, i'm going to try some more stuff - including doing serious speed tests & searching for the thing that cause the bugs.

I hope changing python version is possible; I'll do a test.
 
I believe that when there is a serious problem with the python the game doesn't load it (which causes the lack of the interface, etc). However, not loading python at all also makes the game much faster (since most of what slows the game down is in python) in addition to not allowing most of FfH's cool features.
 
Hello,

please get in touch with user musicfreak from this very forum. He is very on exactly the same project. (he is actually from the Rhyes and Fall of Civilization - Sub Forum).

As far as I recall he had success in using Python 2.5 but was working basically with the boost libraries. However the effect on the game performance was not satisfactory, but please get in touch with him and please update this post in this forum about any results.

I really like your idea to precompile the python files. It sounds ... awesome just awesome.

Please go ahead with this project!!
 
Top Bottom