Re: Games in Perl
by jepri (Parson) on Jan 10, 2002 at 04:24 UTC
|
At the moment it is difficult enough to do any form of graphics in perl, like displaying menus or buttons (no more difficult than in C, but that doesn't make it easy). Part of this problem is the not-crossplatform nature of graphics. As of a month ago, I was unable to find a interface to any 2D or 3D graphics engine for perl.
The best hope you have for graphics engines is to write a wrapper or interface to an existing engine like Nebula or Crystal Space.
However, Perl excels at being a server for distributed games, and there are a number of MOOs, MUDs, MUCKs and MUSHs not to mention many many CGI games that demonstrate this.
Nebula in particular looks very good for hitching up to perl. Unfortunately the last release was a year ago :( It's not terribly well documented, and half of that is in German.
____________________
Jeremy
I didn't believe in evil until I dated it. | [reply] [Watch: Dir/Any] |
|
I mostly agree, but what's wrong with Perl/Tk, what with its GUI widgets and Canvas for drawing stuff on? Of course, while you might have fun in Tk with vector drawings and static bitmaps (remember how we all loved mostly low-rez Wizardry on our Apple IIs?) you probably won't find an interface to OpenGL in Perl. Oh wait. You will. *grin* (and no, I've never used it, so I can't actually say that it's worth a look).
And if those engines exist with C interfaces and you gots skillz, maybe you'll be the hero by writing the XS to make them accessible to Perl. But frankly, I doubt a scripting language is a good place to write "action" oriented games with polygonz running all amok. But Perl makes a great place to implement an interface to GNU chess or a networkable or mildly AI'ed strategy or card game.
Besides I seem to recall a recent article I read where the most popular computer games were Minesweeper and Solitaire, so maybe the interface isn't that big of a deal.
| [reply] [Watch: Dir/Any] |
|
Tk was kinda what I was referring to above. It's OK for basic stuff, but even GTK+ ain't got great gaming libraries.
I pumped Nebula a little bit because it is a combination of fast C and easy to use Tk - could just as easily be perl. The Tk does the high level scene arrangment, and the C makes it go fast. Quite cool. ____________________
Jeremy
I didn't believe in evil until I dated it.
| [reply] [Watch: Dir/Any] |
|
But you're forgetting gtk-perl!!! ;)
It currently has support for all gtk+ 1.2 widgets, much of GDK, libgnomeui, and a few other things. It's worth checking out as a GUI for non-3D games.
| [reply] [Watch: Dir/Any] |
Re: Games in Perl
by gri6507 (Deacon) on Jan 10, 2002 at 06:53 UTC
|
In the past, I have written some basic "board" games like tetris,minesweeper, and tic-tac-toe in Tk. You can find the code for tetris at here. This page is a Tclet game, but also contains the Perl/Tk version. I have found that for games like that even my beginner Tk skills were adequate.More recently, I became interested in doing simple 3D graphics in Tk. Even thouhg most low-level 2D support is existant within the canvas widget, when 3D applications are involved, the display slows down for even something as simple as a rotating cube. (Mind you, my 3D abilities are very rudimentary, and I am sure that optimization is in order). I would certainly be interested in playing around with what I have so far to see how much I can push Tk. I would be very interested to see what, if anything, you have achieved so far. | [reply] [Watch: Dir/Any] |
|
Hi gri6507,
I too am messing around with 2D and 3D graphics
in Perl/Tk. What I want to know is have you been
able to get around the "flashing" problem when
animating things on the canvas.
Any suggestion or moral support welcome.
--
Its like a dog that can sing and dance.
It's remarkable because it can do it.
Not that it can do it well.
| [reply] [Watch: Dir/Any] |
|
| [reply] [Watch: Dir/Any] |
Re: Games in Perl
by toadi (Chaplain) on Jan 10, 2002 at 14:01 UTC
|
http://sourceforge.net/projects/sdlpl/ look at this link. This will provide you a multimedia library SDL(like directX but crossplatform); this particular site provides the perl bindings to that library :)
-- My opinions may have changed,
but not the fact that I am right
| [reply] [Watch: Dir/Any] |
Re: Games in Perl
by theorbtwo (Prior) on Jan 10, 2002 at 04:35 UTC
|
In addition to the stuff mentioned above, for realtimeish games (which is many of them), perl can be terribly slow.
For that matter, even C can be terribly slow; they often have handwirtten assembler for the more time-sensitive parts, even with hardware graphics rendering.
Also, perlscript has a very small audiance -- AFAIK, it's only usable on IE with ActiveState perl installed.
Thanks,
James Mastros,
Just Another Perl Scribe
| [reply] [Watch: Dir/Any] |
|
Actually PerlScript can be used server-side as an ASP language for IIS or PWS. Unfortunatly, I don't see much use in ASP for gaming. Perl programs can be converted to Active X controls with ActiveState's PerlCtrl, but I've never tried that. I'm not a big Active X fan.
There are some fairly simple Tk games out there, This site has more information on Tk Games.
| [reply] [Watch: Dir/Any] |
|
I stand corrected. (OK, sit corrected, if you want to be technical.)
Thanks,
James Mastros,
Just Another Perl Scribe
| [reply] [Watch: Dir/Any] |
Re: Games in Perl
by $code or die (Deacon) on Jan 10, 2002 at 15:45 UTC
|
Look at some of the games written in Perl.
Check out my SameGame.
There are a few other games dotted around the monestary. Dig deep into Obfuscated Code, Code Catacombs and Craft
My favorite Perl game was an obfuscated frogger clone which won the 5th Obfuscated Perl Contest
Simon Flack ($code or die)
$,=reverse'"ro_';s,$,\$,;s,$,lc ref sub{},e;$,
=~y'_"' ';eval"die";print $_,lc substr$@,0,3;
| [reply] [Watch: Dir/Any] |
Re: Games in Perl
by Torgo (Beadle) on Jan 10, 2002 at 22:31 UTC
|
Yeh, if you're talking about web-based games (and I assume
you are) Perl doesn't make a good front end. Perl can,
however, make a good back end, managing users and global
high score lists or whatever.
Here's two games I've written with a JavaScript front end
and a Perl back end:
Bubble Crack (kinda big)
Burster (kinda old)
Incidentally, If you are interested in doing the front
end in JS, I've written a cross-platform, cross-browser
library for dealing with layers:
SmartLayers
-- I write the code while the master is away!
| [reply] [Watch: Dir/Any] |
A reply falls below the community's threshold of quality. You may see it by logging in. |