Beta
×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Developing Games with Perl and SDL

ScuttleMonkey posted more than 8 years ago | from the set-us-up-the-bomb dept.

Perl 248

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."

cancel ×

248 comments

Sorry! There are no comments related to the filter you selected.

GNAA unveils "New for Jew Thousand and Six" lineup (-1, Troll)

Anonymous Coward | more than 8 years ago | (#14723312)

GNAA unveils "New for Jew Thousand and Six" product lineup
Sunday January 1, 2006

Ich Bindalross (GNAP) - Stuttgart, Germany Renowned homosexual and GNAA Director of Reasearch and Development Staos today announced the unveiling of GNAA's 2006 product line. Sitting in a lavishly decorated men's rest stop bathroom, he made the first of the day's groundbreaking communiqu regarding the "New for Jew Thousand and Six" products.

While gloryholing his fourteen inch nigger cock, Staos proudly annouced the newest product to pass the GNAA's rigorous R&D testing: FourRape. Said he: "FourRape is a fully extensible, java-based crapflooding solution, based on an innovative plugin architecure. In theory and with the right plugin, you could effectively Sodomize Without Consent (SWC) anything from Futaba image boards to the deep bowels of the vast left wing goblin kike conspiracy."

Upon ejactulation of a quart of semen upon the reporter's face, he finally said "Also on the list of hot new items for 2006 is LM Go [bordco.com] ". Continued Staos: "LM Go is a hand held device that when placed on a LAN, can effectively force all properly configured computers on that LAN to netboot LMOS, the Last Measure Operating System, resulting in faster Gay Porno content delivery to the masses. We expect to see field testing of LM Go as early as Febuary, with insertion into NTT/DoCoMo headquarters." Observed a random passerby: "It truly is a marvel what they're doing with technology these days. Just last week I had to go all the way down to my local crusing joint to get some hot nigger on nigger action. With LM Go, I can get gay porno throughout my entire subnet."


About GNAA:
GNAA (GAY NIGGER ASSOCIATION OF AMERICA) is the first organization which gathers GAY NIGGERS from all over America and abroad for one common goal - being GAY NIGGERS.

Are you GAY [hai2u.com] ?
Are you a NIGGER [mugshots.org] ?
Are you a GAY NIGGER [gay-sex-access.com] ?

If you answered "Yes" to all of the above questions, then GNAA (GAY NIGGER ASSOCIATION OF AMERICA) might be exactly what you've been looking for!
Join GNAA (GAY NIGGER ASSOCIATION OF AMERICA) today, and enjoy all the benefits of being a full-time GNAA member.
GNAA (GAY NIGGER ASSOCIATION OF AMERICA) is the fastest-growing GAY NIGGER community with THOUSANDS of members all over United States of America and the World! You, too, can be a part of GNAA if you join today!

Why not? It's quick and easy - only 3 simple steps!
  • First, you have to obtain a copy of GAYNIGGERS FROM OUTER SPACE THE MOVIE [imdb.com] and watch it. You can download the movie [idge.net] (~130mb) using BitTorrent.
  • Second, you need to succeed in posting a GNAA First Post [wikipedia.org] on slashdot.org [slashdot.org] , a popular "news for trolls" website.
  • Third, you need to join the official GNAA irc channel #GNAA on irc.gnaa.us, and apply for membership.
Talk to one of the ops or any of the other members in the channel to sign up today! Upon submitting your application, you will be required to submit links to your successful First Post, and you will be tested on your knowledge of GAYNIGGERS FROM OUTER SPACE.

If you are having trouble locating #GNAA, the official GAY NIGGER ASSOCIATION OF AMERICA irc channel, you might be on a wrong irc network. The correct network is NiggerNET, and you can connect to irc.gnaa.us as our official server. Follow this link [irc] if you are using an irc client such as mIRC.

If you have mod points and would like to support GNAA, please moderate this post up.

.________________________________________________.
| ______________________________________._a,____ | Press contact:
| _______a_._______a_______aj#0s_____aWY!400.___ | Gary Niger
| __ad#7!!*P____a.d#0a____#!-_#0i___.#!__W#0#___ | gary_niger@gnaa.us [mailto]
| _j#'_.00#,___4#dP_"#,__j#,__0#Wi___*00P!_"#L,_ | GNAA Corporate Headquarters
| _"#ga#9!01___"#01__40,_"4Lj#!_4#g_________"01_ | 143 Rolloffle Avenue
| ________"#,___*@`__-N#____`___-!^_____________ | Tarzana, California 91356
| _________#1__________?________________________ |
| _________j1___________________________________ | All other inquiries:
| ____a,___jk_GAY_NIGGER_ASSOCIATION_OF_AMERICA_ | Enid Al-Punjabi
| ____!4yaa#l___________________________________ | enid_indian@gnaa.us [mailto]
| ______-"!^____________________________________ | GNAA World Headquarters
` _______________________________________________' 160-0023 Japan Tokyo-to Shinjuku-ku Nishi-Shinjuku 3-20-2

Copyright (c) 2003-2006 Gay Nigger Association of America [www.gnaa.us]

Fine for simple games but... (1, Informative)

Viol8 (599362) | more than 8 years ago | (#14723325)

... I can't see perl being fast enough for games that require
really complex physics or enviroment calculations , or sophisticated AI.

I do think this is a nice way of getting people started in games
programming though.

Re:Fine for simple games but... (0, Troll)

shobadobs (264600) | more than 8 years ago | (#14723332)

I can't see perl being fast enough--

Obviously.

I do think--

Obviously.

Thanks for your contribution.

Re:Fine for simple games but... (-1, Offtopic)

Viol8 (599362) | more than 8 years ago | (#14723335)

Sarcasm is the lowest form of wit. You didn't even manage to
get that high. Loser.

Re:Fine for simple games but... (0)

Anonymous Coward | more than 8 years ago | (#14723378)

Replying to your own post in that manner is the lowest form of wit. You didn't even manage to get that high. Loser.

Re:Fine for simple games but... (1)

tgv (254536) | more than 8 years ago | (#14723394)

While I like the Oscar Wildeish style of your comment, the commentator is right: your post is one of the higher forms of obviousness. Your pride may be hurt, but there's no need to start calling names.

By the way, the tone of your reply is sarcastic.

Re:Fine for simple games but... (1)

Viol8 (599362) | more than 8 years ago | (#14723424)

>obviousness. Your pride may be hurt, but there's no need to start >calling names.

Nothing to do with pride. I do a harmless post and along comes
one of the standard issue slashdot yaboosucks crowd who do
nothing except make failed attempts at putting down others
because they think they're being standoffishly intellectual.
Its a bit sad.

>By the way, the tone of your reply is sarcastic.

One step up from his then.

Re:Fine for simple games but... (1)

shobadobs (264600) | more than 8 years ago | (#14723433)

Oh, grow up. You were karma-whoring at the top of a story and got called on it.

Re:Fine for simple games but... (0, Troll)

Viol8 (599362) | more than 8 years ago | (#14723618)

I don't need or care about karma. Not everyone who posts here
is a 13 years old or thinks like one. You were just being an
arsehole.

Re:Fine for simple games but... (2, Informative)

Anonymous Coward | more than 8 years ago | (#14723368)

Tim Sweeney had a talk about related stuff at POPL'06, you can check the homepage [princeton.edu] for his slides.

Re:Fine for simple games but... (1)

Andrzej Sawicki (921100) | more than 8 years ago | (#14723392)

When was the last time you saw a game with a sophisticated AI? Chess excluded.

Re:Fine for simple games but... (0)

Anonymous Coward | more than 8 years ago | (#14723420)

Since when are chess AIs advanced?

Re:Fine for simple games but... (1)

syntaxglitch (889367) | more than 8 years ago | (#14723443)

Chess AI is actually probably 90% brute force with some position evaluation functions using heuristics of some sort. Processor-intensive, yes, but not really "sophisticated". This works because any given board configuration has a limited number of availible moves, and look-ahead trees can often be pruned aggressively since bad outcomes are easy to recognize.

If you want a sophisticated AI, go find a program that plays Go at a master player level.

Re:Fine for simple games but... (1)

WillerZ (814133) | more than 8 years ago | (#14723619)

There are no programs that play Go at a master player level. I can beat most of them most of the time in ieven games, and I'm only 11 kyu.

Re:Fine for simple games but... (1)

maxwell demon (590494) | more than 8 years ago | (#14723665)

Well, that kind of supports the claim that an AI that plays Go at master player level would have to be quite sophisticated, doesn't it? After all, he didn't claim that you would actually succeed in finding it, did he?

Re:Fine for simple games but... (5, Interesting)

rheum101 (601693) | more than 8 years ago | (#14723401)



...it's an oversimplification to state that perl cannot achieve the same performance as C/C++ ... where 99% of the time is spent deep within optimized libraries and perl (or any scripting language) is used to initialize and facilitate interaction, then it is quite possible that no material performance hit will result ... only profiling can really reveal this ... ...and perl / PHP / whatever is a MUCH easier on ramp than getting into deep C++ OO structures...

Re:Fine for simple games but... (1)

Viol8 (599362) | more than 8 years ago | (#14723432)

True , but if most of your game is going to be written in
highly optimised C with a few dozen lines of perl wrapper, why
bother with Perl in the first place?

Re:Fine for simple games but... (0)

Anonymous Coward | more than 8 years ago | (#14723529)

You are missing the fact that proper utilization of optimized perl libraries will give most of these benefits without extended development time.

Easy (4, Insightful)

Andy Dodd (701) | more than 8 years ago | (#14723663)

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.

Re:Fine for simple games but... (0)

Anonymous Coward | more than 8 years ago | (#14723485)

That is stupid. The only way for Perl to not be a performance hindrance is for the game to not be compute-bound or to write the engine in another language and then using Perl for scripting. Then Perl is no different than the usage of every other scripting language in games. EVE uses Python. WoW uses Lua. Jack and Dexter have GOAL. Quake 3 had C + VM + custom shader and UI scripting languages.

Re:Fine for simple games but... (0)

Anonymous Coward | more than 8 years ago | (#14723673)

Actually eve client is 90% python, with only the core engine in C/C++.
Serverside is almost pure python, with just stackless python making it all run.

E.g. most of the gamelogic is python, not C/C++, only the graphics engine is in C/C++.

Re:Fine for simple games but... (1)

Vintermann (400722) | more than 8 years ago | (#14723415)

I don't think we're going to see all that impressive games for linux anyway, they don't follow the usual open source rules, as has already been discussed to death. They will be small, they won't have really complex physics or enviroment calculations, or sophisticated AI anyway. So they might as well be written in Perl.

(They can still be fun, though. Two amusing games, mortal szombat and frozen bubble, were written in perl as I recall. But they are both clones of old games on other platforms)

There is a way high-quality open source games could be produced, though, that I intend to promote. The group auctions at http://fundable.org/ [fundable.org] can at least be used to ransom games already developed, and that site shows promise. Perhaps it will be extended in such a way as to provide reliable up-front funding of FOSS games as well.

I'm trying out a promotion campaign through http://www.pledgebank.com/promotefundable [pledgebank.com] (you can tell I like these sort of schemes, can't you? :-)

Re:Fine for simple games but... (1)

somersault (912633) | more than 8 years ago | (#14723560)

why exactly are you wanting all your games to be Open Source? Most games will benefit a lot from being privately funded, and best of all, people get paid for doing a job that they will enjoy. Open Source is all nice and well if you're unemployed, or dont ever want to have free time. I did have fun making bots for Counter-Strike years ago, in between leaving school and starting uni, and I made the sourcecode available www.planethalflife.com/teambot , but not that I have a job I wouldnt want to spend my spare time coding up a professional level game and making it OSS (actually I have wanted to for a while, but I dont make the time). If I made some crappy little 2D space shooter then I wouldnt mind releasing that as Open Source, but if I made a really decent 3D shooter, or some 2D game with a lot of depth, then I think it would be fair if I wanted to try to make some cash off of that too, and then maybe release the source after 5 years or so. I enjoy giving back to communities, but if someone gets a chance to make a living from doing something they love (making games) then I fully respect and support them in wanting people to have to buy their game. Anyway I'll stop ranting

Re:Fine for simple games but... (1)

Volanin (935080) | more than 8 years ago | (#14723452)

I agree with you perl is not the most adequate for complex games, but this simple tutorial has cleared more doubts that I had than any C tutorial I have seen... VERY well written. =)

Re:Fine for simple games but... (0)

Anonymous Coward | more than 8 years ago | (#14723515)

Probably because you don't know C well enough!

Re:Fine for simple games but... (3, Insightful)

Vo0k (760020) | more than 8 years ago | (#14723468)

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.

That's cool and all... (0)

Anonymous Coward | more than 8 years ago | (#14723328)

But what if I'm too lazy to copy and paste, and just want to download the game?

Hmmmm.... (5, Interesting)

ObsessiveMathsFreak (773371) | more than 8 years ago | (#14723329)

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++?

Re:Hmmmm.... (2, Informative)

bhima (46039) | more than 8 years ago | (#14723413)

As a embedded developer, I think the simpler development environment you are opining about is this: http://www.xgamestation.com/about_gamestation.php [xgamestation.com]

Because much of the complexity new developers run into is baggage from the Operating System and the Development Environment.

And YES Linux is just as guilty as Windows is these days.

Think about it this way. (0)

Anonymous Coward | more than 8 years ago | (#14723549)

We had great game development libraries for stuff like that 10 years ago, e.g. Allegro [demon.co.uk] . While I appreciate the Perl support here, I don't think anyone would put more than a couple of hours' worth of effort into a game that doesn't support pretty 3D stuff on modern graphics cards. If you want to do such things, SDL_Perl isn't a viable option (look at the effort involved [bloodgate.com] ).

So, sit down on your bums and write a Perl API for DirectX with good WINE support, folks. ;-)

Re:Hmmmm.... (1)

WWWWolf (2428) | more than 8 years ago | (#14723791)

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?

Yeah - do I want to play games coded by people who started programming games in pure assembler? I mean, even the best game programmers make indecipherable code, and then they had to do that in a cryptic language that few people have patience to learn... =)

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++?

I think that Perl/Python/Ruby + SDL is definitely going to be an interesting as a whole platform for simpler games.

The scripting languages have also proved to be excellent platforms to do all sorts of prototypes of humongous systems in. With SDL, also great for game prototypes, even full games.

And yes, they are also great as an embedded interpreter in "real" games.

Python has been used for this. (2, Informative)

Poromenos1 (830658) | more than 8 years ago | (#14723330)

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.

Re:Python has been used for this. (1)

duncangough (530657) | more than 8 years ago | (#14723371)

Pygame is well worth a look, especially since the site got revamped and activity has picked up again.

I wrote two games using Pygame, Slider and WordSlider [suttree.com] which were pretty painless to do, going from a standing start of knowing nothing about Pygame to knowing enough to finish a game.

Sure, SDL might not be fast enough for any kind of 3D FPS but if you wanted to write one of those you'd be learning C++ or picking up some middleware like the Torque engine. Honestly, though, everyone in here should stop whining about how scripting languages aren't 'fast enough' for games - they're easily fast enough for puzzle and adventure games, just not *every* game.

The right tool for the job? Of course!

Re:Python has been used for this. (4, Informative)

Haeleth (414428) | more than 8 years ago | (#14723474)

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.

I don't know what game you're thinking of, but it certainly isn't Dungeon Siege, which was written very conventionally in C++ with DirectX. (It was originally developed with OpenGL, but the developers switched to Direct3D later on, possibly because the game was being published by Microsoft.)

At any rate, certainly neither Python nor SDL was involved at any stage.

Re:Python has been used for this. (3, Interesting)

monopole (44023) | more than 8 years ago | (#14723684)

The neat thing is that PyGame is very fast. I've used it to implement tricky realtime cluster rendering for 3d monitors as well as frame accurate animations for temporally multiplexed displays.
The nice thing about Python is that since it is bound to just about everything it also supports some very fast and powerful 3d engines such as VTK, OSG, and Delta3d.

Re:Python has been used for this. (0)

Anonymous Coward | more than 8 years ago | (#14723479)

Also I would mention I just completed the exact same game from chapter 11 of "Python programming for the absolute beginner" with pygames and livewires modules in 116 lines of eminently more readable code involving three classes, not almost 400 of some brutally ugly code.

I will have to sing the praises of perl's capacity to interface with an underlying linux system however, I have found python to be very weak and under-documented in the department of dealing with linux command line utilities.

Re:Python has been used for this. (1)

Valdrax (32670) | more than 8 years ago | (#14723725)

I have found python to be very weak and under-documented in the department of dealing with linux command line utilities.

Out of curiosity, what problems have you run into? I'd be glad to give some pointers since I've done a decent amount of work with Python in places where shell scripts would normally be used.

Re:Python has been used for this. (0)

Anonymous Coward | more than 8 years ago | (#14723484)

Yep, I would like to second Python and pygame as the more appropriate combination. If you learn Python instead of Perl as your first language you will have a much easier time learn C++ later.

Of course there are the philosophical issues. In Perl the philosophy is maximum expressiveness over readability, while in Python the philosophy is best summed up by following these simple instructions:

> python
import this

Ok yeah I have turned into a Python fanbay.

A CADD program I have been developing: http://www.dynamol.com/ [dynamol.com]
is getting a revamp with Python as the scripting language as opposed to Javascript. If I were starting from scratch I would certainly write a significant portion of the software in Python and use C++ for the computationally intensive portions.

Since scientific software and games can both contain computationally expensive parts it makes sense to have a language like C++ or D as the backend. However for fast development and you should choose a langauge like Python which will speed up development of other parts by about 5-10X. Plus you can become proficient with Python in about 1 week.

Yes. Python Rox!

Re:Python has been used for this. (0, Flamebait)

JackDW (904211) | more than 8 years ago | (#14723542)

Yes, pygame has been around for a while. It's a similar thing - an SDL wrapper for Python. But it is vastly superior because it is Python. Why would you want to write anything in Perl?

Perl programmers are just Python programmers who haven't yet seen the light. Perl is the BASIC of the late 90s: unfortunately, like some kind of zombie, it keeps staggering about spreading poor programming practices and unreadable code, and no-one can destroy it. For God's sake, stop writing Perl and learn Python. It will take you two hours and you will never go back.

Re:Python has been used for this. (2, Funny)

impossiblerobot (599495) | more than 8 years ago | (#14723608)

Yes, but in the two hours I spent learning Python, I would have already finished writing the game in Perl (and would have been playing it for an hour and a half).

Re:Python has been used for this. (0)

Anonymous Coward | more than 8 years ago | (#14723568)

It seems that Civilization 4 is using Python for modding too.

I think Python will gain some more adepts soon... ;)

Re:Python has been used for this. (1)

jonathan_ingram (30440) | more than 8 years ago | (#14723574)

Pygame was also used to write one of my favourite 'play for 5 minutes' games: SolarWolf [pygame.org] , a modern reimplementation of the Atari 2600 classic SolarFox. It even has a Windows executable download!

Re:Python has been used for this. (1)

Andreas(R) (448328) | more than 8 years ago | (#14723631)

Another game is OpenRTS [openrts.org] , which is a realtime strategy game developed using Pygame.

Here we go again (0)

Anonymous Coward | more than 8 years ago | (#14723659)

Some "development" topic comes up and out come the Python Zealots...

A 286 Emulator? (2, Funny)

joevai (952546) | more than 8 years ago | (#14723331)

Ideal. I always wanted my 4ghz pc to simulate the clock speed of a 286!

No, thats what flas is for. (2, Informative)

cheekyboy (598084) | more than 8 years ago | (#14723384)

Flash achieves this easily, especially with the dancing frog.

Wait a minute (4, Funny)

eclectro (227083) | more than 8 years ago | (#14723333)


I thought perl was already a game.

Well, duh! (3, Insightful)

GreatBunzinni (642500) | more than 8 years ago | (#14723337)

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.

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....

Re:Well, duh! (1)

iGN97 (83927) | more than 8 years ago | (#14723370)

Well, duh. It makes perfect sense; of course a guy named Bakun would throw Perl at himself.

Re:Well, duh! (2, Insightful)

Jedi Alec (258881) | more than 8 years ago | (#14723577)


        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.

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....


Because, well, C and Perl are the same level of complexity. All this superficial nonsense like garbage collection, not having to worry about memory allocation etc. won't save any time whatsoever.

example game (4, Informative)

falkryn (715775) | more than 8 years ago | (#14723343)

http://www.frozen-bubble.org/ [frozen-bubble.org] example of a nifty game written with sdl_perl

Re:example game (1)

falkryn (715775) | more than 8 years ago | (#14723349)

well, actually perl-sdl 1.19, not 2.x, but still, shows some of what can be done.

Re:example game (2, Informative)

lRem (914073) | more than 8 years ago | (#14723414)

Another nice one: SDL-Vexed [segfault.pl]

Hmm (2, Insightful)

darkmonkeh (953919) | more than 8 years ago | (#14723347)

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.

Tetris puzzle games, or c64 style games. (2, Insightful)

cheekyboy (598084) | more than 8 years ago | (#14723387)

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.

Re:Hmm (1, Insightful)

91degrees (207121) | more than 8 years ago | (#14723393)

Perl may be slow, but this doesn't always matter. If you use a fast high level API to deal with physics and graphics, and keep AI fairly simple, then the time spent executing perl code will be very small, and the effect on overall speed will be negligible.

Yes, but where is my Perl module to create (1, Funny)

antifoidulus (807088) | more than 8 years ago | (#14723380)

Korean women?
Do I win a prize?

Silly question. (1, Informative)

Anonymous Coward | more than 8 years ago | (#14723383)

It's in Korea, isn't that obvious?

Re:Silly question. (1)

maxwell demon (590494) | more than 8 years ago | (#14723519)

In Korea, your module only creates old women.

Portable? (1)

Nahooda (906991) | more than 8 years ago | (#14723391)

Yeah, maybe games are easily portably then, but actually, I don't want to see my games running on Windows...

-DBS

Re:Portable? (0)

Anonymous Coward | more than 8 years ago | (#14723459)

>>but actually, I don't want to see my games running on Windows...

God! What a petulant little prick you must be.

Anyway. Probably not much chance of seeing you games running anywhere other than on your own box.

Not anything new (1)

MORB (793798) | more than 8 years ago | (#14723398)

There's been SDL bindings around for a lot of languages for a while.
Personally, I think lua would be a much more interesting choice than perl for this.

Re:Not anything new (1)

peterpi (585134) | more than 8 years ago | (#14723495)

Anything would be better than perl :) C would be a particularly good... oh, wait.

Lua would be a good one though. It's found quite a little niche for itself in games as it is so easily embedded into a parent program. Lua would be a more relevant skill than perl for somebody looking to get into working in games. (IMHO)

Re:Not anything new (1)

maxwell demon (590494) | more than 8 years ago | (#14723525)

Anything would be better than perl

Anything? Never heared of it. Where do I get a compiler or interpreter?

Re:Not anything new (0)

Anonymous Coward | more than 8 years ago | (#14723690)

anywhere

Re:Not anything new (1)

Bazzalisk (869812) | more than 8 years ago | (#14723582)

Anything would be better than perl

There speaks a programmer who has never used INTERCAL.

Re:Not anything new (1)

JackDW (904211) | more than 8 years ago | (#14723553)

Python is an even better choice. Check out pygame. It's great.

p.s. Don't write anything in Perl.

Re:Not anything new (1)

MORB (793798) | more than 8 years ago | (#14723569)

Python is an even better choice.

It's a matter of taste. The only advantage of python IMO is that it comes with an standardized and large set of libraries.
This is not actually an advantage in every situation, though. And there's also plenty of libraries available for lua, only there is no standard package thereof.

obviously ... (0)

Anonymous Coward | more than 8 years ago | (#14723410)

"While programming using SDL requires knowledge of C and access to a C compiler, using SDL_perl does not"

yeah, seems logical when writing in perl .. which needs access to a perl interpreter and perl knowledge ...

It'd be nice if there was just an OS C/C++ "base" (1)

cyclomedia (882859) | more than 8 years ago | (#14723425)

i.e. something that compiles with gcc (though isnt particularly bothered about the version so long as it's newish) and even throw in project files for Visual Studio and Visual MingW and include a simple SDL powered "hello world", perhaps playing a sound and showing a couple of sprites and a 3d (opengl?) based ball bouncing about.

then all you'd have to do to write a portable SDL app is delete those things (all very clearly declared and laid out) and begin writing, safe in the knowledge that any porting problems are because you-the-code made assumptions about the size of int.

and if you can just "cd sdl_appbase" and "make" without having to run configure and install bash,python,gawk,cygwin and god knows what else then that'd be nice too.

Re:It'd be nice if there was just an OS C/C++ "bas (0)

Anonymous Coward | more than 8 years ago | (#14723532)

generally, the sort of person who's going to be successful at developing a game wouldn't need some absurd visual boondoggle like that. the reason you don't see a hand-holding-sdl-base-for-the-brain-damaged is because the sort of people this would "help" would never be able to get an sdl game off the ground anyway. people who are capable of writing game software are more than capable of installing their own development environment.

Re:It'd be nice if there was just an OS C/C++ "bas (3, Insightful)

petermgreen (876956) | more than 8 years ago | (#14723763)

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?!

Games in Perl? (2, Funny)

cablepokerface (718716) | more than 8 years ago | (#14723441)

What's up next?
 
  Enhancing gui user experience with Oracle Forms
  HowTo: Brute Force numbercrunching in Visual Basic
or
  Windows 98 Security 101

Re:Games in Perl? (1)

GreggBz (777373) | more than 8 years ago | (#14723530)

For most amatures, the development environment is more important than speed and efficiency of the compiled code. What can I use to implement my really brain twisting algorithms with the most ease and elegance. What can I use to get closest to the API and the math, because that is more important to understand in game development land then the language. So, if you already know Perl, go for it. But for me, Perl does not immediately come to mind. I've been writing games in VB.NET and DirectX for a few years, and the brain dead IDE and robust object oriented features of managed .NET code make it a pleasure. And, to put away all those stubborn myths about VB, you can write a 3d game pretty close to commercial quality with a lot less effort. Besides, unless your writing DOOM, CPU cycles are cheap, really cheap. My time spent obfuscating code is not so cheap.

Re:Games in Perl? (1)

cablepokerface (718716) | more than 8 years ago | (#14723646)

Your are correct actually, in my little joke I should have added the 6.0 after 'Visual Basic'. I code .NET also (although c#) and indeed, both the languages are a pleasure. I can't wait for the whole managed directx 10 hive to start.

Low level 2d game libraries are so 1990's ... (2, Interesting)

Lazy Jones (8403) | more than 8 years ago | (#14723455)

We had great game development libraries for stuff like that 10 years ago, e.g. Allegro [demon.co.uk] . While I appreciate the Perl support here, I don't think anyone would put more than a couple of hours' worth of effort into a game that doesn't support pretty 3D stuff on modern graphics cards. If you want to do such things, SDL_Perl isn't a viable option (look at the effort involved [bloodgate.com] ).

So, sit down on your bums and write a Perl API for DirectX with good WINE support, folks. ;-)

Re:Low level 2d game libraries are so 1990's ... (1)

dreemernj (859414) | more than 8 years ago | (#14723566)

I've used Allegro in the past but I am a n00b and was wondering how Allegro compares to things like SDL. I've had people tell me to try out SDL instead but can't really find a good reason to. Is it supposed to be more powerful or something? Or more compatible? Or do people just like it more?

Re:Low level 2d game libraries are so 1990's ... (1)

arevos (659374) | more than 8 years ago | (#14723790)

There are numerous cross-platform open source OpenGL 3D engines that have scriping hooks. OGRE, CrystalSpace and Panda3D spring to mind. I'd personally go with Panda3D and Python, if I wanted to create a modern-looking 3D game with minimal effort.

Or invest in Torque3D.

Re:Low level 2d game libraries are so 1990's ... (1, Interesting)

WWWWolf (2428) | more than 8 years ago | (#14723813)

You can use OpenGL in SDL. The net effect, with all of the SDL extra libraries is something along the lines of the entire DirectX toolkit already.

PyGame (2, Informative)

hwaara (226026) | more than 8 years ago | (#14723463)

Pygame is a really nice wrapper around SDL (http://www.pygame.org./ [www.pygame.org] There are plenty of guides and tutorials on the website.

Why use Perl when you can use Python? :-P

Re:PyGame (1)

brpr (826904) | more than 8 years ago | (#14723667)

Because Python has broken lexical scoping!

Re:PyGame (1)

arevos (659374) | more than 8 years ago | (#14723745)

Because Python has broken lexical scoping!

This is no longer true, and hasn't been for years.

Re:PyGame (1)

brpr (826904) | more than 8 years ago | (#14723788)

I'm afraid it is still true. Lexical scoping has never been properly fixed in Python in relation to closures. See this link [python.org] for an excellent explanation. Perl does lexical scoping just fine, and I like explicit variable declarations, even in a scripting language.

Re:PyGame (1)

Ekarderif (941116) | more than 8 years ago | (#14723727)

Because people are masochists?

Don't forget ruby! (0)

Anonymous Coward | more than 8 years ago | (#14723776)

"Rubygame has SDL as a backend, and is styled after the very nice pygame." It's in active developement but is very usable.

http://rubygame.seul.org/ [seul.org]

games companies should be all over this (0)

Anonymous Coward | more than 8 years ago | (#14723547)

The obfuscation and unreadability of perl makes it a great way to keep competition from building upon your source.

What about all the libraries SDL is missing? (4, Insightful)

master_p (608214) | more than 8 years ago | (#14723548)

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?

Re:What about all the libraries SDL is missing? (3, Informative)

TommyBear (317561) | more than 8 years ago | (#14723692)

There are other thirdparty libraries that offer this kind of support:

http://www.libsdl.org/libraries.php [libsdl.org]

There is even an SDL based opengl render target.

Tommy.

Finally! (3, Insightful)

jalefkowit (101585) | more than 8 years ago | (#14723555)

At last we can have Tetris with regular expressions.

PyGame, different language same idea (2, Informative)

rtos (179649) | more than 8 years ago | (#14723561)

If you are into Python rather than Perl, you might want to check out PyGame [pygame.org] .

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 [sourceforge.net] and you can make some 3D games.

Other languages (1)

squoozer (730327) | more than 8 years ago | (#14723573)

[puts on flame suit] This is going to be controversial I know but has anyone tried developing a real game in Java? (by real I mean something that you don't play on a mobile phone) I realize that the GCing could be problematic but it is possible to minimize or even eliminate that problem. Other than that I think the language is probably fast enough now and I would have thought that the lower development time would encourage games houses. Perhaps it's simply that the tools aren't there for Java yet (maybe they never will be). Any thoughts?

Re:Other languages (0)

Anonymous Coward | more than 8 years ago | (#14723653)

Re:Other languages (2, Interesting)

Tusaki (252769) | more than 8 years ago | (#14723739)

Several games.

Jake2 [bytonic.de] (Quake 2 clone) as the AC already posted.
Puzzle Pirates [puzzlepirates.com]
Tribal Trouble (good!) [tribaltrouble.com]

check out javagaming.org [javagaming.org] for tons of discussions about the subject.

and tools? how about:

LWJGL: http://www.lwjgl.org/ [lwjgl.org]
JMonkeyEngine: http://www.jmonkeyengine.com/ [jmonkeyengine.com]
Xith3D: http://xith.org/ [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.

Quick Prototyping... (1)

MaestroSartori (146297) | more than 8 years ago | (#14723575)

...of 2D games can be done fairly easily and quickly in Flash. I'm really quite surprised there hasn't been more of an effort made for an Open Source alternative to Flash, maybe the reputation it has for being slow, evil and crap has too much of a foothold, but it's actually quite a nice environment to work in for testing some stuff.

As for this, I suppose it's nice enough. I don't see what it brings to the table that hasn't been done many times before, in many different languages, but making games is fun enough that I do it for a living, so the more people who can have fun doing the same thing the better :)

If you want to make money... do it with Java... (1, Interesting)

MosesJones (55544) | more than 8 years ago | (#14723597)

Mildly interesting but in terms of modern games it won't cut the mustard so then you are looking at smaller games and a platform to learn on. IMO there is only one top platform to learn game programming for and that is the Java mobile phone platform J2ME [sun.com] that even comes with a standard (and pretty simple) 3D API [jcp.org] . Its also the fastest growing gaming market out there at the moment, and its still an area where mere mortals can break in and create the killer game and make money. Aiming at the PC market means you are against the multi-million dollar budget folks and that just isn't sensible.

If you want to learn game programming... get a decent phone.

Re:If you want to make money... do it with Java... (1)

jetxee (940811) | more than 8 years ago | (#14723717)

If you want to write games just for fun, do it with SDL-anything-you-like :)

Python & SDL = Pygame (0, Redundant)

Andreas(R) (448328) | more than 8 years ago | (#14723623)

Actually, I think Python and SDL is a far better combination, see pygame [pygame.org] . As example of such a project is , developed using Python and SDL. [openrts.org]

Frozen Bubble (0)

Anonymous Coward | more than 8 years ago | (#14723705)

Yeah Frozen Bubble [frozen-bubble.org] is Da Perl-written Game!

Screw SDL... How about Perl/Tk? (0, Offtopic)

Washizu (220337) | more than 8 years ago | (#14723747)

I wrote a tetris variant in Tk that runs pretty well.

Ok, it barely refreshes fast enough to be playable.

But still, it's awesome. Try it and you'll find out why.

Play Spew [bengarvey.com] .

Load More Comments
Slashdot Login

Need an Account?

Forgot your password?

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>