Hacker News new | ask | show | jobs
by jlokier 2093 days ago
The Elite code was great for learning techniques from!

I recommend everyone should read some well optimised code occasionally, and figure out how it works, to see how it's done.

I didn't know much in the way of assembler techniques before reading the Elite code. For example I didn't even know how to do things like multiply or square root, or draw lines efficiently. That's where I learned those things.

It did take quite a lot of studying the printout to get it. So many "aha! that's how they do it" moments.

1 comments

I assume they had a scaled up integer sin and tan tables and used matrices for scale, rotation and projection?

I do remember seeing this in 68K.

There are tables for sin, cos and arctan, but these are only used for drawing the planet’s circles. All the ship-drawing and universe manipulation is done using the small angle approximation, so there’s no need for lookup tables.

Lots more info here:

https://www.bbcelite.com/explore/articles/deep_dive_pitching...