Making a scripting language for Irlicht?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
tyler
Posts: 3
Joined: Sun Mar 18, 2007 1:00 pm

Making a scripting language for Irlicht?

Post by tyler »

How do i make a scripting language for irrlicht? I have a parser(The Gold Parser).

thanks
8) 8)
tyler
Phant0m51
Posts: 106
Joined: Mon Jan 15, 2007 6:07 am

Post by Phant0m51 »

IrrWizard has a scripting language in it (Angelscript). You could check out their implementation of it.
dudMaN
Posts: 111
Joined: Fri Mar 02, 2007 6:37 pm

Post 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
SirLino
Posts: 3
Joined: Thu Sep 22, 2005 7:09 pm
Location: Minden, Westf. (DE)
Contact:

Post by SirLino »

rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post 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.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
geewee
Posts: 4
Joined: Sun Jun 18, 2006 7:09 pm

Post 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).
Hydrael
Posts: 7
Joined: Thu Jan 18, 2007 6:09 pm

Post by Hydrael »

dudMaN
Posts: 111
Joined: Fri Mar 02, 2007 6:37 pm

Post by dudMaN »

Yeah, that article that hydrael said..

be warned that he sucks at coding though :shock:

-dM
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post 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:
Frodenius
Posts: 64
Joined: Sun Aug 29, 2004 11:24 am
Location: Germany/Frankfurt
Contact:

Post by Frodenius »

what about bytecode? see lua.
worst programming style ever seen...
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post 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 :)
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post 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.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
steveth45
Posts: 14
Joined: Fri Mar 03, 2006 2:42 am
Location: Eugene, OR, USA
Contact:

Post 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.
+--------+
steveth45
+--------+
roxaz
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Post 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)
steveth45
Posts: 14
Joined: Fri Mar 03, 2006 2:42 am
Location: Eugene, OR, USA
Contact:

Post 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?
+--------+
steveth45
+--------+
Post Reply