YaLTeR / OpenAG

An open-source reimplementation of Adrenaline Gamer's client library.
https://j.mp/OpenAG
Other
131 stars 42 forks source link

Added cl_show_server_triggers_* cvars (related to plugin PR) #183

Closed SmileyAG closed 8 months ago

SmileyAG commented 9 months ago

Explained in https://github.com/YaLTeR/hlkreedz/pull/37

I recently remembered and rebased my old request for plugin a few days ago and at the same time reminded about it to naz in discord, he said that would approve later, so I’m sending a pull request in advance, it’s not necessary to merge it now (since the PR plugin isn't merged yet), but you shouldn’t close it either

tmp64 commented 9 months ago

Maybe check for gEngfuncs.GetMaxClients() > 1 when hiding singleplayer triggers?

SmileyAG commented 9 months ago

Maybe check for gEngfuncs.GetMaxClients() > 1 when hiding singleplayer triggers?

Well, I'd say it might require a separate cvar at that point then, since even when I'm playing at own listenserver with maxplayers 1 and loaded amxmodx+metamod-p+hlkreedz combo, still don't want to see those SP triggers because they wouldn't action normally in deathmatch mode, example: https://github.com/YaLTeR/OpenAG/blob/27e7143daee4823b12cda4bcd1f1e8d1fbdaa4d6/dlls/triggers.cpp#L1466-L1475

SmileyAG commented 8 months ago

Please review this code again, because now I have fully changed it to display triggers with TriAPI

Let me first explain why this was done, because if being unenlightened in that question, then you would have a fair reason to ask: why the hell was it needed to go this way?

In short, modern map compilers cut off unused planes due to optimization (such as from triggers), but trigger entities from plugin is still transmitted from the server to the client, which means we can try to take their mins, maxs, origin and draw them separately (e.g. with TriAPI)

Showcase (value 1 = new triggers, value 2 = old triggers):

https://github.com/YaLTeR/OpenAG/assets/58108407/dd59c2b3-130c-43d6-a55e-c83498221762

tmp64 commented 8 months ago

What about trigger brushes of forms other than a box? They would be rendered incorrectly

SmileyAG commented 8 months ago

What about trigger brushes of forms other than a box? They would be rendered incorrectly

Probably, but have you ever seen a map in which the trigger is not a box? I've looked before through a lot of maps in the bspguy or directly in map sources with J.A.C.K, and I've never seen a brush trigger that wasn't in a box shape

tmp64 commented 8 months ago

Probably, but have you ever seen a map in which the trigger is not a box? I've looked before through a lot of maps in the bspguy or directly in map sources with J.A.C.K, and I've never seen a brush trigger that wasn't in a box shape

You can try rendering the 0-th hull of the brush entity model. It should be the exact one used for collision detection with point entities.
https://github.com/dreamstalker/rehlds/blob/93f5775ac26240782981f47ee8e052fb53d30877/rehlds/engine/world.cpp#L193

YaLTeR commented 8 months ago

Note that I'm not sure if we can use GPL code in OpenAG.

YaLTeR commented 8 months ago

I think rendering boxes only is fine if the alternative complicates things a lot.

tmp64 commented 8 months ago

Note that I'm not sure if we can use GPL code in OpenAG.

It's a reference to collision detection code and it's not intended to be added to OpenAG

SmileyAG commented 8 months ago

@YaLTeR @tmp64 Well I haven't contacted with naz for recent time, but at least exec approved that and updated plugin for all SourceRuns HLKZ servers, so pull requests in those both clients (OpenAG and BugfixedHL-Rebased) can be merged now:

изображение

YaLTeR commented 8 months ago

Thanks!