MegaGlest Forum

MegaGlest => Bug reports => Topic started by: ctz on 21 December 2013, 05:03:42

Title: 3.9.0: enemy units should be visible if *any* part of them is within sight range
Post by: ctz on 21 December 2013, 05:03:42
Currently, enemy units are only visible if their "center" (the cell that splash is centered on, I assume) is in sight.

This can result in situations like this image:
http://i.imgur.com/YWbxDCd.png

Tech catapults have attack range 10 and sight range 11.  They are attacking a tech castle.  The castle is invisible because it is not in sight range, but part of it is in attack range.

To fix this, the enemy unit should be visible if any cell that it occupies is in sight range.
Title: Re: 3.9.0: enemy units should be visible if *any* part of them is within sight range
Post by: Ishmaru on 22 December 2013, 18:02:53
I have had issues with this as well.
Title: Re: 3.9.0: enemy units should be visible if *any* part of them is within sight range
Post by: tomreyn on 26 December 2013, 00:11:55
And I, but until now I wasn't aware what causes them. Tech catapults are a very reliable way to reproduce this.
Title: Re: 3.9.0: enemy units should be visible if *any* part of them is within sight range
Post by: titi on 27 December 2013, 01:43:28
I will have a similar problem like this too with my new mod. Its not exactly the same, but should be taken into account.
I have a "support spider" there with a big net over it, protecting your own fighters below it. As its a size1 unit you also get trouble with it beeing rendered at border of fog of war and so on.  What I suggest is to add something like "render size" that you can set in xml. By default it should be the same as the size of the unit, but it gives more options like this. The fact if it is rendered or not should take into account this  "render size" then. ( As this only effects render its maybe even compatible with 3.9.0 ? )
(click to show/hide)

Update:
After looking at his I think the reason for the things not beeing rendered is not the calculation if the unit is in the viewable frustum or not. I think its more related to the validity of the cache handling visibility. If you don't move the camera, I think the visibility cache does not get invalid/refreshed ( especially in combination with the fog of war ).
Title: Re: 3.9.0: enemy units should be visible if *any* part of them is within sight range
Post by: Coldfusionstorm on 27 December 2013, 14:43:48
At last there are more people than just me saying this is wrong.

Hear hear.
Title: Re: 3.9.0: enemy units should be visible if *any* part of them is within sight range
Post by: will on 27 December 2013, 15:02:18
I want to make no promises of a quick fix, plus I'm on vacation right now, but I know why this is, its annoyed me to bits, and it is high on my to-fix list.
Title: Re: 3.9.0: enemy units should be visible if *any* part of them is within sight range
Post by: titi on 27 December 2013, 15:29:28
I already have a "render-size" implemented here for me. I will discuss it with softcoder and then I will checkin. works very good so far . But this is only the "fix" for my rendering problem of units with bigger model than size.