#ECMModule GetECMAffectedPos non-deterministic behavior when evaluating RGPO jammers

1 messages · Page 1 of 1 (latest)

tacit ore
#

IsReturnWithinGate is only called once after the jPullOffs loop completes, using a freq value that is only ever set from the first jammer processed with the highest strength. If that jammer's falls outside the gate during the call to the IsReturnWithinGate, the entire accumulated jammer return is discarded regardless of whether any other subsequent jammers in the list would have passed the IsReturnWithinGate check. IsReturnWithinGate should be called per-jammer inside the loop, and only the jammers that pass the Gate check should be added to the accumulated weight.

This is well known within the Meta community where the strategy is to cycle RGPO jammers on and off intermittently to prevent the possible situation where the first found jammer stalls all other jammers because it isn't within the gate. By cycling the jammers it allows all jammers to be instantly refreshed instead of waiting 6 to 10 seconds for the problematic jammer to be refreshed. This does make using RGPO feel more like playing a lottery that needs to be micro managed by the co-pilot.

Due to being previously warned not to include source code from the game I've ommitted the full code in the bug report and use Pseudocode. Happy to point out the code in more detail if I have permission to post code snippets.

Problematic code:

freq,weight = 0

for each jammer in jPullOffs:
    if jammer passes freq gate and signal threshold:
        if weight == 0:  // first jammer only
            freq = jammer.freq        // freq locked to jammer[0], never updated
            pos  = actual.pos + jammer.posOffset
            vel  = actual.vel + jammer.velOffset
        weight += jammer.signal       // all jammers accumulate into jammer[0]'s return

// called once, outside the loop, with jammer[0]'s fq
if weight > 0:
    if IsReturnWithinGate(pos, vel, freq):  // if jammer[0] fails, everything is discarded
        add to lockReturnPool               // jammers [1..n] never get an independent gate check
#

Suggested fix:
Call IsReturnWithinGate per-jammer inside the loop, mirroring the chaff handling pattern above it:

for (int j = 0; j < RadarJammer.jPullOffs.Count; j++)
{
    RadarJammer.JamGatePullOff jpo = RadarJammer.jPullOffs[j];
    if (Mathf.Abs(jpo.freq - frequency) >= freqGate) continue;

    float sig = jpo.transmitter.GetSignalStrength(position, false, true);
    float dot = Mathf.Pow(
        Vector3.Dot(radarLookDir,
            (jpo.transmitter.transform.position - lr.referenceTransform.position).normalized),
        VTOLVRConstants.RADAR_RECEIVER_DOT_POWER);
    sig *= dot;
    if (sig <= num6) continue;

    ECMModule.LockReturn jamReturn = new ECMModule.LockReturn(ECMModule.LockReturn.ReturnTypes.Jammer)
    {
        pos    = lockReturn.pos + jpo.posOffset,
        vel    = lockReturn.vel + jpo.velOffset,
        weight = sig
    };

    if (this.IsReturnWithinGate(jamReturn, jpo.freq, lp, debug))
    {
        this.lockReturnPool.Add(jamReturn);
        num += jamReturn.weight;
    }
}
#

@ionic yew
This one is for you

tacit ore
#

ECMModule GetECMAffectedPos non-deterministic behavior when evaluating RGPO jammers

umbral jetty
#

How do I determine the optimal time to reset the RGPO jammer?

tacit ore
twilit spear
tacit ore
twilit spear
#

I don't have it either

#

like this: ```code```

swift lake
#

It's just Markdown if you want to look it up.