I've been designing a browser game and things will take some (Real) time to complete in-game. I've checked out Travian and that's how it works too so I've been thinking of a viable way to do this. I came up with the following solution... maybe you can give me some tips (whether its viable or not, and if there's any other way to do this). Have a windows service running all the time. Whenever the user does something which will need time to complete, it is inserted into a table with the action and the time of completion. Every second (I was thinking of having 15 second increments in event completion time so I don't need to hit the database every second) the service checks the table and accomplishes any events which are past their completion time. Additionally, on the user's end there will be an AJAX timer that updates the page whenever needed. I dunno, I'm seeing some problems with this (like for example, how can I update the user's page when the event completes if its completion is not actually being done by the page?). Cheers.
In life truth does not matter. What really matters is what others believe to be the truth. (The Up and Comer - Book)