NeotokyoRebuild / neo

NEOTOKYO Rebuild - Source SDK 2013 mod of NEOTOKYO
https://neotokyorebuild.github.io/
Other
23 stars 12 forks source link

[FEATURE] Blockbullets material with anti-penetration compile flag #658

Open DESTROYGIRL opened 1 month ago

DESTROYGIRL commented 1 month ago

Description

A new blockbullets material that relies on a compile flag to correctly block bullets. The current blockbullets material doesn't actually rely on a compile flag to block bullets- it's just an invisible wall. So in the game bullets will simply penetrate it

Proposed Solution

Create a new material compile flag (https://developer.valvesoftware.com/wiki/Material_map_compile_flags) that prevents bullets from penetrating the brush

Alternatives Considered

Make a new surfaceprop (https://developer.valvesoftware.com/wiki/Material_surface_properties) instead that stops bullets penetrating. It looks like CSGO already has this

Additional Context

toolsblockpenetrate Proposed tool texture

AdamTadeusz commented 1 month ago

looking over these quickly I haven't figured out any way to make custom material compile flags or surfaceprops.

One workaround, albeit super janky, not the most efficient and could introduce bugs down the line, could be to check whether the hit surface name contains toolblockbullets or something like that, and return early if it does image

I guess maps with the text toolsblockbullets in their name would have no bullet penetration whatsoever for example xD

DESTROYGIRL commented 1 month ago

Perhaps it would be easier to repurpose an already existing surface prop, since there are different penetration values for concrete, glass, wood etc. Could maybe repurpose the No_decal surface prop to stop all bullets? Is that an easy change?

AdamTadeusz commented 1 month ago

image Going with the compile flag option seems doable There are two unused CONTENTS bits, either of which we can probably use ourselves ( CONTENTS_BULLETCLIP in the screenshot falls out of bounds of an int) just gotta double check we can access this contents parameter image