How I built a lightning-fast Game Sens Converter in Vanilla JS

javascript dev.to

As a developer who frequently switches between competitive FPS titles like CS2 and Valorant, re-tuning mouse sensitivity is always a hassle. I wanted a fast, ad-free tool to translate my aim perfectly across titles, so I built a clean Game Sens Converter.

The Approach

I built this using 100% Vanilla JS. It’s a simple utility, so there was absolutely no need for a backend or heavy frameworks. It loads instantly and calculates right in the browser.

Here is a quick look at the core logic handling the sensitivity conversion multipliers:

function convertSensitivity(gameFrom, gameTo, currentSens) {
    // Standardized multipliers relative to CS2 / Source engine
    const multipliers = {
        'cs2': 1,
        'valorant': 3.181818,
        'overwatch': 0.3,
        'apex': 1
    };

    if (!multipliers[gameFrom] || !multipliers[gameTo]) return null;

    // Convert to base (CS2), then to the target game
    const baseSens = currentSens * multipliers[gameFrom];
    const convertedSens = baseSens / multipliers[gameTo];

    return convertedSens.toFixed(3);
}
Enter fullscreen mode Exit fullscreen mode

Try it out

You can use the live tool for free here: Game Sens Converter

Let me know what your main game is or if you'd add any other FPS titles to the list in the comments!

Source: dev.to

arrow_back Back to Tutorials