Multiplayer

Get help using Construct 2

Post » Thu Feb 07, 2013 7:10 pm

Hi guys,
first, sry. my very bad English... :)

no my question. I would like to now how to do a kind of a multiplayer game? like "Battleship" or something like this. what will be best way to do? Maybe whit "Ajax, mysql, php" or is there also a easier way to do?

thanks for all responses!sistemacomputer2013-02-07 21:12:10
B
9
S
4
G
3
Posts: 10
Reputation: 2,957

Post » Thu Feb 07, 2013 8:11 pm

Construct isn't equipped to do online multiplayer games. Though it can communicate with a server it doesn't do so in a way that can run a multiplayer game. You *can* create a multiplayer game where the players are at using the same computer, but that's it.
B
6
S
1
Posts: 40
Reputation: 917

Post » Thu Feb 07, 2013 8:13 pm

Online turn-based multiplayer is very much possible. Only games requiring fast, realtimy response-times are out our reach :)vee412013-02-07 20:13:52
B
24
S
8
G
7
Posts: 756
Reputation: 7,202

Post » Thu Feb 07, 2013 8:46 pm

This somewhat false, although it takes a lot of backend work to do it right, and it's not for fast paced action games. I'm working on rewriting an online game I had running a couple of years ago in C2, and it's working great.

Games that can live with Ajax calls as a primary means of playing can be done very easy in C2. Your C2 app becomes a UI container while the backend does all the work. It checks for updates from the server every x seconds, and when you click a button it sends that to the server for processing.

A battleship style game could be done in this way...but again it's beyond the scope of C2 itself to pull this off, as most of the game itself is being computed on the server in whatever language you're using there.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Thu Feb 07, 2013 8:49 pm

Well, I apologize for providing incomplete/incorrect information, I guess I don't know everything... yet! =)Phyvo2013-02-07 20:50:09
B
6
S
1
Posts: 40
Reputation: 917

Post » Thu Feb 07, 2013 9:10 pm

well thanks for the informations....

so there is also now way to "wait" for an update, like that the PHP script or what so ever is "sending" an information to the client that there is an data update. and when this signal is coming you make a ajax request?

more easy...

(my game is waiting)
(the other make a move or something, this update my data on the server)
(the server is sending an "ping" to my game)
(no my game check for this new data update)

so you don't have to make every x second a request!

is there a way to do something like this?

i hope you where understanding everything ;)
B
9
S
4
G
3
Posts: 10
Reputation: 2,957

Post » Thu Feb 07, 2013 9:29 pm

You can ping with ajax, and look for a serverside change. Also look at websockets (only in beta atm) as this is more tailored for this sort of thing.

What's the future of realtime multiplayer in HTML5? Anyone know what tech developments to keep an eye open for?
Moderator
B
72
S
13
G
11
Posts: 900
Reputation: 11,783

Post » Thu Feb 07, 2013 10:11 pm

@thehen yes i can "ping" whit ajax. but this means i will have to make a request to the server. it will be nice to have a way that the server is sending the ping to the client, so i don't have every x seconds a request.
B
9
S
4
G
3
Posts: 10
Reputation: 2,957

Post » Thu Feb 07, 2013 10:31 pm

Ajax is client initiated. Websockets would be the way to go, but that's another can of worms altogether. I'd suggest finding some good tutorials on Websockets before deciding to go down that route.
B
26
S
8
G
3
Posts: 210
Reputation: 5,973

Post » Thu Feb 07, 2013 10:45 pm

hm ok, thanks. i just read a bit on Wikipedia :)

Well is there a possibility to use websockets in construct 2? or maybe a extension or something like this?

anyway thanks for all! :)
B
9
S
4
G
3
Posts: 10
Reputation: 2,957

Next

Return to How do I....?

Who is online

Users browsing this forum: DemantDigitalArt, farfetchd83, mjj1990, spcsmrf and 7 guests