mmofacts.com

Combat system

posted 13 years, 10 months ago by Ahdam

does anyone have a good solution for handling attacks in a strategy travian-like browser based game?
tha way i was thinking this whole thig works is like this:
1 cron-job every 5 mins, go through the attack table, and populate a smaller auxiliary table, where you keep all the attacks that will happen in the next 5 mins (grouped by seconds)
another cron-job that will run every 1 second, and that goes through the smaller table, and launches the attack script for every attack that is programed for the next 5 mins removing them after the attack is resolved
I think this will crash the server :) considering the fact that this will have to happen simoultanious with all the other game requests
Do you have a better suggestion on how to handle this problem?

Reply to this discussion