?

Log in

No account? Create an account

Extremely Rhetorical Question

« previous entry | next entry »
Aug. 23rd, 2007 | 10:03 pm
location: Sasona
mood: aggravatedaggravated

Ah, the joys of editing others' code.

In an scheduled-event-driven game engine, which is better:

1) scheduling an event to occur once, when it's time for an object to explode, which explodes the object, or
2) scheduling an event to occur every 1/10 of a second, which checks to see if it's time for the object to explode, and then explodes it if so


*headdesk*

Link | Leave a comment |

Comments {13}

James Hogan

(no subject)

from: jhogan
date: Aug. 24th, 2007 04:16 am (UTC)
Link

2?

:-)

Reply | Thread

Triple Entendre

(no subject)

from: triple_entendre
date: Aug. 24th, 2007 05:44 am (UTC)
Link

You're lucky it isn't time for me to explode yet!

Reply | Parent | Thread

Tanjent

(no subject)

from: tanjent
date: Aug. 24th, 2007 04:27 am (UTC)
Link

unless there's some potential chance that the explosion could change its timing due to some interaction with the game world (i.e. a mine that explodes in 10 seconds or when someone touches it, whichever comes first), 2.

-tanjent

Reply | Thread

Triple Entendre

(no subject)

from: triple_entendre
date: Aug. 24th, 2007 04:33 am (UTC)
Link

I think you said that backwards?

(It's a bridge. It blows up at a certain point in the game. End of story.)

Reply | Parent | Thread

Triple Entendre

in other words

from: triple_entendre
date: Aug. 24th, 2007 04:34 am (UTC)
Link

arewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyetarewethereyet

Reply | Parent | Thread

Tanjent

(no subject)

from: tanjent
date: Aug. 24th, 2007 05:18 am (UTC)
Link

ah yes, "whichever comes first), 1."


-tanjent

Reply | Parent | Thread

Triple Entendre

(no subject)

from: triple_entendre
date: Aug. 24th, 2007 05:38 am (UTC)
Link

and in the exceptional case you mention, we can just cancel the event and schedule a new one after taking the interaction with the game world into account.

Reply | Parent | Thread

Tongue in Cheek.

(no subject)

from: katesmash
date: Aug. 24th, 2007 06:23 am (UTC)
Link

(your nerd pants are showing)

Reply | Parent | Thread

Triple Entendre

(no subject)

from: triple_entendre
date: Aug. 24th, 2007 06:36 am (UTC)
Link

I totally forgot I was wearing pants!

Reply | Parent | Thread

Sara

(no subject)

from: avice
date: Aug. 24th, 2007 09:35 am (UTC)
Link

You should check and make sure they're not due to explode on you.

Reply | Parent | Thread

(no subject)

from: anonymous
date: Aug. 24th, 2007 02:05 pm (UTC)
Link

exploding nerd pants?

Wow.

Reply | Parent | Thread

Looky Looky

(no subject)

from: yangenigma
date: Aug. 24th, 2007 02:05 pm (UTC)
Link

HA!
(Seconded!)

Reply | Parent | Thread

Ori

(no subject)

from: oriori1
date: Aug. 24th, 2007 02:00 pm (UTC)
Link

duh. the egg came first. evolutionarily speaking, it was hatched by something not quite a chicken (which probably tasted like chicken nonetheless).

Reply | Thread