Page 1 of 1
PVP in php is it possible(non turn based)?
Posted: Thu Dec 15, 2011 1:22 pm
by fash
Hey guys am new here and am novice too. I got a question that can we develop player versus player live with php non-turn based in a way. I mean that they sholud be able to use their spells or power or whatever they wish in real time and not turn based. If u have some alternative to php its ok for me i'll learn that too.Btw i know AS3 HTML CSS PHP(learning) JAVA(learning) javascript(I am planing to start when i finish php to a decent level).

.
Re: PVP in php is it possible(non turn based)?
Posted: Thu Dec 15, 2011 3:06 pm
by Zyviel
You might could use ajax/javascript. There are tutorials on W3Schools web site on how to use ajax. I made a chat box that uses a java timer to call the ajax function to check once a second for any new chat messages.
You could also use the java timer to submit a php web page once a second to check a database for people in range of each other that have a target and maybe a move readied.
Re: PVP in php is it possible(non turn based)?
Posted: Thu Dec 15, 2011 3:32 pm
by fash
well Zyviel the way you suggested is good but I think this method will lead to lag problems coz the timer may check the player stats a bit late which will lead to various problems like say if player1 almost killed player2 (this was the latest check) and by some luck player2 happens to use his best spell enough to kill player1 so this will kill player1 if we see through eyes or player2 and in that time it happen that player1 also killed player2 since both cant die we cant find out who actually died coz the timer didnt check them.
for w3schools i see this ----->
w3fools.com<------
Re: PVP in php is it possible(non turn based)?
Posted: Thu Dec 15, 2011 3:56 pm
by Zyviel
Good point fash.
I would recommend you make your own cron that runs on your home computer. This homemade cron would resubmit the php web page every second to check the database to see if anyone is near to its target and if so carry out the attack that they asked to be readied. You could also keep track of when their last attack was made and make sure there is a proper delay between attacks.
There would also be code in the cron webpage that handles the attack's effect on enemy players and player deaths.
Re: PVP in php is it possible(non turn based)?
Posted: Thu Dec 15, 2011 5:40 pm
by Torniquet
non-turn PVP is very difficult to achieve. I personally recomend for php and ajax alone.
If you know AS3, I would use that and learn some socket programming to accompany it.
Re: PVP in php is it possible(non turn based)?
Posted: Fri Dec 16, 2011 4:50 am
by hallsofvallhalla
There are tutorials on W3Schools web site on how to use ajax.
I also have tutorials on ajax............video tutorials.........