I've just completed 70% of my planned 50+ deep dives into The Sentinel, Geoff Crammond's epic #BBCMicro game

Batch #7 is now ready: 4 new articles about drawing the 3D landscape, ray-casting and quadrants

https://thesentinel.bbcelite.com/deep_dives

Batch #8 coming soon

Enjoy!

#retrocomputing #c64 #8bit

Index of all deep dive articles - The Sentinel on the BBC Micro

Index of all deep dive articles about The Sentinel

@markmoxon It’s interesting that he was still using division here when computing angles. In Stunt Car Racer he switched to subtracting 16-bit logarithms that he plugs into a fused atan(exp(x)) table.

@cobbpg Sounds fast! But presumably this approach is a bit more memory hungry?

The Sentinel on the BBC Micro doesn't have any spare room at all, so I guess it's lowest common denominator for the core maths routines, which are copied unchanged from Revs. But by Stunt Car Racer he'd dropped the 32K platforms, so logarithms ahoy! Nice. 😀

@markmoxon It’s surprisingly memory efficient: all the tables needed add up to only 1.5 kilobytes (0.5 for the log, 1 for the arctan). And it’s fast indeed: the atan2 function converts 16-bit coordinates into a 10-bit angle in around 500 cycles on average.

But sure, squeezing the game into 32K is basically impossible; I just about managed to get it into 48K for the Apple II by cutting out almost everything outside the gameplay itself.

@cobbpg Yeah, that’s what the Bitshifters found with their BBC Master conversion - they needed the extra memory in the Master vs the standard Beeb. Squeezing it into the Apple II’s 48K is amazing!

And given that 1.5K represents 6.5% of the entire Sentinel codebase, logs were out of the question! Same with Elite: the original BBC versions had algorithmic multiplication, but the C64 and co-pro versions had enough room for the log lookup tables.

Seeing how they coded for constraints is one of my favourite aspects of analysing old code. 😀

@markmoxon At least it should be possible to make it work on the VIC-20 as a cartridge-only release. I think 16K RAM would be enough to fit all the dynamic data. Maybe 20K is needed altogether to account for self-modifying code.