There was a article on Slashdot a while ago about using SDL with Perl. Of course I've heard of the definitive example of a Perl game, Frozen Bubble, but someone also linked to a Perl FPS project. It looks interesting, but seems to be abandoned. Anyway, this has renewed my interest in learning game programming.

The problem is that the only languages I know are Perl, PHP, and Visual Basic. Would it be worth it to learn C or are the premade tools enough of a speed boost to do something simple without a "real" (non-scripting) language? Ideally, I'd like to be able to do something with 2D or 3D, some basic physics, and network multiplayer.

There's so much to choose from, though. Should I use SDL? Allegro? Regardless of DirectX's merits, I think OpenGL is the obvious choice for 3D stuff, just because of the larger possible audience.

Are there any example Perl games out there? Have any of the monks ever done anything in this area? The only books I really see are OpenGL guides, any recommendations?
  • Comment on So many things to learn when starting game programming. What's worth learning?

Replies are listed 'Best First'.
Re: So many things to learn when starting game programming. What's worth learning?
by negation (Beadle) on Feb 22, 2006 at 10:26 UTC

    Depending on the complexity of your game, perl could be fast enough. But if you're aiming for fast paced game with loads of special effects, some other tool might be a better choice. C/C++ seems to be the most common which means there is a lot of tutorials and communities to learn from. It also has quite steep learning curve and lot of things that modern languages handle automatically has to be done manually.

    Another option would be Java, but there you would sacrifice quite some CPU power. I'm well aware that it's possible to develope good commercial games with Java, but I wouldn't start learning it just because of that. Especially since you already know perl and have some experience on that. I would leverage that experience and choose perl, if the final choice would be between Java and perl.

    If you want to do some 2D and C/C++, I would recommend Kyra Sprite Library (http://www.grinninglizard.com/kyra/) It's rather neat sprite system and has somewhat active community (at least back when I was still working with it). It's build on top of SDL. SDL would be my choice over Allegro (no real reason though, I just liked it better).

    For 3D my choice would also be OpenGL. Not because of the larger audience (which is nice too, of course), but because I found it easier to use than DirectX. But my knowledge of DirectX is over 6 years old now, so lots of things must have changed there too.

    So yeah, lots of ifs and buts and nothing definetive. But hopefully that gives you some ideas what options there are.

    spikydragon.fi - t-shirts for Coders, engineers, roleplayers, scientists, jugglers and nerds
Re: So many things to learn when starting game programming. What's worth learning?
by bitstream (Sexton) on Feb 22, 2006 at 14:51 UTC
    For sheer portability, I'd put in a strong vote in for OpenGL and GLUT. Frozen Bubble is an admirable accomplishment, but SDL is a dangerous beast and the code isn't the cleanest thing by a long shot. SDL also lacks a lot of basic drawing primatives which you might find useful, not to say that they cannot be re-implemented. I'm tentatively throwing around the idea of a new project based entirely on C and Lua, and OpenGL -- Perl's spiffy -- but I'd like a bit more raw speed and I'm in love with Lua's gloriously simple C bindings. The downside with Lua is you often have to re-implement basic functions that Perl would generally *have*, but it does have a 100k runtime and is nicely redistributable.
Re: So many things to learn when starting game programming. What's worth learning?
by samtregar (Abbot) on Feb 22, 2006 at 21:10 UTC
    Learn C. If you're serious about doing something combining 3D and physics then a knowledge of C will be indispensible. Even if you end up using Perl for a lot you'll almost certainly be making calls into C libraries for stuff like SDL, OpenGL, whatever physics library you choose, etc. A working knowledge of C will make all of this much, much easier.

    Also, learn matrix math, if you don't know it already. There are some reasonably good "math for 3d programming" books out there. Without a complete understanding of matrix operations, OpenGL will be very confusing.

    -sam

Re: So many things to learn when starting game programming. What's worth learning?
by shotgunefx (Parson) on Feb 22, 2006 at 21:37 UTC
    I started off programming to make games (this was some 16-17yrs ago) when machines were puny and weak. So all assembler and C fudging around with Extended DOS, mixed mode ISRs, undocumented video and all the other nasty tricks.

    It's been quite awhile since I've done anything remotely like that. Though recently, been using Perl/SDL for my first 2d app in ages. (Might have some 3D later, but that's off a bit).

    Using Perl has been so much easier and faster to develop. So, I'm not sure what to tell you.

    Obviously C/C++ is the way to go for speed, but I think there may be some value in starting with Perl. Outside of the various technical issues to tackle, a lot of game development, at least when you start out, is how to arrange things. Figuring out how to partition all the elements that make up the various aspects of the "environment".

    I think with a scripting language, the benefit is that you can try a lot of different approaches quickly. Though being further from the iron is sure to present it's own problems. Though I've been very happy with 2d SDL performance (as my target is an old 466mhz laptop and it's plenty fast). I would definitely recommend you start learning C/C++, even if you start with Perl at some point.

    Though you have the internet these days, so there's so much less revinventing the wheel that you have to do. It's probably a lot easier with all the resources available to jump into it from a lower level.

    As an aside, many 3d games these days do use scripting languages internally to actually run the show. (Doom/Quake/Unreal)


    -Lee
    "To be civilized is to deny one's nature."
Re: So many things to learn when starting game programming. What's worth learning?
by spiritway (Vicar) on Feb 23, 2006 at 02:46 UTC

    I think it would be good for you to learn C. Perl is great, and you can probably use it for the vast majority of your programming. But you're almost certain to have some tight spots that require the speed that C offers. 3-D graphics requires a huge number of calculations done in realtime. Even if you don't run into this now, you're likely to do so as your skills develop and you become more ambitious.