At the very last minute, the Halo Wars 1 (Xbox 360) developers changed the custom std::vector container equivalent (likely used in thousands of places in the code) to do range checking on *all* operator[]'s. This shipped.
-
-
What are the circumstances that make this approach preferable to a hard crash on invalid index use?
-
A hard crash would lock the Xbox 360 up or risk putting the multiplayer game out of sync (ruining the game for everybody). The team felt that trading off a little CPU perf. was worth decreasing the probability of this happening. It was a good engineering tradeoff.
- Još 2 druga odgovora
Novi razgovor -
-
-
Interesting why did you return the first or last element on invalid indices instead of just aborting the program?
-
We did in internal production/playtest builds. In the final build, stopping the game wasn't acceptable. It was more acceptable to have a deterministic glitch.
Kraj razgovora
Novi razgovor -
-
-
I feel like that would cause some weird bugs too.
- Još 1 odgovor
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.