Author Topic: 3.9.0: enemy units should be visible if *any* part of them is within sight range  (Read 1149 times)

ctz

  • Summoner
  • **
  • Posts: 46
  • aka cathaur, formerly lyra
    • View Profile
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.

Ishmaru

  • Behemoth
  • *******
  • Posts: 1,071
  • um wat??
    • View Profile
    • DelphaDesign
I have had issues with this as well.
Annex: Conquer the World Release 4 For Pc Mac + Linux
https://forum.megaglest.org/index.php?topic=9570.0
Annex is now on Facebook!
https://www.facebook.com/AnnexConquer

tomreyn

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 2,764
    • View Profile
    • MegaGlest - the free and open source cross platform 3D real-time strategy game
And I, but until now I wasn't aware what causes them. Tech catapults are a very reliable way to reproduce this.
atibox: Ryzen 1800X (8 cores @3.6GHz), 32 GB RAM, MSI Radeon RX 580 Gaming X 8G, PCI subsystem ID [1462:3417], (Radeon RX 580 chipset, POLARIS10) @3440x1440; latest stable Ubuntu release, (open source) radeon (amdgpu) / mesa video driver
atibox (old): Core2Quad Q9400 (4 cores @2.66GHz), 8 GB RAM, XFX HD-467X-DDF2, PCI subsystem ID [1682:2931], (Radeon HD 4670, RV730 XT) @1680x1050; latest stable Ubuntu release, (open source) radeon / mesa video driver
notebook: HP envy13d020ng
internet access: VDSL2+

· · · How YOU can contribute to MG · Latest development snapshot · How to build yourself · Megapack techtree · Currently hosted MG games · · ·

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
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 ).
« Last Edit: 27 December 2013, 14:00:36 by titi »
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios

Coldfusionstorm

  • Golem
  • ******
  • Posts: 868
    • View Profile
At last there are more people than just me saying this is wrong.

Hear hear.
WiP Game developer.
I do danish translations.
"i break stuff"

will

  • Golem
  • ******
  • Posts: 783
    • View Profile
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.

titi

  • MegaGlest Team
  • Airship
  • ********
  • Posts: 4,240
    • View Profile
    • http://www.titusgames.de
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.
Try Megaglest! Improved Engine / New factions / New tilesets / New maps / New scenarios