TombEngine
TombEngine copied to clipboard
Land/Water conditional sounds not playing (Wolf, Dog and Husky)
The conditional step sounds for Wolf/ Dog / Husky) are not playing in TEN but are being triggered in Wadtool.
https://user-images.githubusercontent.com/84292688/147072311-217fe5ad-f83e-46cb-b8d5-b63b3d858b56.mp4
https://user-images.githubusercontent.com/84292688/147072886-b243af55-102f-4b23-b173-8ab82078a527.mp4

From @Lwmte on Discord: "I found the reason the problem is code doesn't switch object room number to the room below, it's original code and same should happen in tomb4.
They forced the room number switch only if the object submerges 512 units into a new room. Now the question, why they did that? The most correct answer is - they were fighting bugs so, if I make objects switch room below the same way as Lara (on feet level), you can expect the engine to explode, or I can just lower tolerance.
It is original engine issue. They did it to prevent enemies from getting ambient light from bottom room even if they are not fully in that room. I don't see a solution to this problem for now.
Yeah, I can confirm Lwmte's message. The wolf is not triggering the water sounds because although it's in the 1 click water, the code detects it's in the upper room. I could see the On dry and Always sounds yes work, only issue is with the On water ones.
I'm afraid the solution will have to wait for:
-
Pathfinding fix Right now (Nov 2023) pathfinding is incomplete, enemies don't know very well how to avoid water rooms. So Lwmte applied a hack to force enemies death if these enter in a water room (clearly by any mistake in their behaviour). So if we fix this issue of wolves (and low creatures) can enter in properly water rooms, they may die for that hack.
-
Water color fix Another issue we've got with the item object shader, is that it can only paint the ambient color from 1 room, so if we put enemies in the water room, they will get the water color in all the body. (In case of low enemies, we are saying they will get the water color in all its meshes). So fixing the shader should also be a preferential step before go on with this issue.
At the end I made a room number recalculation in the sounds function to fix this issue.
May have been more ideal to have an item.RoomNumber that really works to get the room where the enemy is standing, however change that, could provoke many more issues in unexpected places (including the interaction of creatures with floordata and bridges).
So I did here what I learnt from the water color fix, and I used a local variable to store the real room where the item is, in this way wolves that are in water now detects the water room correctly so they play the water sounds.
Also I removed the camera conditions (so now is not required the camera were in water room to can listen the water sounds, nor it to be out of water to can listen the land sounds. If this feature is not a but and is really demanded, notify to implement that in addition to the current condition (not instead of the current conditions as originally was).
The fix has been pushed to the branch: https://github.com/MontyTRC89/TombEngine/pull/1256
Is in testing and review process, once it get merged if everything goes well I'll close this issue.