Page 1 of 2

Making a scripting language for Irlicht?

Posted: Mon Mar 19, 2007 9:57 pm
by tyler
How do i make a scripting language for irrlicht? I have a parser(The Gold Parser).

thanks
8) 8)
tyler

Posted: Tue Mar 20, 2007 12:14 am
by Phant0m51
IrrWizard has a scripting language in it (Angelscript). You could check out their implementation of it.

Posted: Tue Mar 20, 2007 2:18 am
by dudMaN
Wow, this is kind of a n00b question.

Please read about compilers and ask in a compiler/C++ newsgroup.

My latest "creation" is M3Script, a scripting language that uses irrlicht to make 3-D games and simulations. maybe if i release the source you could learn something from it :D

search google for "implementing a scripting engine", i remember there was an article on there..

-dudMan

Posted: Tue Mar 20, 2007 9:42 am
by SirLino

Posted: Tue Mar 20, 2007 4:25 pm
by rogerborg
Adding script support to "Irrlicht" is like adding audio to MS Paint.

First, define the problem that you want to solve. Then determine the relevance of Irrlicht (a "3d engine") to that problem.

I expect that you want to add scripting support to your game engine. But Irrlicht is not a game engine. Come up with a solution to your problem.

Posted: Wed Mar 21, 2007 8:54 pm
by geewee
There is a project that aims to provide a LUA-binding to Irrlicht:
http://irrlua.sourceforge.net/

LUA is a very popular scripting engine and is used in several big projects (like WoW).

But man, that is really a n00b-question (for an advanced problem).

Posted: Thu Mar 22, 2007 8:11 am
by Hydrael

Posted: Sun Mar 25, 2007 10:11 pm
by dudMaN
Yeah, that article that hydrael said..

be warned that he sucks at coding though :shock:

-dM

Posted: Mon Mar 26, 2007 6:01 am
by roxaz
scripting engines are sooooo slowwwww..... i would prefer ini configs instead of scripting engine. bit more work implementing everything but at least runs fast. imagine, you spend 3-4 weeks or more while making scripting engine. it surely slows down your game. so why not to use ini config parser and load lets say scene when everything is defined in the config? less work to do, more free time, better performance. :idea:

Posted: Mon Mar 26, 2007 5:12 pm
by Frodenius
what about bytecode? see lua.

Posted: Mon Mar 26, 2007 5:58 pm
by roxaz
compiling scripts before run takes time. its slow. if you want faster result - you have to prepare precompilded bytecode. scripts compilation is not on the fly so whats point to have scripting engine anyway if scripts have to be compiled before running a game. also learning some new stupid scripting language is basicly same as learning c++, just c++ has more capabilities and it is more useful. if i rly would like to have something like that i would choose maybe xml instead. functions written in c++, game data defined in xml or ini configs, or even txt files. that is my opinion :)

Posted: Tue Mar 27, 2007 4:44 pm
by rogerborg
Should I ever find a need for runtime-adjustable behaviour, I'll just use an expicitely loaded and unloaded DLL compiled in C++, the way the Baby Jesus would have done it.

Posted: Mon Apr 02, 2007 7:45 am
by steveth45
Actually, I've making a simple Python binding of some core Irrlicht functionality using Boost::Python. Now that the binding is in place, all I have to do is hit ctrl-s in the text editor and then run the program. Sure, it has to "compile" the Python to byte code, but that usually takes a tiny fraction of a second since it only has to recompile the one file, as opposed to 30 seconds to re-link even a smallish C++ program every time you make one small change. Coders: how much of your life have you spent waiting for large C++ programs to compile and link, not being productive? Maybe at your day job this gives you a chance to goof off or zone out, but if you are trying to get something done it is refreshing to see results almost instantly.

Don't get me wrong, I'm a huge C++ fan, its my favorite programming language, but don't get down on Python or other scripting languages until you've given them a fair chance. The speed of Python is fine. You have to realize that the speed of your game is almost entirely dependent on your memory bandwidth and the speed of your GPU. With Irrlicht doing all the heavy lifting in the background, I can do the game logic in Python, and it still runs at 60 frames per second (with Vsync) on my laptop, while only using a fraction of the processor time.

Posted: Mon Apr 02, 2007 9:11 am
by roxaz
if we already are talking about python... i think its ugly choice. syntax is very... umm... strange. that lines aligment stuff can blow out my head since i havent found good python editor (actualy i dint search for it, i thought notepad++ will do well but it doesn)

Posted: Mon Apr 02, 2007 10:23 pm
by steveth45
Python is ugly? Heres a chunk of C++ from ISceneNode.h:

Code: Select all

core::list<ISceneNodeAnimator*>::Iterator ait = Animators.begin();
for (; ait != Animators.end(); ++ait)
    (*ait)->drop();
Here would be the equivalent code in Python:

Code: Select all

for anim in Animators:
    anim.drop()
Which one is uglier?