Skip to content

Conversation

Prole0
Copy link
Contributor

@Prole0 Prole0 commented Oct 4, 2025

About the PR

I merged the branch wrong, so a new one has been made. I really tempted fate with the last PR's name...

This is just #40440 without the massive amount of commits or the conflicts. Hopefully...

Below is the old PR's description.

Moving ForensicSystem, ForensicScannerSystem, & ForensicPadSystem to Shared. For now, its drafted due to misprediction issues I haven't found the solution for yet.

Its predicted, just needs a code cleanup is all.

Why / Balance

For #39286. Latency is annoying, minimizing it is an absolute benefit to the players.

Technical details

Moving and dirtying mostly. Some prediction changes to Content.Client/Forensics/ForensicScannerBoundUserInterface.cs to make the button press instant. And a blanket NetworkedComponent & AutoGenerateComponentState to most components. I don't think most of them would need them, I'll cleanup & and see what's needed when most of the major mispredictions and roadblocks ironed out.

I had to predict ForensicPadSystem due to it mispredicting if left on server. Still WIP due to issues with misprediction that I haven't found the solution for. Examples of the roadblocks in media. At least the ones I've found.

I've definitely missed something for this prediction stuff. Most likely something in components because I don't know components, or something in SharedForensicsSystem. If anyone spots an issue that could get rid of the roadblocks, LMK.

Media

Roadblocks

CLEARED

Misprediction with Soap Cleaning after another person cleaned it.

Cleared

MispredictSoapCleaningWhenFinishedCleaningSolved.mp4

Misprediction when new evidence is left by another player.

Cleared

ObjectsgettingnewinfomispredictsforotherpersonResolved.mp4

Misprediction with Soap Cleaning showing previous evidence to other players using the forensic scanner

Cleared

MispredictforotherplayerwhentheycleanevidenceSolved.mp4

Requirements

Breaking changes

Moved All System & Components of Content.Server/Forensics to Content.Shared/Forensics for TLDR

ForensicsSystem merged into SharedForensicsSystem

ForensicScannerSystem moved to Shared

ForensicPadSystem moved to Shared

FingerMaskSystem moved to Shared

CleansForensicsComponent, DnaSubstanceTraceComponent, FiberComponent, ForensicPadComponent, ForensicScannerComponent, ForensicsComponent, IgnoresFingerprintsComponent, & ResidueComponent moved to Shared

Removed TransferDnaEvent in Events.cs & OnTransferDnaEvent in SharedForensicsSystem.cs.
TransferDna in SharedForensicsSystem is now used instead

Removed RandomizeDna & RandomizeFingerprint Virtual Methods in SharedForensicsSystem.cs.

Moved server-side BloodstreamSystem code to SharedBloodstreamSystem, empty in server for inheritance

Changed ForensicScannerSystem to SharedForensicScannerSystem & made it abstract

Made Client side ForensicScannerSystem for UI updates

Changelog

no cl

@PJBot PJBot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. Changes: UI Changes: Might require knowledge of UI design or code. S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. size/L Denotes a PR that changes 1000-4999 lines. labels Oct 4, 2025
}
text.AppendLine();
text.AppendLine(Loc.GetString("forensic-scanner-interface-dnas"));
foreach (var dna in msg.TouchDNAs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See the comment on the BUI message.
Just send the uid and use a TryComp here to get these.

Right here

[Serializable, NetSerializable]
public sealed class ForensicScannerBoundUserInterfaceState : BoundUserInterfaceState
{
public readonly List<string> Fingerprints = new();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No need for the BUI message anymore. The scanner already has all the needed information autonetworked from its components. So you can just update the UI in an AfterAutoHandleState subscription. Look at this PR for an example #33835

👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No BUI here so resolved, maybe.

@slarticodefast
Copy link
Member

Please don't make a new PR every time, this makes it really hard to review. If you did something wrong you can always revert that commit.

Copy link
Contributor

github-actions bot commented Oct 4, 2025

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Oct 4, 2025
@github-actions github-actions bot removed the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Oct 4, 2025
bloodSolution.AddReagent(new ReagentId(entity.Comp.BloodReagent, GetEntityBloodData(entity.Owner)), entity.Comp.BloodMaxVolume - bloodSolution.Volume);
}

// forensics is not predicted yet
Copy link
Member

Choose a reason for hiding this comment

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

Simply removing the code comment does not address the networking issue I mentioned. This needs to be moved to shared and the changed DnaData needs to be dirtied to make sure it is networked to other clients.
So you will have to look into how reagent data is networked. And please test this with multiple clients and the VV window to make sure it works as intended.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm getting this error when I move server-side bloodstream to its shared counterpart.

[FATL] unhandled: Robust.Shared.IoC.Exceptions.UnregisteredDependencyException: Content.Shared.Medical.VomitSystem requested unregistered type with its field Content.Shared.Body.Systems.SharedBloodstreamSystem: _bloodstream

I got no clue about this, no errors that I see.
Screenshot 2025-10-04 135821

The only thing that VomitSystem uses is GetEntityBloodData, which the newly moved OnComponentInit & OnDnaGenerated also use.
Screenshot 2025-10-04 135922

Screenshot 2025-10-04 135934

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed the error, had to make SharedBloodstreamSystem sealed and delete client side BloodStreamSystem. Everything server side should be on shared & DnaData dirtied too. Visuals below for comparison.

On Master

Master.mp4

With Dirty

With.Dirty.mp4

Without Dirty

Without.Dirty.mp4

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2025-10-13 215142

The error message is coming from here, idk what im missing here to get it to go away.

1) CLIENT: 0.773s [ERRO] system.blood_stream: Unable to set bloodstream DNA, solution entity could not be resolved Exception:

Prole0 added 2 commits October 5, 2025 18:39
…eted client BloodStreamSystem.cs to make SharedBloodstreamSystem.cs sealed. (No Unregistered errors)
@Prole0 Prole0 requested a review from crazybrain23 as a code owner October 7, 2025 00:27
@Prole0
Copy link
Contributor Author

Prole0 commented Oct 10, 2025

Suffer.mp4

Yall got a clue about this? It was due to my last commit, I'm guessing the info isn't getting taken?


private void OnScannerUpdate(Entity<ForensicScannerComponent> ent, ref AfterAutoHandleStateEvent args)
{
UpdateUi(ent);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not getting the info from UpdateState in Content.Client/Forensics/ForensicScannerMenu.xaml.cs, so a connection has to be linked.

Most likely Update() in Content.Client/Forensics/ForensicScannerBoundUserInterface.cs will make do. Just need examples of implementation, PR dig time.

@github-actions github-actions bot added the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Oct 12, 2025
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Oct 12, 2025
Copy link
Contributor

@0x6273 0x6273 left a comment

Choose a reason for hiding this comment

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

You're auto networking way too many fields, which will make it trivial to cheat and also wastes network bandwidth. For example:

  • Being in PVS range of a scanner tells you everything it's scanned, even if you're not able to interact with the scanner. (like it being in someone else's hand or bag)
  • Being in PVS range of something with forensics data gives you the data without having to scan it.
  • Being in PVS range of someone with gloves tells you the fiber.

You need to make it so that data is only networked when it's needed, and only to the players that should have that data.

@Prole0
Copy link
Contributor Author

Prole0 commented Oct 14, 2025

You're auto networking way too many fields, which will make it trivial to cheat and also wastes network bandwidth. For example:

  • Being in PVS range of a scanner tells you everything it's scanned, even if you're not able to interact with the scanner. (like it being in someone else's hand or bag)
  • Being in PVS range of something with forensics data gives you the data without having to scan it.
  • Being in PVS range of someone with gloves tells you the fiber.

You need to make it so that data is only networked when it's needed, and only to the players that should have that data.

Noted, do you know if ForensicScannerComponent AutoNetworks is part of this problem? The current way I'm trying to get the info for UI is through AfterAutoHandleState Subscription, which would need the comp parts to be AutoNetworked. Just WTK

@Alpha-Two Alpha-Two added P3: Standard Priority: Default priority for repository items. A: Security Area: Security department, including Detectives, HoS T: Prediction Type: Moving code to Content.Shared and making it predicted. and removed S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. labels Oct 20, 2025
@github-actions github-actions bot added the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Oct 21, 2025
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot removed the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A: Security Area: Security department, including Detectives, HoS Changes: UI Changes: Might require knowledge of UI design or code. P3: Standard Priority: Default priority for repository items. S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. size/L Denotes a PR that changes 1000-4999 lines. T: Prediction Type: Moving code to Content.Shared and making it predicted.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants