Basketball Simulator
Skip to content

Basketball Simulator

I wanted to talk a bit about a project I have been working on over the last couple of months. It’s a basketball simulation engine!

What is a basketball simulation engine?
Oh, it’s just software that can be used to simulate the events and outcomes of fake basketball games.

Why would anyone want to do that?
I don’t know—'cause it’s fun. It’s a project that requires me to further my knowledge in algorithms, data structures, data science, UI design, and artificial intelligence. What one considers fun changes a lot as you get older.

Okay, but seriously why would anyone do that?
Well, the hope is that one day it could be used for a video game, one where you could set up your own little basketball world and simulate the outcomes of that world.

Great, again, why would anyone do that?
Because it’ll be fun! Like seriously, geez. With your own little basketball world, you could simulate these potential scenarios:

What if the NBA dropped 10 teams and switched to a relegation-style league where the bottom 3 teams were forced to go to a lower-tier league and the winners of the lower-tier league got promoted (ala English soccer leagues)?

What if Derrick Rose hadn’t injured his knee on April 28, 2012?

What if you could field a team of your all-time favorite players from any era and have them play a season in any era?

Okay, yeah, this sounds like a geeky basketball thing.
Pretty much. It is pretty geeky. I’ve been playing sports simulation games since 1989 when my family got our first family computer (a Swan!). It is definitely the geekiest thing I do.


If you’re interested in following the project and want to see some of the code, it is open-source and lives at this GitHub repo: https://github.com/NateWritesCode/basketball-simulator

The core of the project is written in Typescript but also makes use of Python and R for some data gathering. Right now, there is no documentation, but I will be adding more as the project develops.

If you have any questions or comments, let me know, and thanks for reading!