summaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Props: remove studio diagnostics; document the prop tint pathsalmonik4 days1-20/+0
| | | | | | | Drop the temporary DrawModel/SetColor logs now that the prop tint works, and document the IStudioRender hook layout, the short model-name format used for prop detection, the SetColor-before-DrawModel ordering, and why prop materials cannot be tinted directly.
* Props: force colour inside prop DrawModel; no prop material tintsalmonik4 days2-8/+11
| | | | | | | The engine calls SetColorModulation(1,1,1) immediately before DrawModel, so the in-draw flag never sees it. Set the prop colour at the start of the prop DrawModel hook instead (colour only, not alpha), and stop applying ColorModulate to prop materials so only one mechanism touches props.
* Props: install the studio hooks againsalmonik4 days1-0/+2
| | | | | | The entity-path rewrite of prop_tint_update dropped studio_props_init(), so the minimal IStudioRender hooks were never installed (no studio: log lines). Call it while the prop tint is enabled.
* Props: only substitute colour during studio draws (no forced set)salmonik4 days1-19/+11
| | | | | | | | | The forced SetColorModulation/SetAlphaModulation calls before DrawModel are what turned matched props into the error material and destabilised the material system. Mirror Amalgam instead: set a "drawing a prop" flag around the original draw and only substitute the colour when the engine itself calls SetColorModulation during that draw. Log those calls for the first few draws to see whether the engine applies modulation inside DrawModel at all.
* Props: disable StudioRender hooks, fix m_clrRender offsetsalmonik4 days3-6/+60
| | | | | | | | | | | | Hooking IStudioRender's draw/setter slots made matched props render the error material and then crashed the material system ("debug/modelstats has bad reference count 0 when being bound"). Keep the hook code for reference but do not install it. Fix the m_clrRender netvar resolution: the walk picked an embedded table entry at offset 0, so the earlier entity writes stomped entity vtables. Only accept offsets inside C_BaseEntity (0x20..0x2000), then write the prop colour there for models/props entities. Restore white when disabled.
* Props: match the studio model name formatsalmonik4 days1-1/+12
| | | | | | | | studiohdr_t::name is not "models/props/...". In this build it is the short model name with Windows separators, e.g. "props_junk\wood_crate002a.mdl" (the models/ prefix is stripped). Normalise the prefix/separators and match props/, props\ and props_ (excluding the distant props_skybox set), so the studio hooks actually recognise prop draws.
* Diagnose prop tinting: log prop materials and studio draw model namessalmonik4 days2-3/+15
| | | | | | | Log the first crate materials the tint pass modifies and the first DrawModel/ DrawModelArray calls with their model names, to see whether the crates are brush materials that were never reached, materials loaded after the tint was applied, or a studio draw path that is still missed.
* Props: tint through DrawModel/DrawModelArray; drop m_clrRender writessalmonik4 days2-56/+55
| | | | | | | | | | | m_clrRender resolved to offset 0 in this build; writing it stomped entity vtables instead of tinting anything. Remove that path. The static-prop logging showed DrawModelStaticProp is never called for these props, so hook the other studio draw entries as well: DrawModel (29) for entity models and DrawModelArray (46, the instanced static-prop path). Both read the model name from DrawModelInfo_t::m_pStudioHdr and force the prop colour for models/props* draws.
* World tint: include props/ materials; log static studio drawssalmonik4 days2-2/+18
| | | | | | | | | Static props commonly use brush-style props/... materials (props/woodcrate001a is LightmappedGeneric), so the models/props-only filter missed them. Include the props/ prefix. Also log the first static prop studio draws and a 500-draw summary so we can see whether the engine draws props through DrawModelStaticProp at all.
* World tint: tint map-static props through IStudioRendersalmonik5 days3-0/+181
| | | | | | | | | | | | | | | Most of the crates are prop_static, which have no client entity, so writing m_clrRender only reached the three dynamic ones. Hook the StudioRender interface (VStudioRender025) on the interface object's vtable: substitute the prop colour in SetColorModulation/SetAlphaModulation while DrawModelStaticProp is drawing a models/props model, and set the modulation explicitly before the original draw in case the engine sets it just before the call. Vtable indices verified by disassembling CStudioRenderContext: 27 = three float stores from the argument pointer, 28 = one float, 30 = the DrawModelInfo_t-drawing entry with three arguments (the 2013 SDK header lists these slots five positions earlier in this build).
* World tint: colour dynamic props through m_clrRendersalmonik5 days4-2/+56
| | | | | | | | | | Prop model materials (VertexLitGeneric) ignore IMaterial::ColorModulate: the engine feeds StudioRender the per-entity render colour (m_clrRender) on every draw, so the material-side tint never showed on crates and other props. Resolve m_clrRender from DT_BaseEntity and, every 10 ms while World tint and Props are enabled, write the prop colour into every entity whose model is under models/props. Restore white once when disabled.
* Skybox image: swap red/blue in the uploaded texturesalmonik5 days1-0/+9
| | | | | | The procedural texture reaches the sky sampler with the red and blue channels exchanged (blue sky rendered orange/yellow), while the game's own textures are correct. Swap R/B in the decoded buffer so the sampled colours match the PNG.
* Skybox image: apply HDR colour compensation where materials existsalmonik5 days1-27/+32
| | | | | | | | | | Move the HDR decision from texture load to apply_sky_texture, after the sky materials have definitely been enumerated: compensate the pixel buffer (sRGB -> linear, alpha = 1/8) and re-download the procedural texture before assigning it. The earlier load-time check ran before the materials were visible and silently chose the LDR path, so the 8x HDR decode stayed. Also log the compensation explicitly so the chosen path is visible.
* Skybox image: recognise Sky_HDR_DX9 as the HDR sky shadersalmonik5 days1-1/+5
| | | | | | The material reports shader "Sky_HDR_DX9", not "sky", so the linear/alpha compensation was never applied and the raw sRGB image was scaled by the HDR decode's 8x. Match the Sky_HDR prefix so the compensation path is used.
* Skybox image: match HDR sky colour decodesalmonik5 days1-5/+61
| | | | | | | | | | | | | The HDR "sky" shader samples the compressed texture as rgb *= alpha, multiplies by 8, then converts linear->sRGB for display. Feeding it the raw sRGB image produced the blown-out / oversaturated sky. When the map uses the HDR sky shader, pre-convert the image to linear and set alpha to 1/8 so the 8x scale cancels and the final linear->sRGB conversion restores the original colours. For LDR (UnlitGeneric) materials, create the texture with TEXTUREFLAGS_SRGB so the normal sRGB sampling is used. The first sky material's shader name is logged for confirmation.
* Skybox image: drop Refresh/SetUndefined (crash after apply)salmonik5 days1-22/+11
| | | | | | | | | | | | | | | The last crash happened after "applied", in materialsystem while the renderer walked a shader-parameter list that contained a null vtable entry. That points at the Refresh()/SetUndefined experiment: undefining $hdrcompressedtexture while the sky shader's static combo still expected it (and rebuilding state mid-level) left a broken material. Set the texture on $basetexture/$hdrbasetexture/$hdrcompressedtexture (and the 0/1/2 variants) and do neither SetUndefined nor Refresh: the visible-path material binds its base texture dynamically, which is what made the earlier black sky (empty 798x798 VTF) appear black at all. Log the first sky material's shader name so we know whether this map uses the LDR (UnlitGeneric) or HDR (sky) path.
* Skybox image: power-of-two resize; upload at FRAME_RENDER_STARTsalmonik5 days3-1/+62
| | | | | | | | | | | | | - The material system rejects textures whose dimensions are not multiples of 4 ("Image dimensions must be multiple of 4!"), so scale the decoded image to the next power of two (bilinear). 798x798 -> 1024x1024. The invalid VTF also crashed the renderer after the apply. - Move skybox_update() out of the VGUI paint hook into the FRAME_RENDER_START FrameStageNotify stage. ITexture::Download only regenerates bits when the material system considers the frame render-safe; during paint it returned early, the regenerator never ran (no pixels), and a later upload of the empty VTF crashed. - Log the regenerator entry so the log shows whether the upload path ran.
* Skybox image: fix HDR sky binding; clip checkbox/arrow drawingsalmonik5 days2-20/+52
| | | | | | | | | | | | | | The HDR sky materials use the "sky" shader with $hdrcompressedtexture (DXT5). Assigning an RGBA8 procedural texture there sampled as compressed data and rendered black. Point $hdrbasetexture at the image, undefine $hdrcompressedtexture (and its 0/1/2 variants) so the shader falls back, and call IMaterial::Refresh (37) because the sky shader binds textures in SHADER_INIT, which is otherwise cached. GUI: draw_checkbox and the card expand chevron ignored the content clip, so cards scrolled out of view leaked header widgets outside the window. Log the first regenerator call (size/pitch/first pixel) for diagnosis.
* Skybox image: decode PNG ourselves to avoid symbol interpositionsalmonik5 days1-41/+194
| | | | | | | | | | | | client.so, engine.so and vguimatsurface.so all export their own png_create_read_struct. Loading the system libpng16 made its internal calls bind to the game's older libpng, whose png_struct layout differs, so png_safe_warning read a NULL error_ptr and crashed. Replace libpng with a small PNG reader: zlib's uncompress (dlopen'ed) plus the five PNG row filters, supporting 8-bit non-interlaced RGB/RGBA/gray/palette images with tRNS alpha for palettes. Output verified byte-identical to libpng for the skybox.png in use.
* Skybox image: upload via procedural texture, not CreateTextureFromBitssalmonik5 days1-6/+60
| | | | | | | | | | | The crash was CreateTextureFromBits: this build's IMaterialSystem interface stops at GetDisplayDeviceName, and the slots after it are CMaterialSystem's own virtuals, so index 134 was an unrelated function. Use CreateProceduralTexture (81, verified by disassembling the interface vtable) together with an ITextureRegenerator (SetTextureRegenerator 12, Download 13) that fills mip 0 via IVTFTexture::ImageData (39; IVTFTexture has a two-slot virtual destructor, so Width=15, Height=16, RowSizeInBytes=19).
* World: replace skybox changer with a PNG skybox imagesalmonik5 days4-177/+275
| | | | | | | | | | | | | | | | | sv_skyname did not take effect at runtime in this build, so the Skybox card now replaces the skybox materials' textures with <config dir>/skybox.png. The PNG is decoded through libpng16's simplified API (dlopen'ed, so no new link dependency) and uploaded with IMaterialSystem::CreateTextureFromBits as an RGBA8888 texture. IMaterialVar::SetTextureValue assigns it to $basetexture and the HDR variants for every material in the SkyBox textures group (all six faces get the same image). Original textures are recorded per material/var (texture pointer plus string fallback) and restored when the feature is off. Records survive level changes so a reused sky material is still restorable; the override is re-applied to a new map automatically. The card shows the image path and has a Reload image button; a missing/unreadable PNG raises an error toast.
* World: add skybox changersalmonik5 days5-7/+244
| | | | | | | | | | | | | | New Visuals -> Skybox card with a runtime sv_skyname override using the same mechanism as the stock skybox_swapper entity. The choice list is the HL2 skybox set extracted from the game VPKs. The map's own sky is captured from loaded materials (SkyBox group, parsing skybox/<name>... face names) before the first override, so turning the feature off or picking "Map default" restores it; a level change restores it implicitly. Sky changes invalidate the world tint so new sky materials are tinted as well. GUI: add a CK_CHOICE control (value box with < / > zones).
* AI: treat scripted NPCs as neutral; Lamarr neutralsalmonik5 days3-15/+45
| | | | | | | | | | Read the server m_NPCState and mark NPC_STATE_SCRIPT actors neutral so cutscene NPCs and scripted pets are not aimbot targets and draw in the neutral colour. Add Lamarr (Kleiner's pet headcrab) to the neutral model list as requested. Also log state changes in the NPC debug line and resolve/log m_NPCState in the server datamap summary.
* World: add prop tint and fog overridesalmonik5 days5-28/+213
| | | | | | | | | | - World tint now also colours prop materials (models/props*) with their own colour, covering static props and prop_physics while leaving NPC, player and weapon materials untouched. - New Fog card: fog_override colour/start/end via ClientCmd, optional skybox fog, and a Remove fog mode. Restores the map fog (fog_override 0) when disabled and re-applies after level changes. - Config sections [worldtint] prop/colour keys and [fog].
* GUI: add inline colour picker controlsalmonik5 days1-14/+312
| | | | | | | | | | | | Replace the six RGB sliders on the World tint card with a CK_COLOR control: each row shows a live swatch and expands an inline picker with a saturation/value square, a hue bar, and hex/RGB preview. The picker grows the card in place so it scrolls/clips like any other row, keeps HSV state while open (grey does not lose its hue), writes the shared 0-255 RGB triple used by the config, and saves on mouse release. Costs ~1.2k small rects per frame only while a picker is open; no texture interface needed.
* World: add world/sky material colour modulationsalmonik5 days5-4/+320
| | | | | | | | | | | | | | | Port Amalgam's modulation approach: obtain IMaterialSystem from the already loaded materialsystem.so (VMaterialSystem080) and walk materials with FirstMaterial/NextMaterial/GetMaterial. ColorModulate the "World textures" group (sky names excluded) and the "SkyBox textures"/sky-named group. The walk runs only when the enabled groups or colours change, restores white when disabled, and re-applies after level changes. Before touching materials, GetNumMaterials() and the first material's name/group are sanity-checked so a wrong vtable slot logs and aborts instead of walking garbage. GUI: "World tint" card with world/sky toggles and RGB sliders; config section [worldtint].
* Remove temporary crash-stage markerssalmonik5 days3-26/+0
|
* AI: fix relationship lookup; classify citizen/hacked turretssalmonik5 days3-7/+67
| | | | | | | | | | | | | | m_Relationship is DEFINE_UTLVECTOR (FIELD_CUSTOM), not FIELD_EMBEDDED, so the datamap scan always returned -1 and every NPC fell back to the model heuristic. Resolve it as FIELD_CUSTOM with an embedded fallback. Floor turrets never add relationship rows when friendly: CNPC_FloorTurret overrides Classify() to CLASS_PLAYER_ALLY for citizen-built (SF_FLOOR_TURRET_CITIZEN) and Alyx-hacked turrets. Read m_spawnflags and m_bHackedByAlyx from the server instead. Widen the datamap offset window (0x4..0x4000) for derived-class fields and log the new offsets plus turret state in the NPC debug line.
* AI: debug-log NPC relation changessalmonik5 days1-0/+16
|
* AI: use server relationships to classify NPC friendlinesssalmonik5 days3-10/+101
| | | | | | | | | | | - Read the server NPC's m_Relationship CUtlVector (entity row for the local player first, then the CLASS_PLAYER row): D_LI friendly, D_NU neutral, D_HT/D_FR hostile. - Use it for ESP colours and aimbot/silent-aim/melee target filtering, with the existing model heuristic as a fallback. - Treat bugbait-controlled antlions as friendly when their server m_hFollowTarget is set. - Resolve m_Relationship/m_hFollowTarget datamap offsets and log them.
* Fix undefined fullbright symbols; link with --no-undefinedsalmonik5 days1-0/+35
| | | | | | | The fullbright_update/fullbright_invalidate definitions were lost when the old text-menu section was removed, leaving undefined symbols that made the dynamic loader reject libhl2hake.so. Restore both definitions and add -Wl,--no-undefined so missing definitions fail the build instead of the game.
* Startup crash: skip fullbright command when off; drop bad owner netvars; add ↵salmonik5 days4-8/+26
| | | | stage markers
* Fix startup crash: use ClientCmd for fullbright; sanitize owner netvarssalmonik5 days2-27/+15
| | | | | | | | | - Poking VEngineCvar004/ConVar vtables directly crashed before the main menu (ConVar uses a secondary IConVar vtable). Use the stable IVEngineClient ClientCmd slot 7 for mat_fullbright instead. - Reject out-of-range m_hOwnerEntity/m_hOwner offsets: the resolver found a bogus negative owner offset (-136296061), which could make item-ESP weapon ownership read wild memory.
* World: add Fullbright visual featuresalmonik5 days4-3/+82
| | | | | | | | | | - New Visuals card with the usual Active + Bind; default off. Unbound+Active is always-on, a bind makes it hold-to-brighten. - Resolve VEngineCvar004 and set mat_fullbright 1/0 through FindVar (slot 12) and ConVar::SetValue(int) (slot 11), bypassing the console cheat gate. Fall back to ClientCmd if the cvar interface is unavailable. - Reapply after map loads/respawns and persist [fullbright] active/bind. - Log on/off; show an error toast if the cvar cannot be applied.
* Vischeck: only glass materials are glass; log font/glass diagnosticssalmonik5 days2-3/+11
|
* GUI: recover invalid fonts; vischeck: props and bulletproof glasssalmonik5 days4-53/+175
| | | | | | | | | | | | | - Validate the GUI font handles with GetTextSize and recreate them when the local player entity or UI scale changes. Small scaled sizes fall back to the proven 16 px size, and the failure log/toast is emitted once instead of every frame. This fixes sessions where the menu rendered with no text after a level transition. - Rework visibility: trace with MASK_SHOT/TRACE_EVERYTHING while ignoring the local player and target, so static props, crates and other NPCs block. Non-solid glass and breakable-glass materials are skipped; solid non-break glass (bulletproof) blocks. Fix CONTENTS_WINDOW 0x2 (was 0x4) in the masks. - Pass self/target to is_visible from aimbot/silent/melee callers.
* Handles: use the 11-bit networked EHANDLE entity indexsalmonik11 days2-5/+5
| | | | | | | | | The client m_hActiveWeapon is a networked EHANDLE: low 11 bits are the entity index and the rest is the serial. Masking with 0xFFFF included serial bits, so on later maps the weapon index became garbage (e.g. 49184/12319) and melee killbot could not recognize the crowbar. Use 0x7FF for client and server active-weapon handles, weapon owner checks and item-ESP weapon skips. Document the layout in CONTEXT.
* Melee: surface weapon state across maps; reset stale cachessalmonik11 days4-1/+41
| | | | | | | | | | | - Map transitions often leave a non-crowbar weapon active, so the killbot silently does nothing. Log every active-weapon change as a normal `melee: active ... crowbar=0/1` line and toast once suggesting the crowbar. - Recover the crowbar model from the server entity when the client weapon model index is missing/0 after a map change. - Clear the bone cache and aim/silent locks when the local player entity changes (map load/respawn) so stale entity/model data cannot poison melee target selection.
* Combat: fix silent-aim spread seed and lead projectilessalmonik11 days2-2/+71
| | | | | | | | | | - Silent aim and triggerbot set IN_ATTACK after CInput::CreateMove, so the minimal-spread seed was never applied to their shots. Re-apply spread_control_apply after setting the attack button, then update the CRC. - Crossbow bolts and RPG rockets are not hitscan. Lead the selected hitbox by target velocity * travel time; the crossbow bolt also gets its 0.05 gravity drop (30 u/s^2). Apply the same correction to the smooth aimbot. - Document both paths in CONTEXT.
* Item ESP: make 0 = unlimited explicit and persistentsalmonik11 days3-36/+19
| | | | | | | | | | - config_load now accepts max_dist=0 instead of clamping it to 250, so the "unlimited" setting survives a restart. - The Max distance slider shows "All" at 0 and its tooltip documents 0 = unlimited; the categories log prints max=All. - Skip unclassified entities before projecting them / computing distance. - Keep the removed prop/crate debug logging and the user's rule that the distance slider applies to every tag.
* Logging: per-session file and debug-gated verbose logssalmonik11 days9-64/+99
| | | | | | | | | | | | | | | | - Open /tmp/hl2hake.log once in the library constructor with "w" so each session starts clean, use line buffering, flush each line, and close it via atexit. No more fopen/fclose per message. - Add logd() for verbose diagnostics, enabled only with HL2H_DEBUG=1. - Move ESP/NPC scans, item-prop/item-classification logs, aimbot/silent-aim/ melee/triggerbot/spread details, jumpbug tracking, bone dumps, netvar dumps, cmd-modified and ground-trace noise to logd(). - Keep logf() for lifecycle, config, warnings/errors, GUI open/close, item category/tagging summaries and item-crate detections so crate debugging works without the ESP stream. - Supply crates now respect the max-distance slider (user change), with the stale comment and CONTEXT updated. - Document HL2H_DEBUG=1 in play.sh and CONTEXT.
* Item ESP: recover CPhysicsProp model names from the serversalmonik11 days1-4/+18
| | | | | | | Client CPhysicsProp entities frequently report m_nModelIndex == 0, so item crates appeared as model=? and were never classified. Fall back to the server entity's m_nModelIndex (set in CItem_ItemCrate::Spawn) when the client model index is missing, then resolve the name through the shared modelinfo.
* Item ESP: fix AR2/RPG/stunstick world-model namessalmonik12 days1-10/+17
| | | | | | | HL2 uses w_irifle for the AR2, w_rocket_launcher for the RPG and w_stunbaton for the stunstick. Keep the model-path fallback (with larger buffers) so unknown world models can still be identified in-game, and make the supply-crate marker larger.
* edge-case in weapon displaying and fixing RPG filteringsalmonik12 days1-2/+2
|
* Item ESP: focus crate diagnostics on nearby props; log build timesalmonik12 days2-3/+3
|
* Item ESP: always tag supply crates regardless of distancesalmonik12 days1-1/+4
|
* Item ESP: raise max distance default to 5000 unitssalmonik12 days2-4/+4
|
* Item ESP: log every crate-like entity for diagnosissalmonik12 days1-7/+9
|
* Item ESP: tag world weapons, name ammo types, restrict cratessalmonik12 days5-32/+232
| | | | | | | | | | | | | - Add a Weapons category and classify world weapon models (crowbar, pistol, revolver, SMG, AR2, shotgun, crossbow, RPG, grenade, gravity gun, stunstick, bugbait, sniper). Skip the active weapon and anything with a valid m_hOwner/m_hOwnerEntity handle so held weapons do not tag. - Label ammo by model: pistol, SMG, AR2, .357, crossbow, shotgun, sniper, flares, AR2 grenade, RPG rocket and specific ammo-crate variants. - Only item_item_crate and item_beacon_crate are supply crates; generic breakable crates are no longer tagged. Crate chunks stay excluded. - Add item diagnostics: category state, prop-like entities with class/model/ kind/distance/origin, and every item crate seen.
* Item ESP: tag breakable wood/plastic/metal cratessalmonik12 days1-0/+13
|