D
D
Darkzenon2017-03-28 12:27:31
MySQL
Darkzenon, 2017-03-28 12:27:31

Prototyping a server game?

Greetings.
Was wondering how to create a game on android with a server on raspberry/PC.
Was inspired by the article https://www.ibm.com/developerworks/en/library/x-an...
"creating a multiplayer tic-tac-toe game"
But in my idea, clients should click who is faster or take into account the order of clicking.
in Article link, SQL server, PHP handler with xml output, android application.
The question for connoisseurs is whether it is possible to implement on this bundle the connection of several clients, taking into account who pressed the button faster. or there are much more humane solutions.
I did not come across such technologies, so I ask the guru.
upd0. distance all in one room with phones or tablets. those. ping will be +- identical.
upd1. If put into practice. something like guess the melody for 10-20 users. total 1-20 clients. as soon as the music sounds, you need to press the guess button and say for what amount. auction principle. who is the first and who is more than that and sneakers. I have a doubt about php and xml that it will be too slow.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
N
Nikita, 2017-03-28
@Darkzenon

It's easier than ever to open a TCP socket and play json through it. What to implement? There are many languages ​​that support this.
a little bit offtopic
If the game is just to press a button, and it all happens in the local network, then the easiest option is to make a web application and use Websocket.
What are the advantages of this:

  • It will take no more than a day to complete.
  • If you open the socket during the "start of the game", then technically all connections are open and when you click on the button, the time to open the socket will no longer be spent
  • Convenient "installation" of the application: logged in from the browser using the ip:port of your server and you are already in the game
  • Cross platform
  • Come up with your own...

S
Saboteur, 2017-03-28
@saboteur_kiev

You can simply check the time when connecting clients, store the local time of each player, then check the cat pressed the timestamp faster (comes from the client)

D
Dark Hole, 2017-03-28
@abyrkov

No way. On the server there will be problems with a non-instant connection, but on the client everything can easily be broken.

X
xfg, 2017-03-28
@xfg

It is necessary that the server take into account network latency. To do this, on the server side, you need to create a timestamp and subtract the latency to get the real time the client clicked the button. Then it remains to compare the timestamps of the two players and determine the winner. Without taking into account latency, the one with the shorter packet route is in priority. You can read about the problems of online real-time games, there is about it.

X
xmoonlight, 2017-03-28
@xmoonlight

I will add to Nikita :
It is possible to dynamically determine the delay to all clients (latency) through heartbeat-ping. And referring to the highest ping, make a time adjustment on the client and check the receipt of all packets along with the timestamp click time.
If the delta of the time of pressing and the time of arrival does not correspond to the heartbeat ping and the difference exceeds the sigma error, then this is a cheater.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question