💣 SMH – a computer vision project for automatic, precision mortar strike calculations in Squad

Overview

💣 Squad Mortar Helper (SMH)

SMH is a computer vision toy project aimed at automating mortar calculations in the game Squad

Download


demo.mp4

image


Requirements

  • x86-64 CPU
  • Windows or Linux
  • (Windows) Visual C++ Redistributable Runtime 2015 (Squad installs this anyway)

Features

  • Automatically detects your Squad Leader's markers and calculates distance, altitude difference and milliradians
  • Start a local web server with a couple clicks for interacting with SMH using your mobile phone or the Steam browser
  • Rip heightmaps from the game for improved mortar calculation accuracy
  • Supports ripping heightmaps from installed mods
  • Choose between using your CPU or GPU for computer vision
  • Hold left click on the map to draw custom markers
  • Hold right click on the map for a quick range-finder
  • Use scroll wheel and middle mouse button to pan and zoom the map

FAQ

How does it work?

SMH uses computer vision and OCR (optical character recognition) to extract information from your in-game map, such as the map markers you or your SL has placed and the scales in the bottom-right of the map which map pixels to meters.

Using this information, SMH can tell you roughly how many meters away a marker is, and an estimate of the milliradians to configure your mortar to.

SMH can also be used as a range-finder and you can place your own markers by drawing on the map.

Can I get banned by EAC for using this?

No, the program does not attach to or read memory from the Squad game process.

SMH only takes screenshots of the game window using normal operating system APIs, and is akin to a normal screenshotting tool such as ShareX, Lightshot, Gyazo etc.

The program is completely open source and you can read through the code yourself!

I only have one monitor, how am I supposed to see the program?

Fear not - the program is capable of starting a minimal webserver on your local network which you can use to see the program on your mobile device or Steam browser!

Tips

The algorithms are not perfect – Squad's map can be quite noisy, and some map blips overlap information SMH analyzes. Here are some tips to help it out.

  • Don't use software such as f.lux that affect the colours of your screen (some OS-level filters like the Windows "Night light" work fine though)
  • Try to stay away from blips such as vehicles, HABs, etc. as they overlap squad leader markers
  • Listen to your team mates and squad for feedback on how accurate your hits are, correct if needed
  • If SMH isn't picking something up, you can draw your own markers on the map yourself!

Hardware Acceleration (GPU processing)

If you have a NVIDIA GPU, SMH supports using its CUDA cores for extremely fast computer vision processing.

This can be enabled or disabled in Settings > Hardware Acceleration, as you may prefer to offload work to the CPU rather than the GPU (which is trying to render Squad!)

I have made my best efforts to optimise the code to reduce resource usage in order to not starve Squad of the computing power it needs, but please bear in mind that computer vision is not an easy process. Your computer is going to have to work to make these calculations, so this program may not be be appropriate for lower end rigs. Do give it a try though, especially if you have a NVIDIA GPU, as the performance may surprise you. If you have a CPU with a lot of cores, it should also be very capable with hardware acceleration disabled.

Heightmaps

Heightmaps are ripped directly from the game files. You can select a heightmap to use in Heightmaps > Select. You can also export heightmaps as a grayscale PNG file, and see information such as the heightmap's scale, minimap bounds, texture corners, etc.

Please feel free to use the heightmap ripper for your own mortar calculator projects. I hope that it is useful!

Building

If you would like to compile this program yourself, you can follow these instructions.

Compiling this program yourself may be beneficial as targetting your exact CPU can enable further optimisations.

Credits

Badger – Line Segment Detection Algorithm (CPU)

Tesseract OCR – Optical Character Recognition

The Rust CUDA Project – NVIDIA CUDA for Rust

CUE4Parse – UE4 File Format Parser for ripping heightmaps

Dear Imgui – User Interface Library

SquadMC Team – Heightmap Guide

Various Squad Mortar Calculators – Projectile Calculations

You might also like...
dovi_meta is a CLI tool for creating Dolby Vision XML metadata from an encoded deliverable with binary metadata.

dovi_meta dovi_meta is a CLI tool for creating Dolby Vision XML metadata from an encoded deliverable with binary metadata. Building Toolchain The mini

This is the repository for the group project assignment in the course "Project in Introduction to Computer Science" (DD1396), by the Inda21plusplus group.

Project-Delta This is the repository for the group project assignment in the course "Project in Introduction to Computer Science" (DD1396), by the Ind

High precision decimal

decimal-rs High precision decimal with maximum precision of 38. Optional features serde When this optional dependency is enabled, Decimal implements t

Sub-pixel precision light spot rendering library for astronomy and video tracking applications.

Planetarium Sub-pixel precision light spot rendering library for astronomy and video tracking applications. Example usage use planetarium::{Canvas, Sp

Extended precision integer Rust library. Provides signed/unsigned integer 256 to 2048.

Extended precision integer Rust library. Provides signed/unsigned integer 256 to 2048.

Get unix time (nanoseconds) in blazing low latency with high precision

RTSC Get unix time (nanoseconds) in blazing low latency with high precision. About 5xx faster than SystemTime::now(). Performance OS CPU benchmark rts

Multiple precision floating point numbers implemented purely in Rust.

Multiple precision floating point numbers implemented purely in Rust. Rationale There are several notable implementations of numbers with increased pr

Rust edit distance routines accelerated using SIMD. Supports fast Hamming, Levenshtein, restricted Damerau-Levenshtein, etc. distance calculations and string search.

triple_accel Rust edit distance routines accelerated using SIMD. Supports fast Hamming, Levenshtein, restricted Damerau-Levenshtein, etc. distance cal

Fast shortest path calculations for Rust

Fast Paths The most famous algorithms used to calculate shortest paths are probably Dijkstra's algorithm and A*. However, shortest path calculation ca

A Decimal Implementation written in pure Rust suitable for financial calculations.

Decimal   A Decimal implementation written in pure Rust suitable for financial calculations that require significant integral and fractional digits wi

A lightweight full-text search library that provides full control over the scoring calculations

probly-search · A full-text search library, optimized for insertion speed, that provides full control over the scoring calculations. This start initia

A rust library + CLI tool  that tells you when swas will upload new video through complex calculations
A rust library + CLI tool that tells you when swas will upload new video through complex calculations

A rust library + CLI tool that tells you when swas will upload new video through complex calculations. It also lets you search and play youtube videos of swas and other channels. Searching about youtube channels is also an option. Basically it's a youtube search cli tool written in rust.

Terminal UI for erhanbaris/smartcalc, a new way to do calculations on-the-fly
Terminal UI for erhanbaris/smartcalc, a new way to do calculations on-the-fly

smartcalc-tui Terminal UI for erhanbaris/smartcalc, a new way to do calculations on-the-fly. From the README: Do your calculation on text based querie

Toolkit for simple calculations related to Data Comunication and Networks (only available in Spanish temporary)

CDR Toolkit Un toolkit creado para la asignatura Comunicación de Datos y Redes, cursada en la UIB. Es una potente y rápida CLI que ayuda a realizar lo

Source project for the Internet Computer software
Source project for the Internet Computer software

The Internet Computer is the world’s first blockchain that runs at web speed and can increase its capacity without bound. Like the Internet (which is composed of many machines adhering to TCP/IP protocol) and blockchain protocols (such as Bitcoin and Ethereum).

Final Project for
Final Project for "Computer Networking Security": A Layer-3 VPN implementation over TLS

Final Project for "Computer Networking Security": A Layer-3 VPN implementation over TLS

Semi-automatic OSINT framework and package manager

sn0int sn0int (pronounced /snoɪnt/) is a semi-automatic OSINT framework and package manager. It was built for IT security professionals and bug hunter

:rocket: Automatic crate publishing done right

semantic-rs The purpose of this tool is to help people to publish crates following the semver specification. Right now if you're building a new crate

:large_orange_diamond: Build beautiful terminal tables with automatic content wrapping
:large_orange_diamond: Build beautiful terminal tables with automatic content wrapping

Comfy-table Comfy-table tries to provide utility for building beautiful tables, while being easy to use. Features: Dynamic arrangement of content to a

Comments
  • Error using GPU vision

    Error using GPU vision

    Getting this on the latest version. Side question, do height maps need to be selected every map?

    [INFO] [smh_vision_ocr] Initializing Tesseract OCR version v5.1.0 [INFO] [smh_web] WebServer listening on 0.0.0.0:58533 [INFO] [smh_web] HTTP server listening on 0.0.0.0:58534 [WARN] [smh_web] Error getting local IP address: The current platform: windows, is not suppported [INFO] [smh_web::http] HTTP connection opened with: 192.168.0.15:58548 [INFO] [smh_web::ws] WebSocket Connection opened with: 192.168.0.15:58549 [ERROR] [smh::vision::hardware::gpu_support] Error loading GPU vision: LoadLibraryExW failed

    Caused by: The specified module could not be found. (os error 126)

    Stack backtrace: 0: 1: 2: 3: 4: 5: 6: BaseThreadInitThunk 7: RtlUserThreadStart

    Falling back to CPU vision...

    opened by automlboss 9
  • Error while capturing frame: invalid data

    Error while capturing frame: invalid data

    Can't get this to work : frame capture doesn't work No other message are show in logs

    OS: W11 Fullscreen, 2540x1080, tried windowed 1920x1080 for the same result

    INLBtg3itA

    opened by sh4rkman 1
  • Range discrepancy between SL marked target and manually added target

    Range discrepancy between SL marked target and manually added target

    It appears from testing that SL marks give values that are shorter than expected, resulting in inaccurate shell placement if only using SL marks.

    The first image shows an SL marker on a target with calculated values (distance given = 435m). Firing 9 volleys results in all shells missing their mark. sq1

    The second image shows manually ranging with left click drag to target (distance given = 452m). Using these calculated values results in perfect accuracy as the vehicle is destroyed after a few volleys.

    sq2

    The main difference I can see is the purple line from manual target placement starting in the center of the circle of the mortar emplacement icon, whereas the SL mark green line starts at the barrel end of the emplacement icon, if the the measurement was to start at the direct center of the circle of the icon could the SL mark calculation be more accurate?

    opened by automlboss 2
Owner
William
aka Billy
William
Generic Automatic Differentiation library for Rust (aka "autograd")

GAD: Generic Automatic Differentiation for Rust This project aims to provide a general and extensible framework for tape-based automatic differentiati

Facebook Research 24 Dec 20, 2022
A neural network, and tensor dynamic automatic differentiation implementation for Rust.

Corgi A neural network, and tensor dynamic automatic differentiation implementation for Rust. BLAS The BLAS feature can be enabled, and requires CBLAS

Patrick Song 20 Nov 7, 2022
Automatic differentiation in pure Rust.

Niura is an automatic differentiation library written in Rust. Add niura to your project [dependencies] niura = { git = "https://github.com/taminki/n

null 10 Jun 16, 2022
A Python CLI tool that finds all third-party packages imported into your Python project

python-third-party-imports This is a Python CLI tool built with Rust that finds all third-party packages imported into your Python project. Install Yo

Maksudul Haque 24 Feb 1, 2023
SlintDotnet is a C# bindings project to enable developers to use Slint UI with .NET C#

SlintDotnet (Alpha) Slint is a UI toolkit that supports different programming languages. SlintDotnet is the integration with .NET C#. ⚠️ This is exper

Matheus Castello 9 Oct 2, 2023
Vviz - Rapid prototyping GUI, and visual printf-style debugging for computer vision development.

vviz Rapid prototyping GUI, and visual printf-style debugging for computer vision development. Its core dependencies are egui and Miniquad. For a full

Hauke Strasdat 20 Dec 15, 2022
Easy c̵̰͠r̵̛̠ö̴̪s̶̩̒s̵̭̀-t̶̲͝h̶̯̚r̵̺͐e̷̖̽ḁ̴̍d̶̖̔ ȓ̵͙ė̶͎ḟ̴͙e̸̖͛r̶̖͗ë̶̱́ṉ̵̒ĉ̷̥e̷͚̍ s̷̹͌h̷̲̉a̵̭͋r̷̫̊ḭ̵̊n̷̬͂g̵̦̃ f̶̻̊ơ̵̜ṟ̸̈́ R̵̞̋ù̵̺s̷̖̅ţ̸͗!̸̼͋

Rust S̵̓i̸̓n̵̉ I̴n̴f̶e̸r̵n̷a̴l mutability! Howdy, friendly Rust developer! Ever had a value get m̵̯̅ð̶͊v̴̮̾ê̴̼͘d away right under your nose just when

null 294 Dec 23, 2022
Rust BOFs for Cobalt Strike

Cobalt Strike Beacon Object Files (BOFs) written in rust with rust core and alloc.

wumb0 155 Dec 26, 2022
Counter-Strike 2 Offset Dumper

cs2-dumper An external offsets/interfaces dumper for Counter-Strike 2, written in Rust. Usage You can either download the latest release from Releases

null 256 Nov 9, 2023
Collection of vision & graphics algorithms

Vision Magic Collection of vision & graphics algorithms Paper | Demo | Docs Built with ?? by The Vision Cortex Research Group Impression Impression is

Vision Cortex 40 Dec 25, 2022