M
M
mrspd2012-01-28 08:13:06
Gaming consoles
mrspd, 2012-01-28 08:13:06

How are queues implemented in online games?

I'm still tormented by the question of how in ordinary browser games, in games in social networks, tasks are completed on time: building units, buildings, sending units.
There is a task, there is a time when it must be completed. But all this must be done in real time. Those. regardless of whether I am in the game or not, my opponents will still see the result.
What tools and methods exist for solving such problems?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Damir Abdullin, 2012-01-28
@mrspd

Somehow it was necessary to create a module for a browser game, which is responsible for restoring the character's standard of living. The task was solved by denormalizing the database - added the hp_last_update field. The value of this field was updated every time the user object was accessed, regardless of whether it is online or not. And then it’s a matter of technology - we have the current value of the standard of living and the maximum allowable, as well as the speed of its recovery. With the help of a simple formula, at the next update, we can calculate how much the standard of living should have been restored since the previous update and change this parameter. A similar method is applicable to other game objects.

V
Vitaly Zheltyakov, 2012-01-28
@VitaZheltyakov

Separate table for current tasks with a run time field. If necessary, the time is checked, if it has come up, then the task is performed. It is better to delete the completed task (although it depends on the situation).
Do not chase absolute "realtime" - this is not achievable, there will always be errors.

E
Eternalko, 2012-01-29
@Eternalko

A terrible word is: crown.

R
Ruslan, 2012-11-09
@Sect0R

You need to do 2 things:
1. yes, a separate field in the database or a table
2. for realtime - a frontend script (js or flash does not matter) that will check whether the task is completed or not.
Here, even crowns are not needed and it will smell like realtime.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question