View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004078 | The Dark Mod | Coding | public | 04.02.2015 19:40 | 04.02.2015 19:40 |
Reporter | SteveL | Assigned To | |||
Priority | normal | Severity | crash | Reproducibility | always |
Status | new | Resolution | open | ||
Product Version | TDM 2.03 | ||||
Summary | 0004078: Too many door handles on one door freeze the game | ||||
Description | The 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 Information | From 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. // | ||||
Tags | No tags attached. | ||||
Date Modified | Username | Field | Change |
---|---|---|---|
04.02.2015 19:40 | SteveL | New Issue |