IsEntityVisible
Hello,
Please proof me wrong here. But a function like IsEntityVisible() is not possible to realize due to the nature of this engine. Well and don't get me started. The best solutions i found here deem these entitys not to be visible: http://www.abload.de/img/halflife04dg4.jpg http://www.abload.de/img/halflife05615.jpg Well, i can see 'em. Can you? The answer why these solutions fail is simple: They are not checking the visibility of a model. They are in fact only checking the visibility of one single point. The entitys' origin. Give me a break... That's worthless... TraceHull is out of the question, because our trace will end at the next wall. (right? no modifiers here) Only thing we can do here is to approximate visibility. Huh approximate? Well, we might just trace at every bone. This is pretty accurate and i did this. (uses up pretty much CPU time, :S ) Still, we are checking only single points. Theoretically there could be a wall with a tiny hole in it and behind that wall there is our enemy. We could be lookin at a body part which is not revealed by any bone point. Another idea i had: (This pretty much fucked up CPU ressources) I constructed this function to check visibility of a bounding box of an entity + single point of origin. Code:
/* == fm_is_bbox_in_sight ==To visualize what i am checking: http://www.abload.de/img/halflife07ae1.jpg Those are multiple scaled boxes overlayed. I am tracing every 8 edges of each box, to approximate visibility. It is damn accurate, depending on how many boxes i overlay. But it is also damn CPU Time consuming. So i am currently sticking with the bone-method. I also thought about looping through all hitboxes and applying my overlay-box method on each one. But hitbox access isn't that easy, and it would be also way too CPU-consuming. But what the hell do i want from you now? I was just curious if there was a pro-solution from some AMXX-Aholics here. Maybe even a solution that delivers irrefutable proof of visibility of a model. (based on the hitboxes is enough, not the actual mdl-surface) Anyone? |
Re: IsEntityVisible
Are you speaking of fm_is_ent_visible() from fakemeta_util?
Code:
|
Re: IsEntityVisible
Quote:
It is completely worthless. |
Re: IsEntityVisible
You can try to make a loop and check around the player origin, like origin[1] + 5.0, origin[0] + 5.0 and so...practically should work.
|
Re: IsEntityVisible
In 'fm_is_ent_visible()' , change fraction == 1.0 by fraction >= 0.9 and it will be almost perfect. :)
|
Re: IsEntityVisible
Almost perfect? There happen to be thick walls in this game...
http://www.abload.de/img/halflife10frw.jpg Sorry for the pixelation. My Graphic-cards ram got kind of hot once. |
Re: IsEntityVisible
Sorry, I've read too fast your problem and what I've said can't help you. :o
Now I understand and I will try to think a bit more. :) |
Re: IsEntityVisible
Don't be sorry. At least this got mentioned in this thread.
We can list all possible methods to detect visibility, and their pro and contras. |
Re: IsEntityVisible
i have the same problem like you,
did you found a working solution? |
Re: IsEntityVisible
Try getting the aim origin, then check for all entities in a small sphere that it's center is the aiming origin, and then check fm_is_bbox_in_sight() (or fm_is_ent_visible()). If the functions return false and there's a player near the aiming origin, there's a player half-visible behind a wall.
|
| All times are GMT -4. The time now is 05:39. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.