View Issue Details

IDProjectCategoryView StatusLast Update
0004078The Dark ModCodingpublic04.02.2015 19:40
ReporterSteveL Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
Status newResolutionopen 
Product VersionTDM 2.03 
Summary0004078: Too many door handles on one door freeze the game
DescriptionThe game freezes if the player frob-highlights a door with 10+ handles.

Frob-peers like doors and their handles light one another up when they get frob-highlighted by the player. 10+ handles that can chain up in any order give billions of possible ways that the highlight signal can be propagated.

There are safeguards in the code to stop infinite loops, but (1) they're not working right, and (2) the freezes aren't caused by an *infinite* loop, just one that it'd take the cpu hours to work through.
Additional InformationFrom earlier discussion with grayman:

//
There are 12 door handles bound to the same door. When the player gets within frob distance, there's a combinatorial explosion as the door frob-highlights each handle which frob-highlights its frobmaster which frob-highlights each handle... The code has a block in place to stop a handle being frobbed-highlighted twice but that's not stopping billions of function calls in this situation even if most of them return straight away. Each handle tries every other handle in every possible ordering, and more than once... Each handle calls idEntity::SetFrobbed, which calls the door SetFrobbed again, which tries all 12 handles...

CFrobHandle::SetFrobbed uses a bool "m_FrobLock" to break infinite loops, but idEntity::SetFrobbed is involved in this too and it uses a different member "m_bFrobbed" to do the same thing. Neither checks the other's flag. And m_FrobLock isn't doing its job right. It gets unset while the chain of frob calls is still deep.

This is 2.02. It's not a problem evidently when a door has only a few handles. But a big problem for 12 handles.
//
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
04.02.2015 19:40 SteveL New Issue