How khapaev/caliber-ads-calculator works
1. This repository is a small, browser-side calculator for Caliber ADS sensitivity. There is no backend, database, or build pipeline visible in the repo; the whole app appears to run as a static site.
2. The architecture is centered in docs/, which likely serves as the deployable front-end bundle:
- docs/index.html provides the page structure and mounts the calculator UI.
- docs/styles.css handles presentation.
- docs/app.js contains the interactive logic and calculations.
- docs/weapons.json is the static game-data source the calculator reads from.
3. The main domain boundary is between UI and game data. The UI lets the user pick an operator/weapon, while the JSON data defines the weapon inventory, compatible sights/modules, and other parameters needed for sensitivity math.
4. The core computation flow is client-side:
- user selects an operative or weapon,
- the app filters the available sights to only those compatible with that weapon,
- the app calculates ADS sensitivity for the same cm/360,
- it also calculates ADS sensitivity with FOV compensation,
- and it outputs the final ADS FOV plus the resulting AimSensitivityModifier values.
5. weapons.json is the primary data dependency. It likely encodes the mapping between operatives, weapons, and supported modules/sights extracted from Caliber version 1.4.0.9646.13464, so the correctness of the calculator depends on this file staying in sync with the game data.
6. app.js is the main orchestration layer. It likely owns:
- loading/parsing weapons.json,
- populating dropdowns or selectors,
- reacting to user input,
- performing all math for ADS/FOV/sensitivity,
- rendering computed results back into the page.
7. index.html and styles.css form a simple presentation boundary. There are no signs of framework routing, server templates, or component hierarchy beyond what a small interactive page would need.
8. The app’s data flow is one-way and local: static JSON data plus user input produce computed sensitivity outputs in the browser. There is no evidence of network calls, persistence, authentication, or cross-service communication.
9. The repository is documentation-light and purpose-specific. The README confirms the calculator’s scope: it is a technical sensitivity tool for Caliber, not a general game companion or stats tracker.
10. For an architecture diagram, the key boxes are:
- Browser/UI layer,
- Calculation logic in app.js,
- Game-data source in weapons.json,
- Static hosting surface in docs/.
11. The important external dependency is the game’s internal data model, but it is already captured offline inside the repo. That means the system’s “integration point” is not a live API, but a curated static extraction from the game client.
12. In short: this is a self-contained static calculator where the front-end owns all interaction and computation, and the JSON file provides the authoritative compatibility/data model used by the sensitivity formulas.
Main entry points: app.js Calculator app · weapons.json Weapon data · index.html Page shell · styles.css Styles
Components 8
docs/ front-end
Static browser calculator bundle and assets
- Page shell · Mount point and page structure for the calculator UI
docs/index.html - Styles · Visual styling for the static calculator page
docs/styles.css - Calculator app · Loads data, handles selection changes, performs ADS and FOV sensitivity calculations, and renders results
docs/app.js - Weapon data · Authoritative weapon, operator, sight, and compatibility data used by the calculator
docs/weapons.json
Other components
- User · Selects weapons and views calculated ADS sensitivity outputs
- UI layer · Interactive selectors and output display built from the static page and styles
- Compatibility filter · Restricts sights and modules to those supported by the selected weapon
- Sensitivity math · Computes same-cm/360 ADS values, FOV compensation, final ADS FOV, and AimSensitivityModifier results
Connections 11
- User → UI layer: uses · Interacts with selectors and reads computed output
- Page shell → UI layer: hosts · Provides the page structure that mounts the calculator
- Styles → UI layer: styles · Defines presentation for the UI layer
- UI layer → Calculator app: events · User input is handled by the client script
- Calculator app → Weapon data: loads · Reads the static weapon catalog at runtime
- Calculator app → Compatibility filter: filters · Applies weapon-to-sight/module compatibility rules
- Weapon data → Compatibility filter: provides data · Supplies the weapon and module mapping used for filtering
- Compatibility filter → Sensitivity math: feeds · Selected weapon and sight constraints determine the sensitivity calculation inputs
- Calculator app → Sensitivity math: computes · Runs the ADS and FOV compensation formulas in the browser
- Sensitivity math → UI layer: renders · Outputs ADS FOV and AimSensitivityModifier values back to the page
- Calculator app → UI layer: updates · Refreshes the visible results after each selection change