I'm coding a game in PHP, have most of it coded, but I recently implemented clans into the game. One of the features I would like to add in is Real-Time clan fights...however, I have not the slightest idea on the approach to Real-Time coding. Please help. :D
Real Time?
Started by
Guest_DiscoBob_*
, Jul 10 2006 04:05 PM
6 replies to this topic
#1
Guest_DiscoBob_*
Posted 10 July 2006 - 04:05 PM
Guest_DiscoBob_*
|
|
|
#2
Posted 10 July 2006 - 04:38 PM
Real-Time fighting in PHP? Hmm. I'm not sure that it is possible with PHP alone. Do you know Java?
How does the game work right now? Is it based off of a database? Got a link so I can test it out?
How does the game work right now? Is it based off of a database? Got a link so I can test it out?
#3
Guest_DiscoBob_*
Posted 11 July 2006 - 08:16 PM
Guest_DiscoBob_*
the link is at http://mayhem.sbdesigning.com
It's all text based, and runs off of a MySQL database...
It's all text based, and runs off of a MySQL database...
#4
Posted 12 July 2006 - 06:28 AM
That is a cool game! You'll have to use AJAX or Java+PHP to get real time fight.
#5
Guest_Jonas_*
Posted 12 July 2006 - 03:53 PM
Guest_Jonas_*
I don't know if you can get exact real time, but if you just had a database backend that you did not mind pounding into submission, couldn't you just create a turn-based environment (I guess you could do it without the database as well), and speed it up as such that it appears to be real-time. Ie there are actual rounds to the game, but perhaps those rounds are so short that the player would not even realize it.
By the way I am not sure how Java or Ajax would work for a real-time fight since those are both client side. The two clients would need to communicate for a real time battle. Would be better to do it just in PHP me thinks.
By the way I am not sure how Java or Ajax would work for a real-time fight since those are both client side. The two clients would need to communicate for a real time battle. Would be better to do it just in PHP me thinks.
#6
Guest_DiscoBob_*
Posted 12 July 2006 - 06:09 PM
Guest_DiscoBob_*
ya, I'm actually thinking of going with the quick turn based...maybe make the actual user status's and such in an iframe so i can call it to a page that refreshes with their new status, health, and such. And put in a "shoutbox" type thing so they can communicate.
#7
Posted 13 July 2006 - 09:51 AM
With AJAX you could run the PHP without having to refresh the users browser. This would be realtime. Since a large part of AJAX is java script you could also just use PHP and Java script. There is a tutorial in the XML, JSP and AJAX section about connecting AJAX to PHP and MySQL.
The thoughts mentioned above about a turn-based PHP/MySQL would work as well although not as good IMO.
The thoughts mentioned above about a turn-based PHP/MySQL would work as well although not as good IMO.


Sign In
Create Account

Back to top










