Page 1 of 1

Perl bindings: Games::Irrlicht

Posted: Sun Feb 29, 2004 2:01 pm
by Tels
"You can find enhancements for Irrlicht all over the web, like alternative terrain renderers, portal renderers, world layers, tutorials, editors, bindings for perl, ruby, python, and so on. And best of all: It's completely free."

I couldn't find Perl bindings, and the forum search only turned up two unrelated posts.

So I made some :-)

This is a very rough first draft. But I got it to load a BSP level and display it -so it basically works. Next thing on the TODO is to structure it enough to get the techdemo running (from a Perl script or something like the XML level loader - although I kinda squirm at the overhead of XML for storing simple stuff).

You can get the module from http://search.cpan.org/~tels/Games-Irrlicht/ (allow the indexer some time to pick up the newest version, though) or from my page:

http://bloodgate.com/perl/irrlicht/
http://bloodgate.com/perl/packages/devel/

I have not tried it under windows, but I guess with nmake and some Makefile.PL magic is should work. I don't see why it wouldn't.

The origins of that project are SDL::App::FPS which used, you guessed it, SDL. I was frustrated with all the SDL bugs and quirks. However, I finally found Irrlicht, liked it and started to pull over anything to it.

Currently there are some bugs and quirks, like:

* the framerate _delay and monitor are borken (I can't use Irrlicht's one, because it only has FPS as integers and it is too slow to update the value)
* the eventhandling is not there (SDL used some radically different...)
* only a few selected functions are exposed, I simple had not enough time to do the rest because I spent half of my weekend with unrelated problems

If you ask: Why Perl?

* rapid prototyping
* some stuff is just easier (like config file reading)
* you get scriptability basically for free

Some of the things that Games::Irrlich can do over Irrlicht itself (or should, short of bugs):

* monitor framerate and cap it
* reads config files, command line parameters
* maps keys according to config file
* has a time-warped (framerate independend) in-game clock. This allows easily slow-motion, rapid-fast-forwarding, as well as ramping (switching from normal time flow to slow motion over a certain time)
* timers that are coupled to the warped clock
* signal handling/forwarding (not yet, more on that later)
* sceenshots (borken with Irrlicht right now)
* easily loading/saving of gamestate (not fully in Irrlicht)

Some of the things just didn't survive the switch from SDL to Irrlicht, but I am working on that.

I can imgine that certain features are later on folded back from Perl to C/XS or even go into Irrlicht and are then simple used by the Perl framework. However, stuff which does not impact performance can stay in Perl.

However, Irrlicht does _much_ more usefull things than SDL does, and this saves me _tons_ of work. So I am filled with joy :)

I hope this is usefull,

Tels

8)

Posted: Sun Feb 29, 2004 3:33 pm
by niko
Hey, cool. I've not much experiece with Perl so I cannot add lots of useful, but it's nice to see projects like that. :) And that's a homepage, especially the page with the techdemo patch.

Posted: Sun Feb 29, 2004 3:51 pm
by Tels
"And that's a homepage, especially the page with the techdemo patch."

Sorry, didnt't quite understand that sentence? Hope you find it usefull and can fold it back into the next release :)

Cheers,

Tels

Posted: Mon Mar 01, 2004 11:31 am
by niko
Yep, I don't know what problem I had when I typed in that post. There are some words missing in it. Add 'comments' and 'nice' in there, and you'll understand better. :) Sorry.