RealTime browser games
-
Hey all, Me and a couple of friends are developing a browser game similar to Travian (as in, jobs are tackled in real-time not turn-based). Now, we have been trying to see what's the best way to do this real-time thing online where the user can logout and whatever is queued will still be executed once the time passes. The only way to solve this that we thought of is to: - have a table with logs as to what is queued and what event to fire when the time ends - every second have some software running on the server which will check if any logs have expired and execute their event then delete from the queue The problem with this is that we need to have some software hitting the database every second, which doesn't make much sense. What do you all think? Is there a different way of doing this which we're not seeing?!?! Thanks a lot
In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)
-
Hey all, Me and a couple of friends are developing a browser game similar to Travian (as in, jobs are tackled in real-time not turn-based). Now, we have been trying to see what's the best way to do this real-time thing online where the user can logout and whatever is queued will still be executed once the time passes. The only way to solve this that we thought of is to: - have a table with logs as to what is queued and what event to fire when the time ends - every second have some software running on the server which will check if any logs have expired and execute their event then delete from the queue The problem with this is that we need to have some software hitting the database every second, which doesn't make much sense. What do you all think? Is there a different way of doing this which we're not seeing?!?! Thanks a lot
In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)
I'm a bit sleepy after lunch, but... Could you not just hold a log of what a user has queued, and when they hit the server execute everything that they have queued that would have happened up to that point? Providing that they're not interacting with others while they're offline...
-
Hey all, Me and a couple of friends are developing a browser game similar to Travian (as in, jobs are tackled in real-time not turn-based). Now, we have been trying to see what's the best way to do this real-time thing online where the user can logout and whatever is queued will still be executed once the time passes. The only way to solve this that we thought of is to: - have a table with logs as to what is queued and what event to fire when the time ends - every second have some software running on the server which will check if any logs have expired and execute their event then delete from the queue The problem with this is that we need to have some software hitting the database every second, which doesn't make much sense. What do you all think? Is there a different way of doing this which we're not seeing?!?! Thanks a lot
In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)
What I would maybe do(hence, is probably wrong :-/ ), is execute all the jobs at the same time with threads and let them battle it out. Or maybe im totally misunderstanding