hur.st's bl.aagh

BSD, Ruby, Rust, Rambling

Elite Shield Tester

Find the best-possible Elite Dangerous Shields

[rust] [javascript] [elite] [gaming]

In the popular space simulation game, [Elite Dangerous], one of the challenges is determining how best to outfit your ship ā€” if you're going into combat, choosing the right shield, with the right boosters and the right engineering can be the difference between life or death.

So why not sap the fun out of it by using a computer to work out the best configuration for us?

Fundamentally, this is a problem of combinatorics ā€” there are a set of X shield configurations, and YƗZ shield booster configurations, which combine to produce a shield with a given base strength and different resistances to different types of damage.

In the original PowerShell script by Down To Earth Astronomy, this is handled naively, simply by testing every possible combination. Because it's written in PowerShell, it's also extremely slow, despite being scalable to multiple threads.

My version uses an algorithm from my good friend Jamie "Entity" van den Berge, using a k-d tree to map every pairwise combination of boosters into an n-dimensional space (in this case, 4 ā€” corresponding to the four damage types in Elite), and eliminating any combination which can never beat another on any dimension.