Re: Game development approach

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2005-03-25 at 09:44, Alexandre wrote:
> Robert Cummings wrote:
>  >
> > Javascript. And perhaps use XmlHttpRequest to synchronize the game cycle
> > with your web server from time to time. Or if the pages are being
> > submitted, you can just synchronize at that time.
> 
> Hi Rob, thanks for your answer. Let me see if I got it right, I would use 
> javascript to be run on the client as to time the cycle and request the update 
> to the server, that would run the cycle. The XMLHTTPrequest would be used to 
> keep all the requests synchronized, so that one player can't get an update 
> berfore the cycle time is counted, and hence all players get the updates at the 
> same time. Is it so?

Well generally you will have many more clock cycles than can possibly be
fed by the PHP script on the server, but at the same time you want to
ensure that all your players are fairly equal. So using javascript to
produce the clock cycles on the client side will give you the
granularity you'll probably need, then every 10, 30, 60 seconds (or
whatever is necessary you can fire off an XmlHttpRequest in the
background to do things like synchronize the client's clock with the
server, and to retrieve any other information that might be important
(perhaps other plane positions, other players, chat channels, etc. Other
plane positions would probably require fairly short update intervals so
you could test for collisions. The XmlHttpRequest object will not ensure
that all players get an update at the same time, since you can't ensure
data reaches the client at the same time regardless of whether you
synchronize the requests on the server.

HTH,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux