*/
Back to Blogs

ModelExtras: Enhancing GTA San Andreas with Custom Ped and Vehicle Features

How I built an ASI plugin that adds custom features to peds, weapons, and vehicle components in GTA San Andreas using C++ and DirectX.

C++
Game Modding
DirectX

What is ModelExtras?

ModelExtras is an open-source ASI plugin for GTA San Andreas that extends the game's ped, weapon, and vehicle systems. Inspired by projects like VehFuncs and ImVehFt, it adds thousands of customizable features.

Core Features

  • Custom ped models with additional bone structures
  • Weapon attachments with proper positioning and animation
  • Vehicle component systems that go beyond the game's built-in modding
  • Procedural spawn systems for props and scenery

Technical Deep Dive

The plugin hooks into the game's rendering pipeline using a DirectX 9 hook:

code
// Hook into the rendering pipeline
void InstallRenderHook() {
    // Save original function pointer
    oDrawFrame = (DrawFrame_t)memcpy_alloc(
        (void*)0x53E220, 5
    );

    // Write detour
    *(BYTE*)0x53E220 = 0xE9;
    *(DWORD*)(0x53E221) = (DWORD)hkDrawFrame - 0x53E226;
}

Performance Considerations

When modifying every frame's render call, performance is critical. I implemented:

  • Caching systems for frequently accessed data
  • Spatial partitioning to only process nearby objects
  • Lazy initialization for expensive resources
  • Frame skipping for non-critical updates

Community Impact

With over 50,000 downloads, ModelExtras has become a staple in the GTA SA modding community. The open-source nature has led to community contributions and forks that extend its functionality even further.

GitHub
LinkedIn
youtube