Page 1 of 1

PHP based online card system ....

Posted: Mon Feb 21, 2005 7:01 am
by dodg
Hey there everyone

Ive finally got round to thinking about implementing an online card game on my website for me and my friends, using PHP and MySQL for the db. This would then link into a nice little stats program Ive been working on for the site so hold everyones, well, stats

Ive just started on the project but was seeing if anyone out there had tried it before, and if so what problems you had encountered. And if you havent tried it, what problems can you for see, and how do you think I could work round them. The project userbase is going to be small scale (theres only 40 members on the site), so I dont need to worry about handling large amounts of users, theres probably only going to be a maximum of 20 people using it at a time.

My general plan is as follows:
TableView.php - view the current tables are being used (tables, as in real life analogy, 'card table'), with amount on ppl on them, and if they are not full then the option to join (if they havent been started).
Then GameView.php or something, where all the action takes place.

So 2 main pages, one for selecting a game, and one for playing in the game.

Some problems I have envisaged so far are:
If your in the TableView page, the amount of players on a 'table' will change as ppl join, but I dont want to be auto-refreshing every few seconds to check for this, I want it to refresh on a 'as-needed' basis, ie just when someone joins that table.
This also goes for GameView.php, as if someone places a card then I want it to change, but not otherwise.

Of course, PHP probably isnt the best thing to write this in, so if people have some other suggestions I could head down let me know, its just that Im most familiar with PHP, so would be a quick start-up for me.

Thanks in advance for help / suggestions / comments.

Cheers
Nick

Posted: Mon Feb 21, 2005 8:47 am
by CoderGoblin
PHP is not good for "turn based" games where one user needs to wait for another player. The reasoning behind this statement is simple. There is nothing to tell a player waiting for his next turn if the other player is just taking his time to move or has "logged out" (e.g left the site/modem crashed etc).

The normal php type game as far as I can see relies on server cron jobs. The player has actions such as buying "troops", food, etc, designing space ships or moving troops from one location to another or even attacking based purely on attack value vs opponent defence value. There is no interaction between the two players themselves other than possibly messaging or chat. The cron jobs give a player more money/resources each "system turn". For examples see http://www.ferion.com
or
http://www.solarconflict.com

I am sure there are lots of others, just cannot remember any

Posted: Mon Feb 21, 2005 9:51 am
by dodg
What language / route do you think I should head down? I thought that that would be the case but was seeing if there were any little tricks in there .... but no, it was a silly idea :)

Thanks
Nick

Posted: Mon Feb 21, 2005 12:53 pm
by Chris Corbyn
Most of these online gaming sites just use java based applets