Scripting would be a nice addition to the engine. I read the post on the topic but I dont think it really explained the kind of scripting I want. It would be nice to be able to script using xml. Something like this:
ENGINE SCRIPT (interpreted)
<createscene name="scene1">
<loadmesh path="mesh.3ds" name="mesh23">
<loadmesh path="mesh2.3ds" name="mesh24">
<meshpos name="mesh23" x="23.435" y="34.543" z="4.543">
<dynlight x="0" y="0" z="0" color="255,255,255">
</createscene>
DATA SCRIPT (parsed)
<npcdata>
<randmessage>Hello user, how are you today?</randmessage>
<randmessage>The duck flies at midnight..</randmessage>
<spokenmessage wav="npc32.wav">Say hello to my little friend!</spokenmessage>
</npcdata>
You could make the engine recognize "loadmesh" and read the information then load the mesh, or you could just make it send the info to the programmer so he can put it in a loop and load them all. You could even do both, have like LoadEngineScript and LoadDataScript, engine script would have the engine interpret the script and actually do what its meant to do and you could have data script parse the data for the programmer to use, like messages from npcs.
Grand Theft Auto Vice City does this same thing but not in xml. Everything from car colors and availability to building names and positions are in text files. It would also be nice to have some kind of simple encryption or maybe just zip the scripts so the everyday user doesnt mess with it and screw the game up.
Im sure there are xml parsing libraries out there but since you dont use external libraries for the engine maybe you could find an open source one that would let you implement their source inside the engine, or just write your own if you have time.
I think this would add a lot to the engine. If you would like to see the Vice City scripts I can post them here. Its pretty cool how its loaded from those scripts, you could make a completely different game just by changing all of them (one reason why simple encryption would be useful).
Nice engine, by the way.
XML Scripting
Niko says that he has an XML parser written, it's just not part of Irrlicht.
The XML that I brought up and am developing was for gui positioning which everyone that uses Irrlichts gui can use.
The XML interpreter for making scenes is a decent idea also. Decent enough that I'm already using that sort of system myself. A "scene setup" script would be interesting for many game types, but it's not something that is easilly used universally for all games especially since Irrlicht is a graphics engine and not a game engine. Being able to ride on an Internal parser would be nice, one less library for me to worry about, but it almost seems to me like something that shouldn't be an integrated part of Irrlicht, but rather a seperate piece.
My Example:
The XML that I brought up and am developing was for gui positioning which everyone that uses Irrlichts gui can use.
The XML interpreter for making scenes is a decent idea also. Decent enough that I'm already using that sort of system myself. A "scene setup" script would be interesting for many game types, but it's not something that is easilly used universally for all games especially since Irrlicht is a graphics engine and not a game engine. Being able to ride on an Internal parser would be nice, one less library for me to worry about, but it almost seems to me like something that shouldn't be an integrated part of Irrlicht, but rather a seperate piece.
My Example:
Code: Select all
- <zones>
- <zone id="1">
<background>image1.bmp</background>
<landblock texture="" x="25" z="25" height="1" />
<landblock texture="" x="26" z="26" height="2" />
<object name="Test" team="0" bodyid="0" righthandid="100" lefthandid="101" x="25" z="25" maxhealth="10" />
<object name="Test2" team="1" bodyid="1" righthandid="100" lefthandid="100" x="26" z="26" maxhealth="100" />
</zone>
</zones>
Code: Select all
- <objects>
<object id="0" mesh="block.ms3d" texture="man0.bmp" scalex="1.0" scaley="1.0" scalez="1.0" />
<object id="1" mesh="block.ms3d" texture="man1.bmp" scalex="1.0" scaley="1.0" scalez="1.0" />
<object id="100" mesh="sword.ms3d" texture="sword0.bmp" scalex="1.0" scaley="1.0" scalez="1.0" />
<object id="101" mesh="shield.ms3d" texture="sword0.bmp" scalex="1.0" scaley="1.0" scalez="1.0" />
</objects>
Crud, how do I do this again?
i am using XML as well - making a high level object placement format (3DML - you can see an version of it i created some years ago at http://www.flatland.com) - right now i have a version running on (gasp) OGRE - but i am doing some test work here in IRRLICHT as well since both engines are in formation - but anyways, i think XML is inctedibly usefull - there is tinyxml that is nice to work with by the way
XML...
Would it be better just to incorporate Python into irrilicht in the future?
Check this article (it is Jython, which is Java version of Python):
http://today.java.net/pub/a/today/2003/ ... ython.html
XML has its uses, but it gets messy and cumbersome fast in my experience.
Check this article (it is Jython, which is Java version of Python):
http://today.java.net/pub/a/today/2003/ ... ython.html
XML has its uses, but it gets messy and cumbersome fast in my experience.