Developing Games with Perl and SDL
segphault writes "Andy Bakun has written an excellent 20 page guide to game development with SDL_Perl for Ars Technica. The tutorial, which includes extensive code examples and plenty of screenshots, walks readers through the process of building a clone of the original Atari Kaboom! game." From the article: "One of the biggest benefits of using SDL is that it allows portable media applications to be written without having to be concerned with specific implementations of media libraries for each target platform. Bringing Perl into the picture takes the portability one step further, allowing media-rich applications to be written in a high-level language that can be targeted to a number of platforms. While programming using SDL requires knowledge of C and access to a C compiler, using SDL_perl does not. This greatly decreases the amount of time it takes to get something up on the screen and working."
It sounds good as a learning tool. It would be great if budding game coders, especially younger coders, could be given a simpler enviornment in which to begin toying with graphics and sound coding.
However, it's in Perl. And I really have to ask myself; Do I want to play games coded by people who started programming games in perl?
But seriously, whenever you code a game, you always end up using a scripting language of some kind. Perhaps this just cuts out that virtual middleman that is c/c++?
May the Maths Be with you!
Python with SDL (pygame) has been used to write Dungeon Siege (I think that was the game, correct me if I'm wrong) and I liked the result a lot.
Send email from the afterlife! Write your e-will at Dead Man's Switch.
Ideal. I always wanted my 4ghz pc to simulate the clock speed of a 286!
I thought perl was already a game.
Take the cheese to sickbay, the doctor should see it as soon as possible - B'Elanna Torres, "Learning Curve"
Yet, it does need knowledge of Perl, another programming language, and access to a Perl interpreter. So, indeed, in the end it needs the exact same thing that is needed to write a game in C or C++. A person needs knowledge of a programming language, knowledge of an API and access to software which will make the program happen. So, having this in mind, wtf is that intended to mean? Sheesh....
Slashdot, fix your code or at least hire someone who is competent at it to do it for you.
http://www.frozen-bubble.org/ example of a nifty game written with sdl_perl
While this may give a backbone for new programmers to get out their first game, the complexity of game making cannot be "simplified" more than it already is. Perl itself is slow, and not directly suited for making games. One would have to think carefully about what they wish to achieve before committing to making a game using SDL_Perl.
Tim Sweeney had a talk about related stuff at POPL'06, you can check the homepage for his slides.
Flash achieves this easily, especially with the dancing frog.
Liberty freedom are no1, not dicks in suits.
Think C64 games, but with true 24bit graphics at 640.
SDL+PERL can be thought of a 'flash killer' hack.... with enough specific libraries for sdl in perl, they
could do extra tricky bits animated mpeg1 in a sprite with one command.
Liberty freedom are no1, not dicks in suits.
What's up next?
Enhancing gui user experience with Oracle Forms
HowTo: Brute Force numbercrunching in Visual Basic
or
Windows 98 Security 101
So, sit down on your bums and write a Perl API for DirectX with good WINE support, folks. ;-)
"I love my job, but I hate talking to people like you" (Freddie Mercury)
Pygame is a really nice wrapper around SDL (http://www.pygame.org./ There are plenty of guides and tutorials on the website.
:-P
Why use Perl when you can use Python?
-Håkan
Moreover, writting in Perl is fast and easy. You can test your ideas, check if the game would be playable at all, create a working mockup in Perl and finding "not enough raw horsepower" move to C with the "final product". Sure it will take longer than writing everything in C from scratch, but shorter than writing everything in C and then deciding it sucks and abandonning it.
Anagram("United States of America") == "Dine out, taste a Mac, fries"
SDL is "a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer" (quote taken from the SDL web site). What about:
1) drawing functions
2) fonts
3) openGL
4) file formats
5) game GUI
6) sound formats
7) networking
8) configuration
etc?
there are various SDL-derived libraries that implement, more or less, the above, but they are C/C++ libraries, and the quality varies. Does Perl make it easy to use those libraries?
At last we can have Tetris with regular expressions.
Read my blog.
It's basically a wrapper for SDL that makes it extremely easy to make games with Python. You could easily make a working 2D game with sound and decent physics in an evening if you are already familiar with the language. I'm a relative newb, and even I was able to make a basic pong/breakout type game in a few nights. :)
Or use PyOpenGL and you can make some 3D games.
-- null
All that highly optimized C is part of a prewritten library (as is the case here).
For the remaining non-performance-critical stuff, Perl is often MUCH easier to develop with.
And in many cases, keep in mind the 80/20 rule of thumb. 80% of the time is spent in 20% of the code. This does vary, but in many cases the amount of highly optimized code needed for good performance is very little.
Many years ago, I was writing a program in Perl. I knew that there was a good chance I'd have to rewrite some of it in C eventually for decent performance, and this turned out to be true. In the end, I obtained 20-40 times the performance (and most likely 95%+ of the performance I would have obtained using C only) by rewriting approximately five lines out of 100-200 lines of Perl in C. The time it took me to figure out how to interface C and Perl (doing so was not documented very well then, it took me 2 weeks to find SWIG) was still far less than the time it would've taken me to write the entire program in scratch using straight C.
retrorocket.o not found, launch anyway?
Several games.
Jake2 (Quake 2 clone) as the AC already posted.
Puzzle Pirates
Tribal Trouble (good!)
check out javagaming.org for tons of discussions about the subject.
and tools? how about:
LWJGL: http://www.lwjgl.org/
JMonkeyEngine: http://www.jmonkeyengine.com/
Xith3D: http://xith.org/
And there are probably tons of other games and tools I'm forgetting.
And regardless what the trolls will say, it is perfectly possible to create a 2006-level game in java.
what really gets me is when you wan't to make some changes to open source software (particularlly windows stuff) and sure you can download the source but you have to spend hours messing arround trying to get the build environment right.
how the hell are users supposed to fix bugs that annoy them if they can't get the build environment right for the existing code?!
note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
http://www.panda3d.org/
And a little "Hello World" to show you the pwoer of it is at:
http://www.panda3d.org/wiki/index.php/A_Panda_%22H ello_World%22
Peace,
-Nick