Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

Help needed with opensource "gif chess" game

gif chess, perl gd chess



2:50 am on Jan 16, 2009 (gmt 0)

5+ Year Member

I am going to write a full chess game using gd, which I have some experience of.

It will be really un oop programming and very inefficient. I want to then, with help from as many people as I can get to give me pointers, small or large, and even show me better code, make it 100% proper efficient well-written code, and even see if I can add it to the cpan libraries etc or other opensource projects and/or set up my own.

I'm actually v. interested in a.i. semantic programming and that's why perl is probably one of the most important languages I use. But I gather LISP is a "functional" language, or something, and I like the look of what I've been told and think it may play an even greater role than perl does (in my really big opensource project).

Maybe the chess opensource project will teach me how to do it, so that when I do it with the bigger project I can approach it with adequate experience.

Is this something others would be able to help with? It will take only a few hours for me to write the entire app in what I've been told is, probably, very "procedural" programming. Once I've got that, and I am guided through turning it into oop, changing everything (from scratch, of course), i will have myself a better defined production line - and I want to pour out LOTS of opensource material. I've got enough money, I'm doing this for the progress of humanity.


6:40 am on Jan 16, 2009 (gmt 0)

5+ Year Member

Sounds ambitious, good luck with your project.


9:19 am on Jan 16, 2009 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member

Yeah, quite a bit of work you've chosen.
I'm sure that many folks here would be happy to help out if you run into specific problems or try to guide you in design decisions.

are you planning for it to be a web app?


10:15 am on Jan 16, 2009 (gmt 0)

5+ Year Member

I suppose that probably is the right term? It'll be a web page with a gif on it - and a text box for a person's move!

I'm not sure - admittedly the graphics will be a pain in the ---, since I've only used gd maybe half a dozen or a dozen times (but to make graphs which monitored cash flow and stuff) and I'll spend AGES trying to get that stuff right! But it seems like a great way for me to learn to take my perl to the next level and learn how to be a much more organised programmer.

The a.i. will be web-based too - but give that MUCH longer for me to get started on (again) (previous work I did was in perl, but i started, would you believe, on a bbc basic 'port' on my old Mac LC, back in 1999!)

Cheers in advance for help with specific problems - I have no doubt I shall run into them. But I'm already planning in my head, thinking about what different packages, what different objects, etc I'm going to split this game up into. I WILL try to make it oop by myself but whatever i produce at the end is going to need a lot of changes and once I publish all my code and show you guys, I'm sure you'll be able to offer some suggestions without too much effort... seems a lot of perl wizardry flies about this forum.

I'm going to spend an hour or more in the local library's reading room today, with my blue camel book. There's no other way. If there was I'd have read the damn thing cover to cover YEARS ago!



*(Well, there's a REASON i didn't get round to mastering perl... i was mastering something else!)

[edited by: phranque at 8:03 am (utc) on Feb. 15, 2009]
[edit reason] No urls, please. See TOS [webmasterworld.com] [/edit]


2:47 pm on Jan 16, 2009 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

i would consider starting with some existing work and add on from there.
that's the way perl and open source works.
no experience myself, but you could start by looking at the Chess module on cpan.org:
Chess - a framework for writing chess programs with Perl - search.cpan.org [search.cpan.org]
there are others.

i find oo programming in perl is easier to understand than other languages.
you will probably get the most interest here on the web application aspect of your project.
i've already had some thoughts...

i say go for it!
there's quite a few perl experts here to smooth out the bumps.


4:26 pm on Jan 16, 2009 (gmt 0)

5+ Year Member

I already did a good hour's reading in the library. Such a great feeling. I'm going back for more in the morning. 2 hours tomorrow. You know I never knew about \G. It's amazing how many holes you allow in when you learn it the hands-on way, but that kind of leaves so much fun to be had at each step of the way! cheers everyone. I'll do that chess game within a month I'm sure - to be honest if I wanted to program it inefficiently, i could do it in half a day, but it would be REALLY BAD PERL. really bad. i'll do it properly, and you can help me iron out any crap that persists, eh?

cheers for the cpan link. i'll get on that before i do any groundwork on my chess game.


5:35 pm on Jan 16, 2009 (gmt 0)

5+ Year Member

There are recognized interfaces for writing GUI chess games, I think that is probably the link posted previously. You wouldn't need to use GD at all, just have some images of the chess pieces and an appropriate grid to know where to display them as they are moved. But playing chess as a CGI sounds tedious to me.


5:40 pm on Jan 16, 2009 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

how about a game where the community votes on the next move?
with a twitter interface...


5:46 pm on Jan 16, 2009 (gmt 0)

5+ Year Member

That's definitely got to be included in what I make, that's exactly the idea. Dunno about the twitter though! Some kind of social marketing zone, from what I read in the online entrepreneur files.

You wouldn't need to use GD at all

No doubt, but I HAVE to do that as well, one thing I do know, even if I'm not a perl expert yet, is that I love to mess around with the paradigm of mainstream behaviour and just go and defy it.

To build an entire range of games with GD, gif-only games, I would be producing a very useful thing for webmasters, in terms of their commercial activities... really really low-memory games. A single gif is a very small object. Typically when my crawlers download a forum's front page they find megabytes loaded with data. OOP, particularly in things as unnecessary-to-complicate as html and its variants and all this css and what have you, has one major downfall - it really annoys the hell out of machines looking for succinct code! Megabytes and megabytes of extraneous data, that's what my crawler sees when crawling just about any "mainstream" site outside google's front page!

So a collection of games in gif form is a pretty progressive concept, at heart! Not much room for anything past strategy games, but there's a LOT of them. Maybe even maze games! And who knows. I'll play around. But if I build the game-design environment properly with modules, packages, oop, serious organisation, I can set up a suite (opensource, I guarantee) which could help me (and anyone else) write as many games as we want with ease. One big aim I have is to learn how to write games for consoles (psp, sega, etc etc, nintendo, xbox, the whole lot. i just love programming).

Don't worry, I'm also playing with java so that I can write some fluid online games (and java doesn't have to be memory consuming either - it beats flash, I reckon). But my initial attempt to get help with this project in java was hampered by how rubbish sun's forum seems to be. Still, now I've got this GD idea I'm stuck on it - I could do it quickly, so I won't, i'll do it slowly. Why not? At least I know it's so weird that it's practically certain that no one else has made a gd chess platform or indeed a gd games concept! Bandwidth is going to become more expensive in the crash, I expect. All this flash development that teeters on the edge of pointlessness will probably start to just evaporate as future browsing environments abandon giving that medium the same priority treatment... there's so many shifts to come. All good ones, in my opinion. Intrinsically I have faith - not in the masses, but in the developers.


7:16 pm on Jan 16, 2009 (gmt 0)

5+ Year Member

Well, in an attempt to be honest, I think you're way ahead of me in your goals and ambitions. Maybe I know more perl than you at this point, maybe not, but if your walk matches your talk you'll be far ahead of me in no time at all. If you want the opinions and comments of some of the perl heavy weights you may want to pop on over to www.perlmonks.com and bounce your ideas off that bunch. I am a member there too but my participation on that forum is almost exclusively as spectator because most of the regulars are far more advanced than I am with perl and beyond.

Not knocking this forum, but www.perlmonks.com is the best perl forum, especially for unusual, advanced, or otherwise not easily answered questions or concerns about all things perl. Sometimes perl module authors and other respected perl community members still participate there or monitor the forum for specific types of questions. You might also want to start a project on sourceforge and see if you can interest other people to participate with you if that is a goal of yours.


8:50 pm on Jan 16, 2009 (gmt 0)

5+ Year Member

cheers, you're givin me pearls


11:39 pm on Feb 14, 2009 (gmt 0)

5+ Year Member

Update: I played "nonviolence chess" several times and it is starting to seem plausible that the game may not work. Sadly I have only one opponent so it's not a 100% reliable test.

Anyway, the GOOD NEWS... I have thought of the game I want to write which i'll do using GD.pm.

The game is called "The Integration Game"

and it is a world map, and you click on places (so the game will incorporate the use of html imagemaps) and proceed to play the game which challenges you to score points by integrating well in the world as a whole

When I get an idea for a game I want to write, it ends up written [snip].

So the integration game is going to be done and I'll come back and share all the code with you and hopefully that way I can learn to make it properly object oriented and use proper naming conventions etc etc ad lib and fade, exit pursued by a bear.

This is my normal procedure for programming. I don't do it the way anyone I've seen does it - but I doubt I'm alone in how I do it. So now I've got a project and sooner or later I'll suddenly want to make the beginning happen, due to coming up with the first idea for the first part of the game, and once that starts, the process will kick off, a bit like that excellent moment in Buffet Froid (Depardieu) when they are in the car park, and the game is afoot.

update to the update: if you lose the game, the world gets nuked, and it should hopefully cut to a scene of the globe blowing up! so you're playing to save the world. that should motivate you to play well, eh?

[edited by: phranque at 8:11 am (utc) on Feb. 15, 2009]
[edit reason] political discussion [/edit]


Featured Threads

Hot Threads This Week

Hot Threads This Month