A
A
AlexVedmak2014-09-29 19:38:45
Android
AlexVedmak, 2014-09-29 19:38:45

Network game on Android, how to write?

Hello. I want to write a network game on Andriod, but I don't understand how to do it. I understand that the game has three parts: logical, graphic and network. I have a vague idea how to write them separately, but how do I tie them together? Especially when you consider that on different engines you can write in different languages. Explain, please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2014-09-29
@AlexVedmak

You must have a client, a server, and a client-server protocol.
In the simplest part, the client connects to the server, logs in, and then the game-business logic comes into play.
The server accepts the connection, authorizes the player (identifies him) and then again the game-business logic on the server comes into play.
The protocol must uniquely identify all client actions and all server responses.
That. sequentially communicating the server and the client realize the game situation.
Inside the server, the logic should be much more complicated than the client one, because the server implements not only the rules of the game itself, but also all sorts of checks for a "fool" so that the client cannot cheat. Also, the server must organize the interaction between the players. In the simplest case, this is a kind of game room, and inside it 2 or more players create a game situation according to the rules of the game.
If you want to write a server from scratch, then I recommend looking towards Erlang.
There, each client can be responsible for his own process, for the game room too. And so the entire implementation of the game comes down to the correct sending of messages from the player process to the room process and back with the implementation of the game logic inside the room process.
In general, this is how it is. If you need help with Erlang, or writing such a server, I can help. Including the answers on this resource.

A
Alexander Taratin, 2014-09-29
@Taraflex

There are ready-made solutions, according to the first Google links
www.google.com/search?q=android+p2p+library&oq=and...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question