Line of sight issue

For questions about using Classic.

Post » Sat Dec 11, 2010 1:45 am

Hey chaps

I am having some trouble with the line of sight behaviour. I have an enemy character 'sight' the player, It works fine in most cases, unless the player is standing under something like this.



The height of the enemy, player and collisions is 32px. Does anyone know technical details of the line of sight behaviour? Does it 'detect' from hotspots, image points, center mass or 0,0? I am thinking the reason it is failing is that it is detecting from 0,0 on the enemy, and thus hitting the bottom edge of the platform above.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726

Post » Sat Dec 11, 2010 9:17 am

dont know if you tried that already but you can just use "get distance" based events instead of LoS behaviour.
as for the LoS not working - i dont know whats wrong.
just my 2 newbie cents
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Sat Dec 11, 2010 9:35 pm

[quote="Steven":34h6orlg]The height of the enemy, player and collisions is 32px. Does anyone know technical details of the line of sight behaviour?[/quote:34h6orlg]

I do know it's a bit quirky from when I attempted to use it for a roguelike top-down dungeon view. It would detect one side of a corridor that the character was in, but not the other. Quite vexing. I even tried centering the hotspots perfectly by making 31px objects instead of 32. Gave up on it eventually. That said, I think it should work fine for this.

What did you mean by 'collisions is 32px'?

Anyway, the one big variable that I noticed was the accuracy attribute of LOS. If the LineOfSight accuracy is set to 10 or below, it should work fine. I did a test of a similar setup, and it performed poorly with larger accuracy numbers, though.
B
3
S
2
G
2
Posts: 187
Reputation: 1,449

Post » Sun Dec 12, 2010 5:34 am

Irbis - I am using both distance and line of sight for this one chap :)


Silent Cacophony - I refer to my ground/solid/terrain/platform bits as collisions, I read over that a few times hoping to be clear and am so used to my blanket term didn't think about explaining better.
I am currently using 10px as the accuracy, but even at 1px it still misses that particular situation. Am thinking of a way around having to use Line of sight.
B
9
S
2
G
4
Posts: 346
Reputation: 2,726


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests