|
| 1 | +# Ingress Drone Explorer - Node.js |
| 2 | + |
| 3 | +[![Lines of code][nodejs-loc]][nodejs-repo] |
| 4 | + |
| 5 | +An offline CLI tool to analyze reachable Portals for Ingress Drone Mark I. |
| 6 | + |
| 7 | +Implementations in different languages are listed and compared in [Benchmark](#benchmark). |
| 8 | + |
| 9 | +## Build from Source |
| 10 | + |
| 11 | +### Requirements |
| 12 | + |
| 13 | +- Node 18 (Backporting should be possible and easy) |
| 14 | + |
| 15 | +### Build |
| 16 | + |
| 17 | +```sh |
| 18 | +$ npm init |
| 19 | +$ npm run build |
| 20 | +$ npm run package # Package an executable with pkg |
| 21 | +``` |
| 22 | + |
| 23 | +Please notice the [`pkg`](https://github.com/vercel/pkg) will download necessary binary files to `~/.pkg-cache`, it may be overriden by environment variable `PKG_CACHE_PATH`: |
| 24 | + |
| 25 | +```sh |
| 26 | +$ export PKG_CACHE_PATH=./.pkg-cache |
| 27 | +$ npm run package |
| 28 | +``` |
| 29 | + |
| 30 | +## Exploration Guide |
| 31 | + |
| 32 | +### Prepare Files |
| 33 | + |
| 34 | +All the files should be JSON. |
| 35 | + |
| 36 | +1. Portal list file(s), should be an array of: |
| 37 | + ```jsonc |
| 38 | + { |
| 39 | + "guid": "GUID of Portal", |
| 40 | + "title": "Title of Portal", |
| 41 | + "lngLat": { |
| 42 | + "lng": 90.0, // Longitude |
| 43 | + "lat": 45.0 // Latitude |
| 44 | + } |
| 45 | + } |
| 46 | + ``` |
| 47 | +2. Portal Key list file, should be an array of GUID (Not required but strongly recommended) |
| 48 | + |
| 49 | +Maybe an IITC plugin like [this](https://github.com/lucka-me/toolkit/tree/master/Ingress/Portal-List-Exporter) helps. |
| 50 | + |
| 51 | +### Usage |
| 52 | + |
| 53 | +``` |
| 54 | +$ ingress-drone-explorer <portal-list-file> -s <longitude,latitude> [options...] |
| 55 | +``` |
| 56 | + |
| 57 | +#### Options |
| 58 | + |
| 59 | +Explore with key list: |
| 60 | +```sh |
| 61 | +$ ... -k <path-to-key-list-file> |
| 62 | +``` |
| 63 | + |
| 64 | +Output cells JSON for IITC Draw tools: |
| 65 | +```sh |
| 66 | +$ ... --output-drawn-items <path-to-output> |
| 67 | +``` |
| 68 | + |
| 69 | +Help information: |
| 70 | +```sh |
| 71 | +$ ingress-drone-explorer -h |
| 72 | +``` |
| 73 | + |
| 74 | +## Benchmark |
| 75 | + |
| 76 | +### Sample Data |
| 77 | + |
| 78 | +- Area: Shenzhen downtown and Hong Kong |
| 79 | +- Portals: 34,041 Portals in 13,451 cells |
| 80 | +- Keys: 11 matched |
| 81 | +- Start Point: Shenzhen Bay Sports Center |
| 82 | +- Result: 30,462 Portals and 11,342 cells are reachable |
| 83 | + |
| 84 | +### Result |
| 85 | + |
| 86 | +Average exploration time consumed of 100 executions on MacBook Air (M2). |
| 87 | + |
| 88 | +| Implementation | Lines of Code | Commit | Consumed |
| 89 | +| ---------------------: | :-------------: | :---------------------------------: | :--- |
| 90 | +| [Node.js][nodejs-repo] | ![][nodejs-loc] | `Current` | 1.295 s |
| 91 | +| [C++][cpp-repo] | ![][cpp-loc] | [`db5a976`][cpp-benchmark-commit] | 0.583 s |
| 92 | +| [Swift][swift-repo] | ![][swift-loc] | [`68ae1b4`][swift-benchmark-commit] | 3.000 s |
| 93 | + |
| 94 | +The results of other implementations may be outdated, please check their repositories for latest results. |
| 95 | + |
| 96 | +[nodejs-repo]: https://github.com/lucka-me/ingress-drone-explorer-nodejs |
| 97 | +[nodejs-loc]: https://img.shields.io/tokei/lines/github/lucka-me/ingress-drone-explorer-nodejs |
| 98 | + |
| 99 | +[cpp-repo]: https://github.com/lucka-me/ingress-drone-explorer-cpp |
| 100 | +[cpp-loc]: https://img.shields.io/tokei/lines/github/lucka-me/ingress-drone-explorer-cpp |
| 101 | +[cpp-benchmark-commit]: https://github.com/lucka-me/ingress-drone-explorer-cpp/commit/db5a976 |
| 102 | + |
| 103 | +[swift-repo]: https://github.com/lucka-me/ingress-drone-explorer-swift |
| 104 | +[swift-loc]: https://img.shields.io/tokei/lines/github/lucka-me/ingress-drone-explorer-swift |
| 105 | +[swift-benchmark-commit]: https://github.com/lucka-me/ingress-drone-explorer-swift/commit/68ae1b4 |
0 commit comments