Elite: Dangerous Long Range Router
Go to file
Daniel S. 972e2c2900 2022-06-15 2022-06-15 09:55:44 +02:00
.chglog chore: more cleanup 2019-09-20 17:44:33 +02:00
.github/workflow 2022-06-15 2022-06-15 09:55:44 +02:00
.ipynb_checkpoints 2022-02-23 2022-02-23 22:45:59 +01:00
.qt_for_python/uic 2022-02-23 2022-02-23 22:45:59 +01:00
celery_test 2022-02-23 2022-02-23 22:45:59 +01:00
docs_mdbook 2022-02-23 2022-02-23 22:45:59 +01:00
ed_lrr_gui 2022-02-23 2022-02-23 22:45:59 +01:00
icon 2022-02-23 2022-02-23 22:45:59 +01:00
imgui_test 2022-02-23 2022-02-23 22:45:59 +01:00
installer Big update, AppVeyor_Test 2020-03-28 14:53:52 +01:00
logs 2022-02-23 2022-02-23 22:45:59 +01:00
rust 2022-06-15 2022-06-15 09:55:44 +02:00
tests 2022-02-23 2022-02-23 22:45:59 +01:00
.env Big update, AppVeyor_Test 2020-03-28 14:53:52 +01:00
.gitignore 2022-06-15 2022-06-15 09:55:44 +02:00
CHANGELOG.md Big update, AppVeyor_Test 2020-03-28 14:53:52 +01:00
LICENSE chore: Setup tox+appveyor, refomat python code, prepare rust code to add branch pruning to search 2019-09-20 17:40:56 +02:00
MANIFEST.in 2022-06-14 2022-06-14 23:00:50 +02:00
README.md 2022-02-23 2022-02-23 22:45:59 +01:00
TODO.md 2022-02-23 2022-02-23 22:45:59 +01:00
appveyor.yml Update appveyor.yml and noxfile.py 2020-03-28 15:43:36 +01:00
beam_stack_impl.py 2022-02-23 2022-02-23 22:45:59 +01:00
benchmark_sweep.py 2022-02-23 2022-02-23 22:45:59 +01:00
build_ui.py 2022-02-23 2022-02-23 22:45:59 +01:00
ed_lrr_gui.code-workspace 2022-02-23 2022-02-23 22:45:59 +01:00
fsd_eq.py 2022-02-23 2022-02-23 22:45:59 +01:00
heuristic_vis.ipynb 2022-02-23 2022-02-23 22:45:59 +01:00
noxfile.py 2022-02-23 2022-02-23 22:45:59 +01:00
process_route_log.rs 2022-02-23 2022-02-23 22:45:59 +01:00
pyproject.toml 2022-06-14 2022-06-14 23:00:50 +02:00
render_heatmap_datashader.py 2022-02-23 2022-02-23 22:45:59 +01:00
render_heatmap_img_vaex.py 2022-02-23 2022-02-23 22:45:59 +01:00
render_heatmap_vid_vaex.py 2022-02-23 2022-02-23 22:45:59 +01:00
route_log_max.txt 2022-02-23 2022-02-23 22:45:59 +01:00
route_log_min.txt 2022-02-23 2022-02-23 22:45:59 +01:00
setup.cfg PyO3 Error temp commit 2020-06-16 15:38:31 +02:00
setup.py 2022-06-14 2022-06-14 23:00:50 +02:00
test_route.py 2022-02-23 2022-02-23 22:45:59 +01:00

README.md

Elite: Dangerous Long-range router

Features

  • Five different routing algorithms:
    • Breadth-first search:, always finds the shortest route but is quite slow
    • Bidirectional BFS:: should give similar route quality to BFS but take less time (not yet implemented)
    • A-Star: has an adjustable tradeoff between speed and quality
    • Greedy search: always picks the next reachable star that's closest to the destination, very fast but very poor quality routes
    • Economic: computes route with lowest possible fuel consumption (WIP)
  • Nice GUI! (made with PyQt5)
  • Two themes! (Dark and Light)
  • Uses data from EDSM for star data
  • Only routes through scoopable systems, no more running out of fuel! (assuming you have a fuel scoop)
  • Take fuel consumption into account and add refueling stops along the route (Not yet implemented)
  • Precomputing of BFS routing graphs for:
    • near-instant routing from your home system to any destination!
    • near-instant routing any source back to your-home system (WIP)!
    • near-instant routing between any pair of systems (Not yet implemented, see TODO)
  • Routing code written in Rust, so it's quite speedy!
  • Export routes as HTML, JSON, CSV and SVG (WIP)
  • Automagically copy next jump destination into system clipboard (works by monitoring the player journal file) (Not yet implemented)
  • (optional) Web interface with job queue for route computations and multi-user support

Installation

Prerequisites

  • Python:
  • Inno Setup Compiler
    • Download from here
    • or install via scoop scoop install inno-setup)
  • Visual Studio 2019
  • nightly rust compiler (x86_64-pc-windows-msvc)

Building an installer

(Assuming conda is in your PATH)

  1. Run nox -k build
  2. Grab the installer from installer/Output/

Manual installation

(Assuming conda is in your PATH)

  1. Start a Visual Studio 2019 x64 command prompt
  2. Run the following commands:
conda install pycrypto ujson
pip install setuptools_rust
pip install .[all]

then you can run ed_lrr -h from your command prompt to get help

Notes on FSD Fuel consumption and jump range

FSD Fuel consumption (E:D Wiki): $$Fuel = 0.001 \cdot l \cdot \left(\frac{dist \cdot \left(m_{fuel} + m_{ship}\right)}{boost \cdot m_{opt}}\right)^{p}

Solving for dist gives the jump range (in Ly) for a given amount of fuel (in tons) as: $dist = \frac{boost \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}{m_{fuel} + m_{ship}}$

Assuming f_{max} tons of available fuel gives us the maximum jump range for a single jump as: $dist_{max} = \frac{boost \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot f_{max}}{l}\right)^{\frac{1}{p}}}{f_{max} + m_{ship}}$

Since the guardian FSD booster increases the maximum jump range by B_g Ly we can calculate a correction factor for the fuel consumption as: $0.001 \cdot l \cdot \left(\frac{boost^{2} \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}{B_{g} \cdot \left(m_{fuel} + m_{ship}\right) + boost^{2} \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}\right)^{p}$

Incorporating e_{fuel} into the distance equation yields $dist = \frac{boost \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot e_{fuel} \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}{m_{fuel} + m_{ship}}$

Expanding e_{fuel} yields $dist = \frac{boost \cdot m_{opt} \cdot \left(1.0 \cdot \left(\frac{boost^{2} \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}{B_{g} \cdot \left(m_{fuel} + m_{ship}\right) + boost^{2} \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}\right)^{p} \cdot \min\left(f_{max}, m_{fuel}\right)\right)^{\frac{1}{p}}}{m_{fuel} + m_{ship}}$

Finally, Expanding dist_{max} yields the full equation as $dist = \frac{boost \cdot m_{opt} \cdot \left(\frac{1000000.0 \cdot \left(\frac{boost^{2} \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}{B_{g} \cdot \left(m_{fuel} + m_{ship}\right) + boost^{2} \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}\right)^{- p} \cdot \min\left(f_{max}, m_{fuel}\right)}{l^{2}}\right)^{\frac{1}{p}}}{m_{fuel} + m_{ship}}$

Where:

  • Fuel is the fuel needed to jump (in tons)
  • l is the linear constant of your FSD (depends on the rating)
  • p is the power constant of your FSD (depends on the class)
  • m_{ship} is the mass of your ship (including cargo)
  • m_{fuel} is the amount of fuel in tons currently stored in your tanks
  • m_{opt} is the optimized mass of your FSD (in tons)
  • f_{max} is the maximum amount of fuel your FSD can use per jump
  • boost is the "boost factor" of your FSD (1.0 when jumping normally, 1.5 when supercharged by a white dwarf, 4.0 for a neutron star, etc)
  • dist is the distance you can jump with a given fuel amount
  • dist_{max} is the maximum distance you can jump (when m_{fuel}=f_{max})
  • B_{g} is the amount of Ly added by your Guardian FSD Booster
  • e_{fuel} is the efficiency increase added by the Guardian FSD Booster

Fuel multiplier (CMDR jonburnage)

F_f = f_{max} \cdot \left(\frac{B_{g} \cdot m_{ship}}{m_{opt}} + l \cdot \left(\frac{f_{max}}{l}\right)^{\frac{1}{p}}\right)^{- p}

Fuel multiplier (Spansh)

F_f = 0.001 \cdot l \cdot \left(\frac{boost^{2} \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}{\left(B_{g} + \frac{boost^{2} \cdot m_
{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}{m_{fuel} + m_{ship}}\right) \cdot \left(m_{fuel} + m_{ship}\right)}\right)^{p}$$

$$ F_f = 0.001 \cdot l \cdot \left(\frac{boost^{2} \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}{B_{g} \cdot \left(m_{fuel} + m_{ship}\right) + boost^{2} \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}\right)^{p}$$

$$dist = \frac{boost \cdot m_{opt} \cdot \left(1.0 \cdot \left(\frac{boost^{2} \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}{B_{g} \cdot \left(m_{fuel} + m_{ship}\right) + boost^{2} \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}\right)^{p} \cdot \min\left(f_{max}, m_{fuel}\right)\right)^{\frac{1}{p}}}{m_{fuel} + m_{ship}}$$

# Misc Stuff

---

$$dist = \frac{- B_{g} \cdot m_{fuel} - B_{g} \cdot m_{ship} + boost \cdot m_{opt} \cdot \left(\frac{1000.0 \cdot e_{fuel} \cdot \min\left(f_{max}, m_{fuel}\right)}{l}\right)^{\frac{1}{p}}}{m_{fuel} + m_{ship}}$$

$$e_{fuel} = \frac{l \cdot \left(\frac{10.0^{- \frac{3.0}{p}} \cdot \left(B_{g} + dist\right) \cdot \left(m_{fuel} + m_{ship}\right)}{boost \cdot m_{opt}}\right)^{p}}{\min\left(f_{max}, m_{fuel}\right)}$$