Ace3: Medical Rewrite - Bloodbag status synching

Created on 22 Apr 2017  路  14Comments  路  Source: acemod/ACE3

Bloodbag status does not need to be synched with constant flow, instead save start time on unit (with CBA_missionTime).

kinFocus Feature statuby design statuwontdo

All 14 comments

Right now we do _bloodBags pushBack [_volumeAdded, _type, _partIndex];
and decrement _volumeAdded each tick
and remove when less than zero.

switch to something like [_volumeAdded, _timeAdded, _type, _partIndex]
no need to modify array each tick (less syncing)
Remove when _volumeAdded - FLOW_RATE * (CBA_missionTime - _timeAdded) is less than zero

Similar issues exist with heartRateAdjustments and peripheralResistanceAdjustments

Down side of that is having to do more calculations whenever you need one of those values.

Well if we calculate time then just write what time to end and just check the times when we should remove it. Or use CBA_fnc_waitAndExecute with the time we should remove it (not sure how intensive that is)
[_volumeAdded, _timeAdded, _timeRemove, _type, _partIndex]with the calculation. If it is linear and dont need to recaculate it at all we just need time to remove. if we want to be on the safe side we have both added and removed times so we can calculate if we need to. Or?

I'd also vote for CBA_fnc_waitAndExecute. Not really needed to store the _timeRemove then. And it's cost doesn't increase with more scripts waiting to be executed. Because only the one next script to run is checked and none after that.

Havent coded Arma in a while but how about: CBA_fnc_waitUntilAndExecute and wait for zero on the time or is that more timeintensive?

@Phyma waitUntil checks every frame.

@dedmen Roger thanks. I suspected that. That's why I hesitated but want to check every possible way. Might get back to coding soon.

I think my waitAndExecute idea is fine.
Anyone have any reason against it?

@dedmen Looking at the relevant code, how are you proposing the waitAndExecute is used? We're adding blood in over time rather than waiting for the bag to deplete and then adding it all at once. I'm not against the idea, just don't immediately see how it'd work.

Edit: Ah I think I see, you add the blood bag calculate how long it would take to deplete and then remove it after that time. Meanwhile the vitals loops just calculates how much blood is added each tick based on the number of bloodbags and their flow rates.

There's one thing that throws a spanner into the works of this entire issue: The IV process is not (necesarily) steady state because tourniquets limit bloodflow if applied.

@SilentSpike That's exactly what the PR was about. We don't add blood over time anymore. See https://github.com/acemod/ACE3/issues/5098#issue-223579186

Ah yeah. Your edit. Yes correct.

There's one thing that throws a spanner into the works of this entire issue: The IV process is not (necesarily) steady state because tourniquets limit bloodflow if applied.

hmpf... Yeah that's a problem
as @Phyma said

If it is linear and dont need to recaculate it at all we just need time to remove.

If it's not linear then this whole concept might not work at all.

In my opinion we need to add blood over time anyway because otherwise a unit could bleedout even though there are potentially multiple unfinished bloodbags currently attached to them (plus you want the medical to be seeing feedback due to increased bloodflow in the patient).

As for the issue of syncing the value 馃I don't see a way around it since blood transfer rate isn't guaranteed to be steady state due to tourniquets (and really we should be influencing it with peripheral resistance too).

We should add volume over time. It impacts so many things, such as hr, bp, visual effects.

I read synced as in network synced, which is something we could consider, I guess

As for the issue of syncing the value :thinking:I don't see a way around it since blood transfer rate isn't guaranteed to be steady state due to tourniquets (and really we should be influencing it with peripheral resistance too).

Close then?

Was this page helpful?
0 / 5 - 0 ratings