-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Predict Forensics V2.0 #40693
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
base: master
Are you sure you want to change the base?
Predict Forensics V2.0 #40693
Conversation
…sSystem (Also made it abstract) V2
} | ||
text.AppendLine(); | ||
text.AppendLine(Loc.GetString("forensic-scanner-interface-dnas")); | ||
foreach (var dna in msg.TouchDNAs) |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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
👍
There was a problem hiding this comment.
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.
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. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
bloodSolution.AddReagent(new ReagentId(entity.Comp.BloodReagent, GetEntityBloodData(entity.Owner)), entity.Comp.BloodMaxVolume - bloodSolution.Volume); | ||
} | ||
|
||
// forensics is not predicted yet |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
The only thing that VomitSystem
uses is GetEntityBloodData
, which the newly moved OnComponentInit
& OnDnaGenerated
also use.

There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…eted client BloodStreamSystem.cs to make SharedBloodstreamSystem.cs sealed. (No Unregistered errors)
… but it doesnt crash)
Suffer.mp4Yall 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); |
There was a problem hiding this comment.
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.
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
There was a problem hiding this 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.
Noted, do you know if |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
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 blanketNetworkedComponent
&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
RoadblocksCLEARED
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 scannerCleared
MispredictforotherplayerwhentheycleanevidenceSolved.mp4
Requirements
Breaking changes
Moved All System & Components of
Content.Server/Forensics
toContent.Shared/Forensics
for TLDRForensicsSystem
merged intoSharedForensicsSystem
ForensicScannerSystem
moved to SharedForensicPadSystem
moved to SharedFingerMaskSystem
moved to SharedCleansForensicsComponent
,DnaSubstanceTraceComponent
,FiberComponent
,ForensicPadComponent
,ForensicScannerComponent
,ForensicsComponent
,IgnoresFingerprintsComponent
, &ResidueComponent
moved to SharedRemoved
TransferDnaEvent
inEvents.cs
&OnTransferDnaEvent
inSharedForensicsSystem.cs.
TransferDna
inSharedForensicsSystem
is now used insteadRemoved
RandomizeDna
&RandomizeFingerprint
Virtual Methods inSharedForensicsSystem.cs
.Moved server-side
BloodstreamSystem
code toSharedBloodstreamSystem
, empty in server for inheritanceChanged
ForensicScannerSystem
toSharedForensicScannerSystem
& made it abstractMade Client side
ForensicScannerSystem
for UI updatesChangelog
no cl