TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 04-09-2009, 10:16 AM   #1 (permalink)
The Contributor
 
hello-world's Avatar
 
Join Date: Feb 2009
Posts: 73
Thanks: 30
hello-world is on a distinguished road
Default pgn files for chess

There are many Chess and tactics Server using PGN files.
Are those games played on client side ?
Can anyone tell how they embed it into php ?

Last edited by hello-world : 04-10-2009 at 08:15 PM.
hello-world is offline  
Reply With Quote
Old 04-12-2009, 01:49 AM   #2 (permalink)
The Contributor
 
dschreck's Avatar
 
Join Date: Nov 2007
Location: California
Posts: 82
Thanks: 0
dschreck is on a distinguished road
Default

Quote:
Originally Posted by hello-world View Post
There are many Chess and tactics Server using PGN files.
Are those games played on client side ?
Can anyone tell how they embed it into php ?
Depends.

I'd have to say though, I'd rather just use flash for that type of board game. ActionScript 3 offers you a lot of control in flow, and the ability to create movie files for each piece. Which offers a lot of possiblities as far as adding spice to the game. Like pieces that walk to their position with animation, animiated combat, etc etc. ActionScript 3 can also be bundled with SmartFoxServer - which would allow you to have a multiplayer chess game in about 2 or 3 days of work.


But as far as doing it in just PHP... that's not too difficult either.

You have to set up a series of rules for the game, ie: pieces can only move in this direciton, only move so many spaces.

You could do it purely in JavaScript, which would be only client side. The problem with that is you're now relying on the player to not change those rules. So you'll need to validate the users actions on our server side.
This can be done with ajax.

Now making this multiplayer is a little more difficult, as you'll need to handle and hopefully maintain several sessions at once. You must also force the user to respond.

There's several design methods to get around this, not all of which I'm allowed to speak of due to where I work ;p


If you're looking on where to get started: Try it in PHP and JavaScript + some Ajax. Shoot, I'd say just get it to respond to where you click on the board.

Then try to get it to allow you pick a piece, and move that piece to that place you click.

Then, try and get it to respect the rules you want to use.

And yes, use pngs :)
__________________
Where I Ramble: http://www.iwilldomybest.com/
What I do: Zynga Game Network
Senior Software Engineer at CityVille
dschreck is offline  
Reply With Quote
Old 04-12-2009, 09:29 AM   #3 (permalink)
The Frequenter
Newcomer 
 
xenon's Avatar
 
Join Date: Dec 2007
Location: Bucharest, Romania
Posts: 438
Thanks: 3
xenon is on a distinguished road
Default

You'd need to parse the PGN files and extract information from that files in order to reconstruct a chess game. They are only "recordings" of chess games, if you're more confortable with that term. You COULD use PGN files to do that recording, or you could use your own programs to do that (as PGN files parsing is a more complex task). Use PGN files if you want to provide compatibility with the international chess leagues and such (it is a common format recognized by these authorities).

As already said before, you could make the game 100% server or client side based, or you could use both.

@dschreck: he asked about Portable Game Notation, not Portable Network Graphics (they have no generalities what so ever).
__________________
I have optimistic thoughts, even though sometimes (if not always) life's a bitch.
xenon is offline  
Reply With Quote
Old 04-12-2009, 08:22 PM   #4 (permalink)
The Contributor
 
dschreck's Avatar
 
Join Date: Nov 2007
Location: California
Posts: 82
Thanks: 0
dschreck is on a distinguished road
Default

Quote:
Originally Posted by xenon View Post
@dschreck: he asked about Portable Game Notation, not Portable Network Graphics (they have no generalities what so ever).
Hah! I misread :(
__________________
Where I Ramble: http://www.iwilldomybest.com/
What I do: Zynga Game Network
Senior Software Engineer at CityVille
dschreck is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Retrieving Files from a Backup in Vista CMellor The Lounge 2 06-24-2008 02:34 PM
Kidnapping files via URLs with cURL :) EyeDentify The Lounge 2 05-10-2008 09:03 AM
Zend Framework required files freenity Absolute Beginners 1 04-06-2008 05:13 PM
Notepage like application to open large MySQL files Wildhoney General 6 12-07-2007 02:18 PM
Uploading Files with PHP daz Absolute Beginners 3 09-30-2007 06:23 PM


All times are GMT. The time now is 02:20 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design