Page 2 of 2

Posted: Sun Feb 25, 2007 1:39 pm
by pixeljunky
Is there already a swig bindung for irrlicht and how does this work ?
I saw in a thread that the python binding is done with swig. But it needs an
update.
If the python binding is updated then it is possible to use all the other swig supported languages ?Would be really great if the python -venom project would be updated again.

pixeljunky

Posted: Thu Mar 01, 2007 12:29 pm
by SiriusCG
If you do choose Lua specifically, I recommend tolua++ for C++ bindings. It has a few quirks but it works quite well and is simple to use.
Thx zenaku 8)

We're starting to look at LUA pretty seriously and tolua++ will figure prominently in the implementation...

Posted: Sat Apr 07, 2007 10:43 am
by steveth45
The problem with most of the bindings is that they are making a 1:1 binding, so you have to write the same exact function calls, but maybe you don't have to put a semi-colon at the end, because its a scripting language, or whatever. That makes no sense. A scripting language binding should simplify the interface, or else you aren't gaining much. I've made a simplified Python binding using Boost::Python, which is _much_ easier to use than SWIG, IMHO. Don't worry, I'll clean it up and share it with the world, soon enough :). I've simplified a few things. For example, when you do this in Python:

Code: Select all

my_effect.setLifetime(1000)
this gets called:

Code: Select all

void particle_effect::setLifetime(int ms )
{ 
	ISceneNodeAnimator* anim = parent.getSmgr()->createDeleteAnimator(ms);
	node->addAnimator(anim);
	anim->drop();
}
Now, three lines of code can be written in one. Scripting support should simplify things, or there is no point.

Posted: Sat Apr 07, 2007 7:05 pm
by Ambassador
steveth45 wrote:Scripting support should simplify things, or there is no point.
Two points for "direct" scripting bindings:
1) You don't have to learn a new api
2) Compiling process gets eliminated

Posted: Sat Apr 07, 2007 10:24 pm
by roxaz
Ambassador wrote:
steveth45 wrote:Scripting support should simplify things, or there is no point.
Two points for "direct" scripting bindings:
1) You don't have to learn a new api
2) Compiling process gets eliminated
thats not sereous points. if guy is capable to implement script engine then he is capable to learn some new api (but i dont see what new api.. eh whatever). Compiling is done every time you run a script so its not eliminated, it just slows down application. you can use precompiled bytecode to eliminate compiling on the run then you gain faster launch and oportunity to compile bytecode yourself. as we see if you want to get something (in our case simplicity) we must give something (in our case speed). if we use precompiled bytecode then scripting engine is umm... useless i gues. so in any case it hits performance.

i can think lots of reasons why scripting engine shouldnt be used but somehow i think that there is no other better choice. i was thinking about making something like my mission file format where info would be provided and my application would simply parse it and do whatever was written there but that means im inventing another scripting language which is far from beeing good.

so it looks like i just said my opinion and objected to myself. i gues i could be good lawyer :lol:

Posted: Sun Apr 08, 2007 9:22 am
by omar shaaban
ya python would be cool but the problem that the last binding for python was for v0.14!!!
ahh,how do i make a binding for a language!?

Posted: Wed Apr 11, 2007 11:18 am
by iZigoo
hey steveth45,

great idea ....
I am really excited to see your python project ...
It is really good for irrlicht to have better python support.

izigoo

Posted: Sat Apr 14, 2007 4:51 pm
by Ambassador
roxaz wrote:if guy is capable to implement script engine then he is capable to learn some new api (but i dont see what new api.. eh whatever).
Who said that scripting language users are capable of implementing script engines? Besides, even though thousands of people are able to code scripting engines and even full 3d engines, they don't, because that would just take too much time. Scripting languages are meant to simplify the development process and make it faster, weather it is a new api or not. For some people, the same old api is better than the new one. Likewise for some people a new api might be better.
roxaz wrote:Compiling is done every time you run a script so its not eliminated, it just slows down application.
Scripting languages use interpreters, not compilers, except for byte compilers which are significantly faster than c++/c compilers which I was talking about. (sorry for not making it clear enough ;)

Stackless Python

Posted: Tue May 08, 2007 2:40 pm
by Athlon_Jedi
something we have been playing with is using stackless python as our scripting language. from what I understand stackless is a bit more effecent than standard python as it uses threads instead of the c stack.

not to mention games like WOW and Eve online use it to great extent so its already been proven a stable , production quality language.

Slight Clarification

Posted: Wed May 09, 2007 1:21 am
by Eternl Knight
Actually the efficiency of Stackless comes from the fact that it does not use THREADS for multi-tasking, but instead relies on co-operative multi-tasking (of which C stack switching is only a necessary part).

I too use Stackless & Richard Tew recently uploaded my example implementation to the Stackless SVN. The reason Stackless fits gaming better (in my opinion) is because it is possible to create a separate execution context ("tasklet") for all dynamic objects (i.e. enemy characters, rockets, elevators, etc) without having to create a dedicated "thread" (which uses too much OS resources).

Given certian conditions, it is also possible to "freeze" then game world & save it by pickling the tasklets and their objects to disc. Something I have been using in some simulation work I have been fiddling with.

--EK

P.S. I was unaware that WoW used Stackless... I was under the impression it used Lua. Can you give me a reference on this?

Posted: Wed Jul 23, 2008 10:15 pm
by dlangdev
where have all these people gone to?

is anybody here still playing around with stackless python?

Posted: Wed Jul 23, 2008 11:33 pm
by torleif
I've had a bad experience with lua, the lack of documentation led to me manipulating the stack more than necessary to do the simplest task

Next time I have a shot at it, I'm definitely going with angle script.

Posted: Tue Jul 29, 2008 11:11 am
by full.metal.coder
Playing around with Lua and SLB (Simple Lua Binder) which allows me to dynamically expose function and classes with a really straightforward syntax. All the binding is done at run-time with no need to rewrite your existing classes/methods (though if you want to use global functions you'll have to rely on lua stack but you can still create a dummy object for this). THe only drawback is the poor documentation of SLB but the examples provided are enough for my basic needs

Posted: Tue Jul 29, 2008 11:56 am
by bull
I use GameMonkey because
-It has similar concept to Lua
-It has C++ syntax( if(){} instead of if then end)
-Easy to bind
-Source code written in C++ so it's simple to read and learn.

Posted: Wed Jul 30, 2008 2:15 pm
by Nadro
In my engine I use Squirrel + SqPlus. It's quick and easy. Squirrel script has got similar structure to native C++ code. This is sample script:

Code: Select all

local Distance = Character.C1.getPosition() - Character.C12.getPosition();

if(Distance.getLength() < 70)
Character.C12.setVisible(0);
else
Character.C12.setVisible(1);