Scripting language choice
-
- Posts: 19
- Joined: Sun Feb 25, 2007 1:31 pm
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
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
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:
this gets called:
Now, three lines of code can be written in one. Scripting support should simplify things, or there is no point.
Code: Select all
my_effect.setLifetime(1000)
Code: Select all
void particle_effect::setLifetime(int ms )
{
ISceneNodeAnimator* anim = parent.getSmgr()->createDeleteAnimator(ms);
node->addAnimator(anim);
anim->drop();
}
+--------+
steveth45
+--------+
steveth45
+--------+
-
- Posts: 4
- Joined: Sat Mar 17, 2007 11:12 pm
- Location: Finland
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.Ambassador wrote:Two points for "direct" scripting bindings:steveth45 wrote:Scripting support should simplify things, or there is no point.
1) You don't have to learn a new api
2) Compiling process gets eliminated
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
-
- Posts: 616
- Joined: Wed Nov 01, 2006 6:26 pm
- Location: Cairo,Egypt
- Contact:
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
great idea ....
I am really excited to see your python project ...
It is really good for irrlicht to have better python support.
izigoo
-------------------------------------------------------
iZigoo - The open 3D internet
iZigoo Homepage
iZigoo - The open 3D internet
iZigoo Homepage
-
- Posts: 4
- Joined: Sat Mar 17, 2007 11:12 pm
- Location: Finland
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: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).
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 enoughroxaz wrote:Compiling is done every time you run a script so its not eliminated, it just slows down application.
-
- Posts: 156
- Joined: Wed Jul 21, 2004 4:29 am
- Location: Mishawaka, In
Stackless Python
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.
not to mention games like WOW and Eve online use it to great extent so its already been proven a stable , production quality language.
-
- Posts: 313
- Joined: Tue Nov 01, 2005 5:01 am
Slight Clarification
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?
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?
-
- Posts: 68
- Joined: Sat May 10, 2008 11:30 am
- Contact:
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
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);
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes