View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0006703 | The Dark Mod | Coding | public | 20.04.2026 15:00 | 09.05.2026 17:56 |
| Reporter | stgatilov | Assigned To | stgatilov | ||
| Priority | normal | Severity | normal | Reproducibility | have not tried |
| Status | resolved | Resolution | fixed | ||
| Product Version | TDM 2.14 | ||||
| Target Version | TDM 2.15 | Fixed in Version | TDM 2.15 | ||
| Summary | 0006703: Sharp movements in AI animation transitions on high FPS | ||||
| Description | When guards go on patrol and turn on path_corner, they often do quick and weird movement on high FPS. It does not happen on FPS < 60 though. | ||||
| Steps To Reproduce | Execute "map turn" on SVN assets. | ||||
| Additional Information | Originally reported here: https://forums.thedarkmod.com/index.php?/topic/23142-npcs-swaying-from-side-to-side-while-turning-procedural-animation/#comment-507684 | ||||
| Tags | No tags attached. | ||||
|
Most likely caused by waits of 16 ms instead of one frame in animation script code. During 0004772, nbohr1more replaced all waitFrame with wait(16 ms) in r15198, r15199 I guess now it's time to go through these waits one by one and replace most of them back to waitFrame. |
|
|
Also note that in svn rev 11287 I changed behavior of waitFrame, so that it always waits for 1 frame. For some reason previously it waited 16 ms for normal threads, but "until next call" for the so-called "manual-control" frames, which include Actor/AI threads. |
|
|
Note: I have reverted svn revs 15198-15199 in revs 17547-17548. Reviewed all the changed, did not find anything bad related to bow. Moreover, I can't see any difference in bow shooting between 500 FPS and the old "capped FPS" mode. Found some bad code in tdm_util.script (fadeOutEnt, interpolateShaderParm and similar). Fixed in svn rev 17550. Unfortunately, the sharp movement on turn is still there. There are some extra waits in Legs_Idle and Torso_Turn, maybe will try to play around with them later. Also, here is an interesting observation: animation logically runs at 24 frames per second in the engine. So if someone sets e.g. "6 blend frames" between animations, it is actually 1/4 seconds =) |
|
|
Wow, I think this issue is caused by the same error as in 0006701: trying to estimate velocity based on frame numbers and frame deltas: // Position last time this task was executed, used for path prediction idVec3 _lastPosition; // Frame this task was last executed int _lastFrameNum; // Whether to anticipate the AI reaching path corners bool _usePathPrediction; |
|
|
Fixed in svn rev 11325. In fact, these stutters have a history: 0001450. The stutters were fixed before the first TDM release =) with a rather weird "predition" hack I referenced just above. The true cause of the issue is the optimization of AI mind's subsystems. As far as I see, the optimization is completely useless (at least today), so I have have simply disabled it along with the prediction hack. You can enable it back by setting "tdm_ai_opt_interleave_subsystems 1". |
|
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 20.04.2026 15:00 | stgatilov | New Issue | |
| 20.04.2026 15:00 | stgatilov | Status | new => assigned |
| 20.04.2026 15:00 | stgatilov | Assigned To | => stgatilov |
| 20.04.2026 15:01 | stgatilov | Note Added: 0017266 | |
| 20.04.2026 15:02 | stgatilov | Note Added: 0017267 | |
| 09.05.2026 11:01 | stgatilov | Note Added: 0017310 | |
| 09.05.2026 12:06 | stgatilov | Note Edited: 0017310 | |
| 09.05.2026 14:10 | stgatilov | Relationship added | related to 0006701 |
| 09.05.2026 14:11 | stgatilov | Note Added: 0017311 | |
| 09.05.2026 14:11 | stgatilov | Note Edited: 0017311 | |
| 09.05.2026 14:18 | stgatilov | Relationship added | related to 0001450 |
| 09.05.2026 17:54 | stgatilov | Note Added: 0017312 | |
| 09.05.2026 17:56 | stgatilov | Status | assigned => resolved |
| 09.05.2026 17:56 | stgatilov | Resolution | open => fixed |
| 09.05.2026 17:56 | stgatilov | Fixed in Version | => TDM 2.15 |