winstxnhdw / lc-hax

A powerful, feature-rich and highly performant internal cheat for the co-op indie horror video game, Lethal Company.
77 stars 25 forks source link

Enemy Possession Rework #325

Closed D1GQ closed 5 months ago

D1GQ commented 5 months ago

About

This pull integrates a lot of changes to The Possession on enemies AI, completely changed how controlling the enemy works and revamped the code, and did a few changes on The Possession code to try to fix a few issues.

Changes

Known Issues

Closes #312

winstxnhdw commented 5 months ago

Fixed issue that caused you to teleport into the void when possessing, fixed by saving the position of the enemy before possession then teleporting to that position after possession.

I don’t think this would fix the issue. As mentioned in #312, this happens because the invisible rigidbody clips into the ground and is forced out by the ground at great speeds. The fix for this would be raising the height of the rigidbody, but for taller enemies, it’ll be possible for the same thing to happen, but by the ceiling.

A more robust way to fix this would be to run an exhaustive search on every position around the initial position such that it does not collide with the terrain, ceiling or walls. Something like the maze-solving algorithm.

D1GQ commented 5 months ago

I don’t think this would fix the issue. As mentioned in #312, this happens because the invisible rigidbody clips into the ground and is forced out by the ground at great speeds. The fix for this would be raising the height of the rigidbody, but for taller enemies, it’ll be possible for the same thing to happen, but by the ceiling.

A more robust way to fix this would be to run an exhaustive search on every position around the initial position such that it does not collide with the terrain, ceiling or walls. Something like the maze-solving algorithm.

I implemented the changes you asked for, and you are right it didn't completely fix the issues it was more of a quick work around to minimize the chance, if I'm going to be straight up honest the method you explained I have no idea how to pull off lmao.

winstxnhdw commented 5 months ago

No worries, I can give it a try. It’s a computer science problem so it can be tricky without any formal education.

winstxnhdw commented 5 months ago

I tested your code. It's really smooth. Great work. I removed the gravity toggle because I don't see the point to disable gravity. Great work!