Enemy Territory Picmip hack


  • admin

    Wolfenstein uses cvar r_picmip to store the Texture Detail level that OpenGL will have to render.
    The possible value are

    • 0: High
    • 1: Medium
    • 2: Low
    • 3: Very Low

    But truth is, this value can be set to much lower, the lowest effective by OpenGL being 16.

    Now, the range of this cvar is verified by a function called AssertCvarRange

    static void AssertCvarRange(cvar_t *cv, float minVal, float maxVal, qboolean shouldBeIntegral) {
        if (cv->value < minVal) {
            ri.Printf(PRINT_WARNING, "WARNING: cvar '%s' out of range (%f < %f)\n", cv->name, cv->value, minVal);
            ri.Cvar_Set(cv->name, va("%f", minVal));
        } else if (cv->value > maxVal) {
            ri.Printf(PRINT_WARNING, "WARNING: cvar '%s' out of range (%f > %f)\n", cv->name, cv->value, maxVal);
            ri.Cvar_Set(cv->name, va("%f", maxVal));
        }
    }
    

    So if you set r_picmip to something higher than 3, ET will say

    WARNING: cvar 'r_picmip' out of range (16.000000 > 3.000000)
    

    AssertCvarRange is located @ 0x08110620 in ET 2.60b Linux.

    You can detour that function to remove the range checking, which will let you set picmip from 3 → 16.

    Another method is to modify r_picmip cvar value by accessing directly it by its offset.

    #include <windows.h>
    
    #define PICMIP 0x0046D8F7 // et 2.60b
    
    BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
        DWORD oldProt;
        switch (fdwReason) {
            case DLL_PROCESS_ATTACH:
                VirtualProtect((void *) PICMIP, 4, PAGE_EXECUTE_READWRITE, &oldProt);
                *(float *) PICMIP = 16.0f;
                VirtualProtect((void *) PICMIP, 4, oldProt, &oldProt);
                break;
        }
        return TRUE;
    }
    

    Screenshots




  • Donator

    So how can we change picmip ? In which folder do we have to enter these commands?


  • Donator

    @govap You'll need some coding skills to even understand what he is talking about. Although, you can change r_picmip with Adawolfa unlocker/dev client. Also Nexus Annihilator has got this feature, but I'm gonna test it out after I buy it.


 

3
Online

269
Users

22
Topics

248
Posts

  • @12thmonkey Hello, I hope you had a good weekend!
    I was quite busy, sorry for the delay, enjoy!! 🙂

    read more
  • 1

    @Annihil Hey there, just donated - looking forward to being added! Thanks!

    read more
  • @thecocain It might be because of the trial version limit! 😅

    read more
  • T

    can any tell me why my et is closing after 1-2 mins or even less?:(

    read more