Skip to content

Update EMM-A to 0.9.47B (SDX2 lidar required) - #366

Open
lucakrowinkel123-dot wants to merge 2 commits into
StarCpt:mainfrom
lucakrowinkel123-dot:update-emma-0.9.46b
Open

lucakrowinkel123-dot wants to merge 2 commits into
StarCpt:mainfrom
lucakrowinkel123-dot:update-emma-0.9.46b

Conversation

@lucakrowinkel123-dot

@lucakrowinkel123-dot lucakrowinkel123-dot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

This updates EMM-A from the catalog's 0.9.40B to 0.9.47B, replacing the 0.9.46B revision previously proposed here. The plugin uses the existing five 0.9.46B programmable-block scripts. Plugin changes since the last review · Compatible scripts

The client plugin requires an enabled, working SDX2 targeted lidar on the carrier's own grid that the local player can access. Switching off or removing the last qualifying lidar suspends services and cancels active scanning and route planning. A vanilla ore detector, an ordinary sorter, or a lidar on a docked grid cannot qualify. Each scan uses the current WeaponCore range setting. Hardware checks

Scan scope for review. Once a qualifying lidar's range touches an asteroid's bounding box, EMM-A reads ore throughout that asteroid, including ore beyond the sphere. The reviewer's proposed per-sample distance limit is still open. The SDX2 block description identifies ship-class and faction pings. I have not verified that unmodified SDX2 exposes the same ore information at this range. The whole-asteroid ore map is produced by EMM-A. Plugin behavior

The plugin built against the installed Space Engineers assemblies. The lidar checks passed for loss of power or access, grid changes, range changes, and a 5 cm overlap or gap. The 18 scan and logging checks, 22 Runtime LCD checks, and PluginHub catalog validator also passed. Verification was offline. Lidar regression tests

@viktor-ferenczi viktor-ferenczi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version-bump review of hub head eb908832d01f3052573c96e125f780ba4f50c990, Plugins/EMM-A.xml:

  • lucakrowinkel123-dot/EMM-A: 2f2f494aa58f2d9cb4e7574b33845d2243b81348 (v0.9.40B) → f51a1b7d9eb25fa1804a7c627023906d8ba54e79 (v0.9.46B). 155 paths changed, +2851/−37484. Most of it is the removal of scripts/src and the old scripts. The hub-compiled plugin/src has 19 changed files, +405/−123 ignoring line endings (Emma3Controller.Bridge.cs was converted from CRLF to LF).

Summary: this release narrows the 50 km ore detector problem a lot, but it doesn't fix it. Asteroid selection now needs a working detector in range. Once a detector sphere touches an asteroid's bounding box, though, the plugin still reads the ore of the whole asteroid, including ore far outside that range. That is the one change I'd ask for. I found no security issues in the new code.

Findings

1. Medium: ore outside the detector's range is still revealed. CanScan admits an asteroid when the sphere of any working, accessible ore detector or SDX lidar on the carrier overlaps its WorldAABB. The scan itself is unchanged: VoxelScanner.Begin still covers StorageMin..StorageMax and reads content and material for the whole storage box, then refines every ore pocket at 2 m. The README says so too: "Even 5 cm of overlap qualifies the entire asteroid".

Vanilla doesn't work that way. MyOreDepositGroup.UpdateDeposits (SE 1.211.017) clamps its voxel query to the detection sphere's box, in 32-voxel cells, so a 150 m large-grid detector reports only ore within about 150 m. The storage box also includes empty corners. A detector that just reaches a corner of a 1–2 km box gets the ore of the whole rock, buried core included. That ore drives target selection, gets added to the Ores timer by name and is logged per asteroid. On a server, a player still learns which ores an asteroid holds, and where, far beyond what their detector shows. It's a much smaller advantage than before, but it's the same kind.

Fix: read material, or keep ore samples, only inside the detector spheres that cover the asteroid, the same way the vanilla detector limits its query. Content alone (the asteroid's shape) can stay a whole-asteroid read for obstacle and approach geometry, since any player can see that. The tradeoff: a deep pocket only becomes a target once the carrier's detector reaches it, so planning may need another pass after moving closer.

Earlier notes from #343

Note Status
50 km ore detector Partly fixed, see finding 1. Candidate selection, background surveys, cached maps, departure scans and in-flight scans now all check CanScan. Asteroids outside detector range are used only as solid obstacle boxes (BuildCandidateList).
Low: planner reply journal never pruned Fixed. Replies now go to a per-Carrier folder (planner-replies/<carrier id>/), and MaintainHistory keeps the last 16 and moves legacy flat files over in batches of 8.
Note: <Description> is only a URL Unchanged.
Note: script source not in the repository Still open. scripts/src, the old 0.8.56 copy, has been deleted, so no script source is published now.

A correction to the #343 comment: you were right about the overlay. PlanVisualizer.Draw draws AsteroidMap.Samples, which only holds surface cells (AddSurface), so it doesn't draw crosses for buried ore. Buried ore goes to OreSamples, which is what targeting uses.

Question

The lidar path treats sdx_detectorTargeted_lidar / sdx_detectorTargeted_lidarMes as an ore detector with the WeaponCore "Weapon Range" slider as its radius (the test fixture uses 24 km). Does that SDX2 block reveal ore at that range in the mod's own gameplay? If it only targets grids, this gives ore detection at lidar range on any server that runs SDX2. If it does detect ore, please say so in the README, so other server owners know what the plugin does when they install the mod.

Non-blocking notes

  • Note: the README and docs/index.html have mojibake: "block’s" (README L9) and "·" in the page title. It looks like a Windows-1252 round trip.
  • AllowSeatExitDuringMining now defaults to on, and while it is on, leaving the cockpit no longer suspends planning. Scans still stop while the player is out of the seat, because CanScan requires IsCarrierPilot, so this changes only convenience, not what the plugin can see.

Security

Every changed path in plugin/src was read in full, plus the test, descriptor and doc changes.

  • Still no network, Process, Assembly.Load, reflection-driven activation, P/Invoke, unsafe, Harmony or obfuscated code in plugin/src.
  • New file I/O stays under <UserDataPath>/Storage/EMMA3. Journal folders come from a parsed long. Journal file names are SHA-256 (hex or base64url). Retention deletes only 47-character base64url .txt files inside that Carrier's folder. The clean-reset delete targets fleet-routes-<CarrierPbId>.txt. VisualizationSnapshotStore now also reads sibling current-visualization-*.txt files of the same world, read-only.
  • Detector checks use IsWorking, HasPlayerAccess and the carrier's own grid. The ore detector "Range" terminal getter returns metres (Range * MaximumRange * 0.01, MyOreDetector in SE 1.211.017), as the code comment says.
  • The five 0.9.46B scripts are minified in-game programmable-block scripts. The hub doesn't compile them (SourceDirectories = plugin/src) and the game's script whitelist sandboxes them. Their outside communication is IGC broadcast/unicast and CustomData. I didn't decode them line by line this round.
  • The pinned tree has 87 tracked paths, with no binaries, native files, submodules or symlinks. The new tests/DetectorCoverage project references only VRage.Math from the game install and isn't compiled by the hub.

Manifest and build

  • python3 test.py Plugins at the hub head: All files validated. Only Tooltip, Description and Commit changed. The ID is unique.
  • The pin is tag v0.9.46B and is reachable from main. main (15ea9ef) is one commit ahead and changes only a link in docs/index.html. The repository's own PluginHub/EMM-A.xml pins 65e5941 (the parent, which has the same plugin/src); that's ignored, since the hub manifest decides.
  • I compiled plugin/src/**/*.cs (65 files) with .NET SDK 10.0.400 on Linux: net48, latest C#, TRACE;PULSAR, unsafe allowed, against the installed SE Bin64. 0 errors. The only compiler warnings are the two known CS0618 (BoundingBoxD.GetCorners() in GeometrySafety.cs L120 and RoutePlanner.MinerRoute.cs L248). No NuGetReferences are needed.
  • I didn't run the author's tests or test in game.

@lucakrowinkel123-dot lucakrowinkel123-dot changed the title Update EMM-A to 0.9.46B Update EMM-A to 0.9.47B (SDX2 lidar required) Nov 17, 2026

@viktor-ferenczi viktor-ferenczi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review of hub head 55ba12d98d49c8dec3df9fb8e5b6f6542cd75e8a, Plugins/EMM-A.xml. The last review covered eb908832d01f3052573c96e125f780ba4f50c990.

  • lucakrowinkel123-dot/EMM-A: the pin moved from f51a1b7d9eb25fa1804a7c627023906d8ba54e79 (v0.9.46B) to 8328b388646d314cac6905731557227480a7a575 (v0.9.47B). 8328b38 sits directly on the commits reviewed last time, so this re-review covers f51a1b7..8328b38: 13 paths, +235/−54, 9 of them in the hub-compiled plugin/src (one new file, CarrierLidar.cs).

Summary: 0.9.47B makes an SDX2 targeted lidar the only sensor that enables the plugin and qualifies asteroids for scanning. The scan itself didn't change, so the earlier finding is still open, and it got worse: a whole-asteroid ore map now comes from a ship-targeting block at its WeaponCore range instead of from an ore detector. I found no security issues in the new code.

Findings

1. High (was Medium): whole-asteroid ore at lidar range, from a block that doesn't detect ore. CanScan now delegates to CarrierLidar.Available. That method accepts only sdx_detectorTargeted_lidar / sdx_detectorTargeted_lidarMes sorters, takes the radius from the WeaponCore "Weapon Range" slider (the default -1 maps to the slider maximum) and still tests sphere-to-WorldAABB overlap. VoxelScanner.Begin is unchanged and still reads content and material for the whole StorageMin..StorageMax box. The README says so, and the PR description says the per-sample distance limit is still open.

This also answers my question from the last review. The PR description says the SDX2 block describes ship-class and faction pings, and that you haven't verified SDX2 exposes ore at that range. The README adds that the ore map comes from EMM-A's own voxel scan. In 0.9.46B a vanilla ore detector (150 m on a large grid) could still qualify an asteroid; in 0.9.47B no ore sensor is involved at all, and the qualifying range is that of a targeting lidar. Your own test fixture uses a 24,000 m maximum (Hardware.cs L36). On a server running SDX2, a player learns the ore types and positions of every asteroid whose box touches that sphere, buried cores included. That is close to the 50 km ore detector problem from #343 again. The README disclosure helps server owners understand it, but they can't turn it off: the plugin is client-side, and a server that installs SDX2 for ship pings shouldn't also be handing out ore maps.

The severity went up because what qualifies a scan is no longer tied to any ore sensing in the game.

Fix, both parts:

  • Base ore qualification on a vanilla ore detector again, or on an SDX2 function that actually reports ore, at that sensor's real range. The lidar can stay as an extra requirement if you want it.
  • Read material, or keep ore samples, only inside the qualifying sensor spheres, as asked last time. Content (shape) can stay a whole-asteroid read for obstacles and approach geometry, since any player can see that.

Earlier findings

Finding (review of eb90883) Status at 8328b38
Medium: ore outside the detector's range is still revealed Still open, now High, see finding 1.
Question: does the SDX2 lidar reveal ore at its WeaponCore range? Answered: not verified, and documented as ship pings. That answer is why finding 1 went up.
Note: mojibake in README and docs/index.html Fixed. No †/  sequences left in either file.
Note: <Description> is only a URL (from #343) Unchanged.
Note: script source not in the repository (from #343) Still open. 0.9.47B reuses the minified 0.9.46B scripts.

Security

Every changed path in f51a1b7..8328b38 was read in full.

  • plugin/src still has no network, Process, Assembly.Load, reflection-driven activation, P/Invoke, unsafe, Harmony or obfuscated code. CarrierLidar only reads block state (Enabled, IsWorking, HasPlayerAccess, grid ID) and the Weapon Range terminal property.
  • No new file I/O. The only new write is to the carrier's own Plugin Bridge timer CustomData (surveyPulse, pluginLcdReady, a status message) while no lidar works (WaitForCarrierLidar). The plugin already used that channel.
  • The lidar list is rebuilt from the carrier grid on every refresh. Scans, departure preparation and planning are cancelled when the last lidar stops working, and out-of-seat services can't start a scan (occupiedGrid == 0 with an asteroid returns false). I found no lifecycle bug in the new gating.
  • No binaries, native files, submodules or symlinks were added. tests/DetectorCoverage gained a stub file and isn't compiled by the hub.

Manifest and build

  • python3 test.py Plugins at the hub head: All files validated. Only Tooltip and Commit changed since the last review. The ID is unique.
  • The pin is tag v0.9.47B and is reachable from main. main (4c08c0a) is one commit ahead and only updates the repository's own PluginHub/EMM-A.xml, which the hub ignores.
  • I compiled plugin/src/**/*.cs (66 files) with .NET SDK 10.0.400 on Linux: net48, latest C#, TRACE;PULSAR, unsafe allowed, against the installed SE Bin64. 0 errors. The only compiler warnings are the same two CS0618 as before (GeometrySafety.cs L120, RoutePlanner.MinerRoute.cs L248). No NuGetReferences are needed.
  • I didn't run the author's tests or test in game.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants