View Issue Details

IDProjectCategoryView StatusLast Update
0001727The Dark ModCodingpublic31.08.2015 22:40
ReporterIshtvan Assigned To 
PrioritynormalSeveritynormalReproducibilityalways
Status newResolutionopen 
Summary0001727: Stim/Response: Large responding objects can fail to respond if hit with radius-stim too far from their origin.
DescriptionThe code below means that if you stim a big entity some distance away from its origin, it won't register. This is bad since it means even a direct hit with a stimming projectile won't stim the object if it's too big and the hit is too far from the origin. For example: Large pane of glass hit by moss stim.

int idGameLocal::DoResponseAction(CStim* stim, int numEntities, idEntity* originator, const idVec3& stimOrigin)
{
// ...

// Check if the radius is really fitting. EntitiesTouchingBounds is using a rectangular volume
// greebo: Be sure to use this check only if "use bounds" is set to false
if (!stim->m_bCollisionBased && !stim->m_bUseEntBounds)
{
    // take the square radius, is faster
    float radiusSqr = stim->GetRadius();
    radiusSqr *= radiusSqr;

    if ((srEntities[i]->GetPhysics()->GetOrigin() - stimOrigin).LengthSqr() > radiusSqr)
    {
        // Too far away
        continue;
    }
}
TagsNo tags attached.

Activities

SteveL

SteveL

31.08.2015 17:20

reporter   ~0007749

I can't quite see what the problem is here. From the info above, it looks like it should only affect non-collision-based stims, and even then mappers have a way to avoid it: setting a "use bounds" flag on the stim. Is there a problem situation that I could take a look at?
VanishedOne

VanishedOne

31.08.2015 20:00

reporter   ~0007750

I once asked on NDRQ about basically this problem - http://forums.thedarkmod.com/topic/9082-newbie-darkradiant-questions/?p=364180 - and none of the responses mentioned that. I think the problem might be that the documentation on the wiki isn't very explicit about e.g. what 'bounds' are. The sr_collision_N spawnarg isn't even in the wiki articles at all (and I don't see a way to opt for a collision stim in DR); I only know about it because I chanced upon http://forums.thedarkmod.com/topic/12438-damaging-traps/?p=250734 during a search.
VanishedOne

VanishedOne

31.08.2015 20:18

reporter   ~0007751

Last edited: 31.08.2015 22:40

After noticing that atdm:liquid_water has sr_use_bounds_N set, I inferred that the entity carrying the stim would be testing which entities fell inside its shape, but I didn't infer that the physical shape of the entity carrying the response would also be involved in the test, even when a radius is set on the stim. The wiki refers to 'the bounds of the entity' in the singular.

(I think I'm responsible for bumping this; apparently monitoring a report counts as updating it. Since it's from 2009 I don't know whether the person who wrote it will be commenting.)

Issue History

Date Modified Username Field Change
29.03.2009 20:51 Ishtvan New Issue
31.08.2015 17:20 SteveL Note Added: 0007749
31.08.2015 20:00 VanishedOne Note Added: 0007750
31.08.2015 20:18 VanishedOne Note Added: 0007751
31.08.2015 22:38 VanishedOne Note Edited: 0007751
31.08.2015 22:39 VanishedOne Note Edited: 0007751
31.08.2015 22:40 VanishedOne Note Edited: 0007751