in reply to Game programming using SDL and perl?

Hey Moodster,

Interesting idea. Much like Molt I've played with SDL but only in C/C++ (Programming Linux Games by John R. Hall is a great book IMO). I didn't even know there was a Perl SDL API until this post, otherwise I would have looked into it long before now.

I've always wanted to combine Perl into games programming because of its maintainability and flexibility and ease of coding. Plus it is a relative piece of cake to embed it into an engine. My thought was always that I'd write a C++ engine but that various subsystems could call Perl for things like player AI, networking, game logic, but C++ would do the heavy lifting for OpenGL, sound, etc. This sounds like an exciting alternative.

Sorry that I can't offer any "I've been there or done that" advice, but it sounds like a good plan and I'm sure it will be fun. And thank you so much for bringing this idea up - now I have something new to play with too. :) Definitely check out the PLG book from No Starch publishing too. It is a good overview of SDL and a good overview of game design in general.

Update: You're probably aware of this Moodster, but for learning about using an embedded Perl interpreter do a perldoc on perlembed. I haven't tried it myself, but it doesn't look too terrible to work with.

Good luck,
{NULE}
--
http://www.nule.org

  • Comment on Re: Game programming using SDL and perl?

Replies are listed 'Best First'.
Re: Re: Game programming using SDL and perl?
by moodster (Hermit) on Apr 13, 2002 at 09:19 UTC
    Now that's an interesting thought. I've been thinking about how to package this app to make it easy to install even for non-programmers. Ideally, the user should not need to have a perl interpreter installed on his/her system, and as I understand it, there are ways to do this (have to re-read Programming Perl again).

    Embedding perl code in a C++ application might be an alternative as long as I don't have to sacrifice cross-platform functionality. Also, it'll give me a chance to brush up my C++ a bit, which is nice.

    I must admit that I like python a lot because of it's syntax and OO-capabilities. But I think I'd rather use perl for this...

    Cheers,
    --Moodster

      It is always a good idea when developing big games to keep the things outside the core nice and scriptable, it makes them a lot easier to change and also allows external developers to more easily bang out things like the Quake mods, TCOs, and even the huge Baldur's Gate add-ons which are freely available

      Perl should be a nice plugin language for scripting though, and with XS for your C++ integration (And Inline::CPP for your quick tests) you should be able to manage wonders.

      There is a nice tutorial on developing your own 'little language' for scripting in the Tutorials section of Flipcode. Whilst it probably won't help you with the technical implementation it will give you a nice overview of some considerations which you may otherwise overlook. It's the 'Scripting Language Tutorials Series', and it's worth a quick look at least in my opinion.