• This Forum is for adults 18 years of age or over. By continuing to use this Forum you are confirming that you are 18 or older. No content shall be viewed by any person under 18 in California.

Browser-Based 3D F-Class Game

I’ve been tinkering with this for the last week and figured I’d post it.
It’s a browser-based F-Class simulator built on top of my WebAssembly ballistics engine. Still very much a work in progress, but it’s playable — you can actually read the wind, watch the flags and mirage, and shoot full matches.


What it does:
The physics run in real time through the WASM solver — gravity, wind drift, time of flight, and all the usual stuff are calculated live for every shot.
The wind comes from a continuous Perlin-noise field, so it shifts and gusts smoothly instead of jumping around.
The flags pull from that same field and animate with angle, flap, and direction changes, so you can use them for wind calls.
There’s also a mirage effect in both scopes that bends and shimmers with the wind; you can read it the same way you would on the line.
Targets go through a full pit cycle — lower, mark, raise — with spotter discs and score markers before coming back up.


Match format:
3 relays, 20 minutes each, 20 record shots per relay
Relay 1: unlimited sighters
Relays 2–3: up to 2 sighters each
“Go For Record” ends sighters early
Relay ends when time expires or after 20 record shots


There’s a HUD in the top-right that shows time, relay, sighters, score, X-count, and shot stats.
After each relay, a dialog pops up before the next one starts.
The scorecard shows every shot with per-relay totals.


Controls:
Spotting scope (bottom-left): W A S D to pan • E / Q to zoom
Rifle scope (bottom-right): Arrow keys to aim (0.1 MOA increments) • + / – to zoom
Fire: Spacebar
Buttons: Start • Restart • Scorecard • Go For Record


Audio and extras:
Wind noise scales with the actual wind speed at the firing line, and there’s a bit of background range noise so it doesn’t feel dead quiet.
You can add ?debug=1 to the URL for a short test mode (3-minute relays, 3 record shots, wind overlay).
Runs best on desktop — mobile and tablets won’t work yet.


Still calling it beta. I’ll probably tweak it more.
If you want to mess around with it:
https://www.ballisticstoolkit.com/fclass-sim/fclass-sim.html


GitHub repo:
https://github.com/chasep255/BallisticsToolkit


1761438435457.png
 
Last edited:
This is awesome! I had an old F-class game that let you pick your rifle components, do load development, and shoot matches. I forget what it’s called but it was awesome.

This game looks fun!
 
This is awesome! I had an old F-class game that let you pick your rifle components, do load development, and shoot matches. I forget what it’s called but it was awesome.

This game looks fun!
When I get around to it I was thinking of doing something like having a virtual match where everyone can compete with the same wind conditions (same seed so EXACT same conditions) and maintain a leader-board.
 
i've had a blast playing this since you posted on reddit. i really like how you don't have to change anything to start playing but can tweak as desired. great job and well done!
 
i've had a blast playing this since you posted on reddit. i really like how you don't have to change anything to start playing but can tweak as desired. great job and well done!
Thanks I think it is in a mostly done state now. I might look at modeling crosswind jump. Maybe add some factors where your groups drift a bit as the barrel heats. I need to clean up my Javascript mess a bit too. Thinking next I might try to do a PRS shooting Sim. Will need to build a more complex landscape and model target bullet interactions.
 
I've also been trying it out and for the most part it's actually really good as are the other tabs such as the wind simulator becuase it shows you what the wind is really doing the whole length of the range.

My only frustration is once you get up to moderate winds the holds become crazy because you can't dial any wind on the scope. So you're holding between target boards. Not saying that it doesn't happen in real life but without subtensions on the reticle it's lost any training capability because you're just kind of
guessing.

Long term, having flags on both sides to show crosswind travel times and such would be amazing too.

Gripes aside, amazing work.
 
Last edited:
I've also been trying it out and for the most part it's actually really good as are the other tabs such as the wind simulator becuase it shows you what the wind is really doing the whole length of the range.

My only frustration is once you get up to moderate winds the holds become crazy because you can't dial any wind on the scope. So you're holding between target boards. Not saying that it doesn't happen in real life but without subtensions on the reticle it's lost any training capability because you're just kind of guessing.

Gripes aside, amazing work.
So not sure when you last played it, but I dialed the wind back quite a bit (Friday night, I think). The wind simulator is mainly a debugging tool for me to visualize the wind field I’m generating. If you think the wind could use more tuning, let me know.

I’m also interested in feedback on how realistic the mirage effect and wind flags feel compared to real life. Right now, the flags hit 90° at around a 10 mph wind — I originally had them tuned for 20 mph, but they were harder to read at that setting.

The mirage is generated as a post-processing effect on the rendered scope views. It shifts color channels slightly using simplex noise, with the noise field drifting based on sampled crosswinds along the scope’s line of sight. I weight the sampling more heavily toward distant points, so the effect mainly reflects what’s happening near the target. The resulting field is integrated over time to produce the horizontal shimmer.

At lower wind speeds, the mirage “boils” more vertically from convection; as wind picks up, it transitions into horizontal flow and the vertical shimmer diminishes.
 
I've also been trying it out and for the most part it's actually really good as are the other tabs such as the wind simulator becuase it shows you what the wind is really doing the whole length of the range.

My only frustration is once you get up to moderate winds the holds become crazy because you can't dial any wind on the scope. So you're holding between target boards. Not saying that it doesn't happen in real life but without subtensions on the reticle it's lost any training capability because you're just kind of
guessing.

Long term, having flags on both sides to show crosswind travel times and such would be amazing too.

Gripes aside, amazing work.
I can also add subtensions to the reticle and the ability to dial. Maybe have it so when you hold shit and press the arrow keys you are dialing rather than holding or something.

Would you want 1 moa tick marks added? First or second focal plane? Guess they won't really be 1moa if I go second.
 
I can also add subtensions to the reticle and the ability to dial. Maybe have it so when you hold shit and press the arrow keys you are dialing rather than holding or something.

Would you want 1 moa tick marks added? First or second focal plane? Guess they won't really be 1moa if I go second.
I'm not the best at GUI but my gut would say just a dial on the side that use another set of keys to adjust like R & F or something to dial left or right.

As for the reticle, way too many to many everybody happy but maybe keep it simple like this
1761520008487.png
 
I can do an FFP retical like this pretty easily. Adding number to it are actually bit trickier. I will add the ability to dial the scope later this week. Let me know if you think the wind presets still need adjusting.

1761524046031.png
 
Sure. you will get get scored a zero. Actually if the shot is off the target frame it still gets marked floating in space.
Probably tough to do but the crossfire aspect only really comes into play when your model doesn't return to perfect battery. Maybe based on the cartridge or just randomly it could 'bounce' your reticle to the neighboring target just to keep people awake??
 
Probably tough to do but the crossfire aspect only really comes into play when your model doesn't return to perfect battery. Maybe based on the cartridge or just randomly it could 'bounce' your reticle to the neighboring target just to keep people awake??
Yeah I didn't add a recoil animation because the trace looks really cool. Although in real a real life match you probably wouldn't be able to see it. I could add a bunch of random effects. Like have you pull the shot sometimes, make the barrel walk as it heats. Drop the MV for the first clean bore shot.
 
Pushed a few requested changes this morning.
  • Added a scope reticle with 1 MOA minor and 2 MOA major hash marks
  • Added configurable SFP/FFP mode for the scope
  • Added elevation and windage dialing (hold Ctrl while using the arrow keys)
  • Press R to reset the scope to its initial state
I’m thinking of adding a bit of random error to the rifle’s initial zero. Right now it starts perfectly centered (assuming no wind), but it might be more realistic to have a small zero offset—just like a real rifle before sight-in.

Another idea is to simulate barrel heating and drift based on rate of fire. If anyone has good real-world numbers for how much a barrel tends to move (in MOA and direction) over the course of a match, I’d love to hear it.

Someone also suggested adding wind flags on both sides of the range. That’s easy enough to do, though the right-side flags might be blocked by the rifle-scope overlay—that’s actually why the spotting scope is smaller. At the moment, though, it wouldn’t add much since the wind model only varies by time and downrange distance, not cross-range or altitude. To make that meaningful, I’d need a more advanced wind model—probably something with advection and localized updrafts tied to the terrain. The current system uses multiple layers of Perlin noise at different spatial and temporal frequencies, but I might go deeper into the fluid-dynamics rabbit hole later on.

I’ve only tested this on 1080p and 1440p desktop setups with fairly strong GPUs. If you run into any performance or display issues, please PM me. Feedback on new features or calibration tweaks is always welcome.
 
Pushed out some more changes. I now have a 2D spatial wind model using multi-octave curl noise with per-component advection, where larger-scale patterns transport smaller-scale features. I also added wind flags to the far side of the range for better visualization. The wind simulator has been updated with improved visualization tools and preset controls to help you explore different wind patterns. Please let me know what you think.
 

Upgrades & Donations

This Forum's expenses are primarily paid by member contributions. You can upgrade your Forum membership in seconds. Gold and Silver members get unlimited FREE classifieds for one year. Gold members can upload custom avatars.


Click Upgrade Membership Button ABOVE to get Gold or Silver Status.

You can also donate any amount, large or small, with the button below. Include your Forum Name in the PayPal Notes field.


To DONATE by CHECK, or make a recurring donation, CLICK HERE to learn how.

Forum statistics

Threads
167,639
Messages
2,236,514
Members
80,611
Latest member
CMFG
Back
Top