Quartz.NET for online game schedules

I plan to create an RTS online game that will use Quartz.NET to update values ​​in the postgresql database.

Here is an example script in the game.

  • The player will create the building and there will be time until its completion. The completion time will be calculated and stored in the database.

  • As soon as the production of the building begins, I will create a quartz trigger that will act when the time comes to complete the building. The trigger initiates a task that will update the value in the database, requesting that the building is already completed.

In this scenario, we can conclude that there can be one hundred thousand quartz triggers that can be created, given the huge number of players in the game.

Here are my questions.

  • Is quartz suitable for this online application? If so, should I have a separate server to host Quartz and its tasks and triggers? What should be the minimum specification of my server?

  • If quartz is not suitable for this, what can be alternative solutions? I have seen many RTS online games on the Internet that are dedicated to the unique completion of production units, but I have no ideas for their implementation.

Thanks.

Your

Mark

+4
source share
1 answer

As said, you can update your database with the expected completion time. In addition, there is no need to sync with your client upon completion. You can tell the client: this building will be completed by XYZ, unless I tell you differently.

Most game servers probably don't use quartz, but rather a series of events of some kind. Also; Do not use your database for real-time updates. Make your updates in memory and record in the background for better performance. In the event of a failure, you only lose events that have occurred since your last recording action.

0
source

Source: https://habr.com/ru/post/1382642/


All Articles