Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RadiationSource behaves strangely at low intensity #34456

Open
Alpaccalypse opened this issue Jan 15, 2025 · 2 comments
Open

RadiationSource behaves strangely at low intensity #34456

Alpaccalypse opened this issue Jan 15, 2025 · 2 comments
Labels
A: General Interactions Area: General in-game interactions that don't relate to another area. D3: Low Difficulty: Some codebase knowledge required. P3: Standard Priority: Default priority for repository items. T: Bugfix Type: Bugs and/or bugfixes

Comments

@Alpaccalypse
Copy link
Contributor

Alpaccalypse commented Jan 15, 2025

Description

If you have the RadiationSource component on an entity set to intensity: 0.1 they will never register on the geiger counter or cause any radiation poisoning. Changing slope to any value still results in no radiation. If you set intensity at 0.105, 0.11 etc, then it will behave as expected.

If you make a stack of 2 of this 0.1 intensity entity and place it in the environment or carry it, it will emit radiation, at approximately the correct values. Changing the slope value seems to cause minor variation from expected values when comparing the output of different stacks.

I have exhausted myself testing for now, but I think there is also a problem with something in the calculation mutliplying when it should be adding, or maybe some kind of compound error with the sum of the base values.

Reproduction

You can start testing it with something like this:

- type: entity
  parent: OreBase
  id: RadBase1
  suffix: rad ore test 11
  components:
  - type: Sprite
    state: uranium
  - type: Material
  - type: RadiationSource
    intensity: 0.11
    slope: 0.1

Screenshots
Intensity 0.11, slope 0.9, stack of two.
image
Intensity 0.1, slope 0.9, stack of two.
image

This might be expected, but it always seems to be off, even accounting for .01 and multiplication of values.

Additional context
I am so tired of testing this, and I might have either missed something obvious or made an obvious mistake somewhere, but I am certain that at least something is wrong here with it not registering 0.1 intensity correctly.

@github-actions github-actions bot added the S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. label Jan 15, 2025
@Alpaccalypse Alpaccalypse changed the title RadiationSource behaves stangely at low intensity RadiationSource behaves strangely at low intensity Jan 15, 2025
@Aeshus
Copy link
Contributor

Aeshus commented Jan 15, 2025

I suspect that this could be caused by RadiationMinIntensity (which defaults to 0.1).

/// <summary>
/// What is the smallest radiation dose in rads that can be received by object.
/// Extremely small values may impact performance.
/// </summary>
public static readonly CVarDef<float> RadiationMinIntensity =
CVarDef.Create("radiation.min_intensity", 0.1f, CVar.SERVERONLY);

@Aeshus Aeshus added T: Bugfix Type: Bugs and/or bugfixes P3: Standard Priority: Default priority for repository items. D3: Low Difficulty: Some codebase knowledge required. A: General Interactions Area: General in-game interactions that don't relate to another area. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Jan 15, 2025
@Aeshus
Copy link
Contributor

Aeshus commented Jan 15, 2025

I think the CCVAR's comments are misleading at that's the not the minimum that can be received, but rather the maximum that will not be accepted.

if (rads <= MinIntensity)
return null;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A: General Interactions Area: General in-game interactions that don't relate to another area. D3: Low Difficulty: Some codebase knowledge required. P3: Standard Priority: Default priority for repository items. T: Bugfix Type: Bugs and/or bugfixes
Projects
None yet
Development

No branches or pull requests

2 participants