One particularly tricky problem encountered during the development of Star Versus was detecting screen wrap. The solution involved discovering a neat trick that exploits the NES’s 6502 processor.
Very interesting. Here’s a somewhat similar story concerning the Apple IIgs.
I did too, but I imagine it is a small club.
Of course, many has been the complaint that “this isn’t relevant OS news” when these topics come up. Well, maybe it was just for me. Hah!
I think the Apple IIgs story is far more fascinating.
Time to pop in my Tron DVD, I think.
I like articles like this because I really do appreciate optimization as an artform. But I’m surprised that the NES was actually so underpowered that edge detection would actually be a significant problem for such a simple game?
I think it’s a bit overkill for such a simple game, but maybe another branch optimization could be to pre-calculate the lifespan of an object based on it’s X&Y velocities when it’s spawned. Then the Y&X coordinates could be added unconditionally and only one single branch would be needed per object per frame.
We could even further eliminate branches by subdividing the objects into buckets based on their remaining lifetimes, this way no branch tests would be needed for objects belonging to buckets who’s lifetimes have not yet expired. These buckets would add a bit of complexity, but per object branching could be replaced with per-bucket branching.