Exclude fluid particles from sensor scanning and reconnector targeting#507
Draft
Exclude fluid particles from sensor scanning and reconnector targeting#507
Conversation
…nector - DensityMap: Skip fluid particles (structure objects with no connections) in fillDensityMap so they don't contribute to structure density - ReconnectorProcessor: Skip fluid particles in ReconnectorMode_Structure mode so reconnector cannot connect to them - SensorProcessor: Benefits from density map fix - rays now penetrate fluid particles and DetectStructure mode ignores them - Tests: Update existing tests to use connected structure objects, add new tests for fluid particle exclusion Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update SensorProcessor and ReconnectorProcessor to exclude fluid particles
Exclude fluid particles from sensor scanning and reconnector targeting
Mar 7, 2026
Owner
|
@copilot fix failing tests |
The energyFlow kernel at line 314 checked `object->type != ObjectType_Cell` instead of `connectedObject->type != ObjectType_Cell`. Since `object` was already verified to be a Cell at line 302, this check was always false and never skipped non-Cell connected objects. When a reconnector connected a Cell to a Structure, the kernel would access `connectedObject->typeData.cell` on the Structure object, reading garbage union data (including invalid creature pointers), causing cudaErrorIllegalAddress. Co-authored-by: chrxh <73127001+chrxh@users.noreply.github.com>
Contributor
Author
Fixed in c598df7. The root cause was a pre-existing bug in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fluid particles (structure objects with
numConnections == 0) should be invisible to sensors and reconnectors: sensors should penetrate them (no ray blocking),SensorMode_DetectStructureshould not detect them, andReconnectorMode_Structureshould not connect to them.Core changes
ObjectProcessor::fillDensityMap): Filter out fluid particles from the structure density map. This fixes both sensor ray blocking and structure detection in one place.tryCreateConnection): Skip fluid particles in structure reconnect mode.performEnergyFlow): Fix pre-existing bug whereobject->typewas checked instead ofconnectedObject->type, causingcudaErrorIllegalAddresswhen Cell-to-Structure connections existed (e.g. via reconnector). The comment said "Skip if connected object is not a Cell" but the code checked the wrong variable.Test changes
ReconnectorTestsandSensorTestsupdated to use connected structure pairs so they aren't classified as fluidstructureMode_ignoreFluidParticle,detectStructure_ignoreFluidParticles,rayNotBlockedByFluidParticlesmaxForcehigh inReconnectorTeststo prevent physics-related connection breaking during tests💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.