keeperfx icon indicating copy to clipboard operation
keeperfx copied to clipboard

Line of sight check

Open ErminioLucente opened this issue 10 months ago • 0 comments

This issue has been raised 3 times before (https://github.com/dkfans/keeperfx/pull/1874 , https://github.com/dkfans/keeperfx/issues/1871 , https://github.com/dkfans/keeperfx/issues/1272), but none have really brought up the reason why. After some extensive testing, consider this the update on the issue.

The conversation ive had is further referenced here on discord, many video references are included in the chat too, just scroll down.... https://discord.com/channels/480505152806191114/1083906845502091326/1227142265340821535

To summaries my assumptions... this has to do primarily with SIZE and THINGSIZE from the creature properties. THINGSIZE is the creature hit detection box. SIZE i believe is used for path finding, navigation and sight checks, this is their actual physical space in game. Anything above the SIZE 256 and the creature wont be able to fit through 1 tile paths. Anything lower than 200, and you get oddities like creatures not correctly aligning to fight enemies and they jsut get stuck. If you make creatures SIZE to small, then projectiles will even phase right through them if the projectile is also tiny.

Creatures that immediately see the targets SIZE will attempt to attack the center origin of the SIZE box. This has nothing to do with THING_SIZE, remember that is just collision. (i could be wrong, ive not checked the code sorry)

Solution would be to get the origin which the size was detected, and target that instead.

ErminioLucente avatar Apr 18 '24 04:04 ErminioLucente