UFO: Alien Invasion Issue Tracker
UFO: Alien Invasion
Go to the previous open issue
Go to the previous issue (open or closed)
star_faded.png
Please log in to bookmark issues
icon_project.png UFO: Alien Invasion / Closed Bug report #2422 alien not visible through window with glass
Go to the next issue (open or closed)
Go to the next open issue
This issue has been closed with status "Closed" and resolution "Not determined".
Issue basics
  • Type of issue
    Bug report
  • Category
    Battlescape
  • Targetted for
    Not determined
  • Status
    Closed
  • Priority
    5. Important
User pain
  • Type of bug
    Not triaged
  • Likelihood
    Not triaged
  • Effect
    Not triaged
Affected by this issue (0)
There are no items
People involved
Times and dates
  • Posted at
  • Last updated
  • Estimated time
    Not estimated
Issue details
  • Resolution
    Not determined
  • Reproducability
    Not determined
  • Severity
    Not determined
  • Complexity
    Not determined
  • Platform
    Not determined
  • Architecture
    Not determined
Attachments (0)
There is nothing attached to this issue
Duplicate issues (0)
This issue does not have any duplicates
Description
[http://sourceforge.net/p/ufoai/bugs/2422 Item 2422] imported from sourceforge.net tracker on 2013-01-28 19:35:59

window brush is func_breakable with blend33 set
===== Comments Ported from Sourceforge =====

====== tlh2000 (2010-03-22 19:18:53) ======


====== tlh2000 (2010-03-22 19:19:33) ======

would be nice if you could have a look at that duke.
====== aduke1 (2010-03-27 00:16:53) ======

Stupid question: can we see an alien through a clear (window-)brush, ie. without any blendXX set ?
I don't think so...

Also...do you really think this is a prio 8 prob ?
====== tlh2000 (2010-03-27 06:11:07) ======

no, i've added a window content flag without any change. i've set this to prio 8 because this has a great tactical impact imo. Feel free to lower it if you think this is not the case.
====== tlh2000 (2010-03-27 06:11:33) ======

same map with window content flags set, too
====== tlh2000 (2010-03-27 06:41:15) ======

not the fix - but something i would like to discuss here, too
====== tlh2000 (2010-03-27 06:41:59) ======

please also have a look at the attached patch. imo we should use the vis mask, not the solid mask to check for visibility.
====== tlh2000 (2010-03-27 06:42:56) ======

same map but one of the windows is no breakable anymore (to be able to check both cases in one map)
====== aduke1 (2010-03-30 22:02:46) ======

I have added a new section to the bsp tree article in our wiki. Please read that first before continuing:
http://ufoai.ninex.info/wiki/index.php/BSP_tree#Tracing

I hope this makes it clear why visiblity and shooting must behave the same with current code. Changing this behaviour would require a major cleanup in the code that uses traces in the first place imho.
Using PointTraces (BoxTrace with volume=0) for shooting might work, but it would significantly slow down AI. Not sure how much, though.

Another approach would be to allow targeting *through* glass windows and use a PointTrace only for the shot actually fired. But that still wouldn't solve the blend33 prob.

2Q about blend33:
Does 33 mean 33% less light or 33% light remains ?
Should I think of 'milky glass' or 'sunglasses' ?

Imho the whole thing is more a feature request than a bug and should be left for 2.4.
====== tlh2000 (2010-03-31 05:30:30) ======

then we should remove all window brushes again - as this worked once and now we are not able to see our enemies.

blend33 just uses an alpha value of 0.33 when rendering the surface - blend66 used 0.66 as alpha value. in terms of visibility both should be the same.
====== aduke1 (2010-04-01 19:10:40) ======

Let's keep the windows in until we decided how to solve this ;)

I found some inconsistencies so far:
Targeting and shooting is done with PointTraces, but AI hiding uses LineTraces
==> AI might hide behind glass
CL_ActorVis (PointTrace) is only used for circling through the visible aliens. The visibility is determined elsewhere with G_Vis (LineTrace) , somewhere around EV_ACTORAPPEAR.
I think I even saw a bugreport about that somewhere.

But before looking for a technical solution, we should answer some questions:
1. do we really want to stick with the concept that a window pane can stop the first shot of every type of bullet ?
2. How do we want to handle opaqueness/cloudiness of glass ?
3. Do we need a new 'can shoot through' parameter for things like hedges or japanese paper walls or clouded glass ?
====== aduke1 (2010-04-01 23:03:41) ======

Found the bugreport:
https://sourceforge.net/tracker/?func=detail&aid=2962518&group_id=157793&atid=805242
Imho this might be related to such inconsistency....
====== aduke1 (2010-04-05 22:09:23) ======

Current status:
I managed to make LineTraces go through a glass brush.
But they do NOT go through a func_breakable glass.

That's because G_Vis and such in the end use CM_EntTestLine(), which uses a LineTrace to check the world, and a PointTrace for inlines. That PointTrace uses MASK_ALL. That is, *everything* in an inline model will block the line (of sight). I guess I could create half a dozen bug reports for that alone. Let's hope such combinations are not in the maps...

====== aduke1 (2010-04-13 23:51:27) ======

Status update:
Good news:
I got it to work.
Bad news:
1. I yet don't know *how and why* it works.
2. As already stated below, I suspect this fix will have a serious impact on AI behaviour. As AI uses LoS for shooting, aliens will think they can shoot through glass windows and act accordingly :(
====== tlh2000 (2010-04-14 05:35:53) ======

got it also working for func_breakables? or only for normal brushes?
====== aduke1 (2010-04-14 18:46:31) ======

Works for both.
====== tlh2000 (2010-04-14 18:53:17) ======

great if there wasn't been point 1 in your bad news ;)

shooting through glass windows would be cool btw. all glass windows should be func_breakable anyway - as the player would suspect them to break. if that's not the case, that a map bug imo. we can't offer one window that breaks and another one that does not break.

would be nice if you could attach your fix.
====== aduke1 (2010-04-14 20:10:45) ======

fix; only the first line changed is relevant
====== aduke1 (2010-04-14 20:20:36) ======

Uploaded the patch.

The thing that I don't (yet) understand is that allthough CONTENTS_WINDOW is not contained in the brushmask (so it shouldn't be considered 'blocking' anyway), it only works if I pass it as brushreject.

Aliens shooting *at* windows is fine if AI knows about it. The patch makes aliens think they are shooting at a victim *through* a window. This involves eventually killing themselves if they use explosives :(

====== aduke1 (2010-04-18 19:33:25) ======

At least I understand now why I had to pass CONTENTS_WINDOW as brushreject:
The window pane has *both* the SOLID and the WINDOW flag set, which is bad imho.
====== aduke1 (2010-04-21 22:51:08) ======

Guess I found a way now to avoid the "SOLID and WINDOW flag"-prob in ufo2 map :)

That leaves us with the question:
Should we
a) NOT apply this patch (and continue to have aliens hiding behind windows) or
b) apply it (and have aliens trying to shoot through windows, eventually killing themselves)

The next steps should be
1. use PointTraces for AI shooting decisions (complex)
2. make shooting decisions depend the ammo used (more complex)
3. let actors shoot through glass, depending on the ammo (even more complex)

But what should we do *now* ?

====== aduke1 (2010-04-21 22:53:33) ======


====== tlh2000 (2010-04-22 06:11:16) ======

b) please - it was like that before, too.

and using splash damage is still a big todo for the ai - because they even still can't use grenades as they don't take the bouncing part into account, they are always targetting directly onto the target => thus grenades bouncing away. once we have code for this the code for the splash damage ammo shouldn't be that hard to adopt imo.
====== aduke1 (2010-04-23 19:16:20) ======

The solution I thought I had found didn't work as expected. So I committed the 'dirty' fix for now as r29527 and will continue to look for the clean solution.
====== aduke1 (2010-04-23 21:45:38) ======

r29532 has the 'clean' fix.
Note that this needs all maps with glass to be recompiled.
Steps to reproduce this issue
Nothing entered.
Todos (0 / 0)
Issue created
footer_logo.png The Bug Genie 4.3.1 | Support | Feedback spinning_16.gif