sh4rkman / SquadCalc

A Minimalist Squad Mortar Calculator
https://squadcalc.app
MIT License
26 stars 2 forks source link

Vehicle pitch and roll incorporation into calculator #162

Open Ferrariic opened 1 week ago

Ferrariic commented 1 week ago

Situation: Terrain in squad is generally quite nebulous.

Problem: This limits the number of locations you can use vehicle indirect fire methods, yielding most locations to occur in fields, and open terrain, or less than optimal locations with high exposure.

Solution: Every vehicle in squad has a pitch and roll dial in the driver seat. Some vehicles have the ability to right-click to snap the viewport to center. It is possible to compensate within 0.5° to 1° degree, with a given direction, allowing for more locations to be practically used for the calculator.

Discussion:

This requires knowledge of the pitch and roll, unfortunately this requires hand calculation (pixel counting) at this time. However, adding the ability to protract the pitch and roll on the site would be beneficial to implement this.

The ability to enter in pitch and roll, and vehicle bearing, would allow for this aforementioned compensation to occur.

Example:

Below is a very rough example assuming a pitch of 5° up and a roll of +3° to the right, with vehicle bearing at 230°. Ex. The vehicle is tilted with the back down by 5°, front towards the sky by 5°, left down by 3°, and right towards the sky by 3°

The target is at 240° with a 0° pitch 0° roll degree of attack at 23.4°.

Case A: Vehicle is on flat 0°/0° terrain, fires at 23.4° and hits target.

Case B (Uncompensated): Vehicle is at +5°/+3°, fires at the dial which states 23.4°, overshoots targets.

Case C (Compensated):

Target degrees = 240°, Vehicle Direction = 230° Offset = 240° - 230° = 10° to the Right

AdjustedDegreeElevation= PitchDegrees x cos(offset) + RollDegrees x sin(offset)

5°*cos(10°) + 3°sin(10°) = 5.4°

23.4 - 5.4° = 18° Final Elevation

Vehicle at +5°/+3° fires at dial 18°, hits target.

Potential issues: Calculating the correct pitch and roll.

Request:

  1. Add vehicle protractor for pitch and roll to calculate these values. This can be done either by pixel counting, or another automated method. I will submit a PR for this if you're fine with that.

  2. Add advanced calculation tab for adjusting for vehicle pitch, roll, and bearing. This allows for the compensation required in example Case C above.

sh4rkman commented 1 week ago

I honestly never had that kind of problem because i'm always looking for flat grounds when shooting Technical/GRAD/UB/M121 and i think you should always try to get on flat ground when avaiblable since this kind of manual correcting looks dodgy and unreliable.

I'm kinda confused about pitch : every mounted weapon that i know don't care if they have positive or negative pitch, the elevation displayed in the HUD actually take vehicle pitch into account. You can use this to your advantage to hit angles you can't reach otherwise by being flat. (you can kill yourself by shooting at 90° with technical mortar, or shoot grad at high angle (45-90°) when you are normally locked into 0-45° on flat grounds)

Only problem i had in mind is roll yeah.

--

That being said, even if it's niche why not implement that into some "advanced weapon configuration" screen : we already have an advanced target information modal, we can imagine something that open aswell uppon left clicking a weapon. This will display weapon stats for nerds, and some advanced weapon configuration that some people have been asking me here and there and i couldn't a place to implement (switch from low angle to high angle for vehicles, height adjustment when a mortar is on top of a building, etc)

Here's a quick sketch of what it could be :

image

Ferrariic commented 1 week ago

That sounds good to me!