View Issue Details

IDProjectCategoryView StatusLast Update
0006207The Dark ModCodingpublic20.04.2024 14:44
ReporterDragofer Assigned To 
Status newResolutionopen 
Product VersionTDM 2.10 
Summary0006207: When peeking, lightgem matches lighting on the other side of the door
DescriptionThe peek feature lets players look through keyholes of doors into other rooms. It seems to work by moving the viewOrigin for the renderView to the other side of the door, while the player origin remains where it is.

However, the lightgem changes to match the lighting conditions on the other side of the door. If the player looks from a dark into a bright room his lightgem will become bright and vice versa. You can see this for example in A Good Neighbour, where most doors can be peeked through by leaning forward into them.

Looking into the ::Calculate method of lightgem.cpp, the lightgem entity seems to get continually placed between the player's origin and eye position. Furthermore, the output of the getEyePos script event is changed during the peek. So a possible explanation is that when peeking moves the viewOrigin, the lightgem entity is moved too.
Steps To ReproduceIn A Good Neighbour (pk4 name: good), a peekable door separating a very dark and a very bright area:
setviewpos 1776.25 -517.15 -89.75 -14.7 177.1 0.0
Tagsleaning, lighting


has duplicate 0006278 new Func_Peek lightgem glitch 




26.12.2022 11:32

developer   ~0015641

In LightGem::Calculate, I checked the values of Cam ( = getEyePosition ) and LGPos ( = origin + 1/3rd of x and y distance to eye position ) before and during the peek.

Cam is changed by the peek, and LGPos is changed to a lesser extent. The delta for the starting door in A Good Neighbour was:
Cam: 0.182 -5.489 -0.012
LGPos: 0.055 -1.647 0.000

I tried commenting out lines 157 and 158 in lightgem.cpp (rev 10220) for the translation of LGPos so that it should stay stationary on the x and y axis but it didn't seem to improve the situation.

Issue History

Date Modified Username Field Change
25.12.2022 20:46 Dragofer New Issue
25.12.2022 20:48 Dragofer Description Updated
25.12.2022 21:34 Dragofer Description Updated
26.12.2022 11:16 Dragofer Steps to Reproduce Updated
26.12.2022 11:32 Dragofer Note Added: 0015641
20.04.2024 14:44 Fiver Tag Attached: leaning
20.04.2024 14:44 Fiver Tag Attached: lighting
20.04.2024 14:44 Fiver Relationship added has duplicate 0006278