NVlabs / FPSci

Aim Training Experiments
Other
70 stars 23 forks source link

Add `showReferenceTargetMissDecals` parameter #323

Closed bboudaoud-nv closed 3 years ago

bboudaoud-nv commented 3 years ago

This branch adds a showReferenceTargetMissDecals parameter to allow experiment designers to specify whether miss decals should be displayed when firing at the reference target. This parameter defaults to true to maintain historical behavior. To disable it, add:

showReferenceTargetMissDecals = false;

to your experiment config.

joohwankimNV commented 3 years ago

The feature is good. I am noticing a bug, though.

As I switch sessions, going from showReferenceTargetMissDecals = false to showReferenceTargetMissDecals = true seems to not work. The other way works.

jspjutNV commented 3 years ago

The feature is good. I am noticing a bug, though.

As I switch sessions, going from showReferenceTargetMissDecals = false to showReferenceTargetMissDecals = true seems to not work. The other way works.

I can confirm this bug reproduces. I'm working on a fix now.

jspjutNV commented 3 years ago

I also noticed a bug that's been in there for a while where there's a segmentation fault on switching sessions from the GUI with certain decals present. I'm not entirely sure which situations cause it because it only happens occasionally. This crash happens in the following code from Weapon.cpp on the line with m_scene->remove(m_currentMissDecals.pop());:

void Weapon::clearDecals(bool clearHitDecal) {
    while (m_currentMissDecals.size() > 0) {                // Remove and clear miss decals
        m_scene->remove(m_currentMissDecals.pop());
    }
    m_missDecalTimesRemaining.clear();                      // Clear miss decal timeouts

    if (clearHitDecal && notNull(m_hitDecal)) {             // Clear hit decal (if one is present)
        m_scene->remove(m_hitDecal);
    }
}
jspjutNV commented 3 years ago

I'm going to open an issue for the above problem (if there isn't one yet), then this PR should be ready to merge.