21 reputation
2
bio website
location
age
visits member for 1 year, 8 months
seen Feb 14 '13 at 19:40

Feb
14
comment Implementing a build queue in a browser based game
Thanks for the insight Frhay, yes i think this is the approach i will adopt, along with a cron version that will thin the queue. It seems to be the most elegant solution given the situation and i dare say it can be easily switched between processing a single players events or processing the whole servers... Time for some testing i think, many thanks all :)
Feb
13
revised Implementing a build queue in a browser based game
added pseudo code for lazy load
Feb
13
comment Implementing a build queue in a browser based game
My concern over doing it lazily is that an action may lead to, for example, a change in a resource production rate and if the lazy trigger never gets called due a player being logged out and nobody interacting with their object, then this resource production rate won't update till the next time the player logs in, which would mean the have lost out on some resources... Though now i think about it, perhaps a hybrid approach of this lazy processing and a cron event to deal with "late" events could be the way to go?
Feb
13
awarded  Editor
Feb
13
comment Implementing a build queue in a browser based game
I should add, similar build queues can be seen in games like travian, grepolis etc. I'm curious how these games handle the events?
Feb
13
revised Implementing a build queue in a browser based game
added example games with similar build queues
Feb
13
comment Implementing a build queue in a browser based game
I beleive so yes, though perhaps not initially with just a few players. However when it comes to scaling for more players there could be multiple events happening per second and not just simple "build" events but "battle" events that could effect many aspects of different players accounts, not all of whom would be online on the time.
Feb
13
awarded  Student
Feb
13
comment Implementing a build queue in a browser based game
I had considered the cron approach but the nature of the events would mean i'd need a cron running every second which makes me think the continuously running event processor will be the way to go. Thanks for the suggestions, i'll do some reading up on them :)
Feb
13
asked Implementing a build queue in a browser based game