C
C
casuals2011-01-20 22:04:53
Adobe Flash
casuals, 2011-01-20 22:04:53

What technologies to use for a browser game?

The most primitive example: several players (2+) on their computers run an application in the browser in which each controls the ball. You can control with arrows. Those. when someone moves the ball, other players also observe this process.
Here's how to implement it. So far, only Flash and RTFMP come to mind? Are there any other suitable options?
Also, along the way, an ideological-technical question regarding the transfer of the movement of the ball? If I move my ball, what should I pass on to other players? new ball coordinates? position + direction? what to do if you want the balls for each player to have a different speed? etc.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Maccimo, 2011-01-21
@Maccimo

Also, along the way, an ideological-technical question regarding the transfer of the movement of the ball? If I move my ball, what should I pass on to other players? new ball coordinates? position + direction? what to do if you want the balls for each player to have a different speed? etc.
Transfer direction and speed from client to server.
From the server to send clients new coordinates of objects, directions of movement of all (!) Moving objects and their speed.
Until updated data about the positions on the playing field comes from the server, the client tries to calculate them on its own using the data on speeds and directions previously transmitted from the server.
Upon arrival of data on new positions, the coordinates calculated by the client are subject to correction in case of discrepancies.
It should be taken into account that in some cases this can lead to sharp "jumps" of moving objects on the map
. there may be delays in data transmission over the network.
Pros of this approach:
  • complicating the life of unscrupulous players who are trying to change the game situation bypassing the rules. For example, move to the opposite corner of the playing field by sending a specially formed command to the server. Pretty common, by the way.
  • combating the desynchronization of the display of the playing field for different players.

Minuses:
  • network delays can lead to unsightly visual effects
  • the motion calculation algorithm will have to be implemented both on the client and on the server. Moreover, they should return identical results for the same input data.

R
Rafael Osipov, 2011-01-20
@Rafael

A Flash frontend that connects to a server written in Java, for example, that exchanges information between players.
In the absence of information about the rules of the game and the gameplay, I will say roughly.
Pass old and new ball coordinates so that the client does not remember the old ball coordinates of each player.
Transmit the speed of the ball, if necessary.

K
Kirill Mamaev, 2011-01-20
@r00tGER

WebSocket - will help you. And the implementation, even a flash, even a Java script.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question