Monday, May 3, 2010

Explode time

One issue I've been dealing with is driving actions in the game,specifically bombs blowing up. I was originally going to use a cron job, but the lowest time resolution it has it 1 minute. This obviously isn't fast enough. I started to look at using Tasks as a timer - do the task, which presses bombs and then starts a new task in 3 seconds or some such. Did work, but then it still had lag - and each task was taking too long if a bunch of bombs go off at one.

So instead I am using tasks to do each bomb - when a player places a bomb a task is created to run at the explode time. When it hits, if the bomb still hasn't gone off it will just process that bomb. Works great!

No comments:

Post a Comment