TankWars php multiplayer test

Show us your completed creations made in Construct 2

Post » Tue Nov 19, 2013 12:10 am

For another game I am making, I need to test php connectivity, so I am doing some tests for some php performance with this dummy game to see if it can support my ideaof multiplayer gaming

current online webvesion: Tankwars

1 large map 5kx5k, unlimited players
(though information says only 16, I would love to see it break :P)

Embeded screen size 800x600

Ajax posts to https php page with mysql back end with shared security tokens.

Events should get updated around every second or so, depanding on user internet speed and web server performance.

The tanks move a bit slow, but it helps sync :P

Got some familair tanks *pokes scirra*, sadly only the 0,90,180,270 tank angle images are aligned with the shots, so with the other angles the shooting looks a bit crooked :\


Its for fun and tests, feedback appreciated.
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Tue Nov 19, 2013 8:22 pm

Thanks for the help from the c2 community

par a few who clicked ... thanks anyway :P


I did however had more peeps testing and giving crucial feedback which lead to a day of freaking and adjusting hehe

now .. a kewl result might intrest some, ...

I used functions to call ajax post to a https php page (encrypted ssl), I eventually rigged the whole system to instantly do a new update request for data, executing a load of queries on php, where my ajax return data generally looks like:

updateplayerspositions|2889.08[]3183.02[]22.5[]b1dedc6272fbb0ba802ddcb5db1804b2[]2[]e6564ad047faccfe230da31b5826e3c9[]no[]player4[-]4642.81[]208.802[]270[]b1dedc6272fbb0ba802ddcb5db1804b2[]3[]b26a443cc7798405afde6bb257c6ff1c[]no[]!SS[-]1845.19[]4292.37[]180[]b1dedc6272fbb0ba802ddcb5db1804b2[]4[]ad44179f3358f4c80fa82c1e42148644[]no[]68.199.98.133[-]2038.25[]4302.03[]157.5[]b1dedc6272fbb0ba802ddcb5db1804b2[]5[]7e07dde6566ccf42f178a8638631d10a[]no[]219.75.53.247[-]2423.08[]3227.92[]22.5[]b1dedc6272fbb0ba802ddcb5db1804b2[]6[]e06e9580ee5529f6259c9dec01097740[]yes[]105.236.73.132[-]2440.18[]3094.52[]180[]b1dedc6272fbb0ba802ddcb5db1804b2[]8[]78361406b92a573d40abea47360d4274[]yes[]94.212.140.34[-]2726.23[]2036.82[]90[]b1dedc6272fbb0ba802ddcb5db1804b2[]9[]612e3cedf58a712066ffc5084b18807d[]no[]187.36.215.248[-]4544.25[]1724.13[]360[]b1dedc6272fbb0ba802ddcb5db1804b2[]10[]1dbf40699d17574be7891ca1ee61ebbe[]yes[]193.137.231.191[-]1115.46[]4439.68[]247.5[]b1dedc6272fbb0ba802ddcb5db1804b2[]11[]7a1d32a70d8f751ee0b9c289279c430c[]no[]145.255.240.129[-]4449.16[]3280.28[]90[]b1dedc6272fbb0ba802ddcb5db1804b2[]12[]42983e2d07484bfc20662d54ab8659a2[]yes[]SEASKY[-]3079.69[]2417.08[]270[]b1dedc6272fbb0ba802ddcb5db1804b2[]13[]4e28da739c3cc9ebc965b2236c58acbf[]no[]2.93.201.35[-]4081[]2949[]0[]b1dedc6272fbb0ba802ddcb5db1804b2[]14[]07e8c5b8618e36ff3add73fc3c4c3bcf[]yes[]173.186.88.229[-]2538.03[]3312.48[]225[]b1dedc6272fbb0ba802ddcb5db1804b2[]15[]efc5061b1061bec763adceeea0548a60[]yes[]IE10[-]1052.6[]3845.79[]67.5[]b1dedc6272fbb0ba802ddcb5db1804b2[]16[]cae64f25838aba6d827cc855bf7f0964[]yes[]213.74.166.193[-]3456.91[]3371.39[]247.5[]b1dedc6272fbb0ba802ddcb5db1804b2[]17[]a70532243d999affb1d8a2866cf3d774[]no[]84.78.209.51[-]1202.2[]495.407[]360[]b1dedc6272fbb0ba802ddcb5db1804b2[]18[]bf8e23befdb95d0aae2a507a7db40e25[]no[]84.61.176.195[-]|dbac50bd5637c4f39e371cc8a6035896|gameshots||alive|30|19|



and bigger, as this batch has no notifications ...

Anyway ... it might intrest some that all my requests got processed avereging ~210ms

;)lennaert2013-11-19 20:23:51
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Wed Nov 20, 2013 7:21 am

@lennaert
I clicked yesterday :)

Couldn't find anybody to blow up :(
Ran out of time so comment is late...

Very cool, would love a tutorial on this - ha ha, as it is extremely good multiplayer (I didn't have anyone else online though) but if there game play was like mine, it is super cool.

210ms isn't bad at all.DUTOIT2013-11-20 07:23:14
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,728

Post » Wed Nov 20, 2013 7:29 am

Hi, thanks for the reply :D

Early yesterday I had to redo a lot of the mechanics, so in various moments other enemies werent getting generated. they are now though, also it should show names somewhere around the tanks :)

Scores are being kepped permanent, if you die, you can restart now and play on with your scores, it also tracks how often your killed.
I'll add a highscore later on just for kicks.

I also added information displaying who killed who on the fly and when someone enters the game.

Each page refresh positions you somewhere random on one of the distribution points. This is to accomoate for the enormous space.

Problem with this thing is it needs a lot of players to battle and have fun hehe.   

For each browser you open the link in it will create a new profile and will be permanent on that device in that browser as long as the local storage is available :)   Only thing I noticed here is that CS2 hoold/resume with focuss can take a punch at the ajaxing.

And yes, everyones game play is the same, par IE11 glitches, but thats microsoft related hehe.

Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Wed Nov 20, 2013 7:56 am

Cool, got 1 kill. Damn walls/maze takes forever to get out - ha ha.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,728

Post » Wed Nov 20, 2013 8:06 am

Quit many ajax request will be expensive if you have more player. Wouldnt node.js be there better ?
B
15
S
6
G
6
Posts: 512
Reputation: 5,555

Post » Wed Nov 20, 2013 8:14 am

@Darklinki

Well, it seems to work fine, I just broughtt 20 players to life, (whom had died and not returned yet) and gave it a whirl.

Had 27 players being updated rapidly, I think my cs2 will be the first bottleneck. On full screen movement was a bit choppy, small screen it worked ok :)

Also, Havent dont anything yet with node.js, got it installed, but thats it.
I want to have it running on a decent server, with lots of mysql databases.

I'm a php programmer by nature, and so many stuff I can do with php mysql in minutes what takes hours for js techniques.


If these tests would be terrible, I would have made a switch, but so far so good hehe :D
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Wed Nov 20, 2013 8:16 am

@DUTOIT
[QUOTE=DUTOIT] Cool, got 1 kill. Damn walls/maze takes forever to get out - ha ha.[/QUOTE]


whahaha

you can use the refresh to start at another location, mind you, your old tank will take 3 seconds to be updated to the new location, in which time you cna still be killed :P   (prevent quick flee lol)
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,592

Post » Wed Nov 20, 2013 8:21 am

I did restart to refresh, but I refreshed at another point in maze.

As for ajax request being expensive, if you got a good server it shouldn't be too much of a problem. Obviously if it goes into thousands players, it should get problematic.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,728

Post » Wed Nov 20, 2013 8:31 am

@lennaert @DUTOIT yes thats what I think, what will you do if 1000 or more player will connect at the same time. Im also a php developer but I prefer node.js cause it just fits there better. But I think it will works why not, lets try it ;)
B
15
S
6
G
6
Posts: 512
Reputation: 5,555

Next

Return to Completed Creations

Who is online

Users browsing this forum: No registered users and 0 guests