Balancing Realism and Chaos in a Basketball Simulation Game
1/4/2025
Simulating basketball at its core seems like a straightforward task. Players have attributes—shooting, passing, defending—and these attributes drive gameplay. You build teams from groups of players, then match these teams up to play games. Easy enough, right? But wait—basketball isn’t just numbers on a stat sheet. How do you capture the natural ebb and flow of a player’s performance, the effectiveness of different players sharing the court, and make each possession feel unique? That’s where things get tricky.
Tricky isn’t even the half of it. I spend time planning new features and modes, but I spend even more time tuning the core simulation logic. This logic serves as the foundation for the entire experience, vital in supporting whatever I build on top of it. I constantly test the statistical calculations that determine what outcomes occur in a given basketball possession, with questions like:
- Are these players too dominant, in an unrealistic way? Some like Jokic or Embiid should put up big numbers, but what is the ceiling that should be established for superstar players?
- How do you make someone like Draymond Green, who may not have conventional impact in box score stats, matter in a basketball simulation game?
- Are there options (rotations, offensive/defensive adjustments) available to maximize the effectiveness of any team, regardless of how talented the roster is?
The answers to these questions unlock the full potential of a true basketball simulation experience.
Sanity Stat Check on Top Scoring Leaders in the NBA
This is a mid-season snapshot of player stats during a playthrough of Basketball Coach’s League Mode:
There are a couple of anomalies here, for sure. Where did Garrison Matthews come from? However, there are quite a few realistic names on this list, with raw numbers that are believable. At the same time, this list should never look the exact same between different playthroughs.
And now, here is a screenshot of the real-life list of scoring leaders in the 2024-25 NBA season:
Seems like we’re headed in the right direction.
This post conducts a deep dive into non-determinism (or entropy) in my basketball coaching simulation game, Basketball Coach. I’ll walk you through the challenges of adding randomness to a basketball simulation while keeping it realistic and fun. The balance between predictable stats and unpredictable outcomes isn’t just a feature—it’s the heart of what makes this game tick.
The Pain Points of Sports Simulation Games
Sports simulation games have an unspoken promise: they should feel real. But “real” in this sense is deceptively complex. You’re trying to model a live, breathing sport in code. Some common issues pop up over and over in this genre:
- Realism vs. Control
A good simulation has to feel realistic, but not so random that players feel like they have no agency. Basketball games are unpredictable, but if LeBron James is missing wide-open layups too often, the user starts to lose trust in the system. - Player-Specific Impact
Averages are great for simplicity, but they don’t reflect the unique fingerprints of individual players. You can’t just average five guys’ attributes together and call it a day. A team with Steph Curry and a team without him should feel dramatically different. - The Intangibles
Some players break traditional stat molds. Draymond Green doesn’t need to score 30 points to dominate a game. How do you translate things like basketball IQ and other intangibles into code?
These problems are central to creating a fun and fair simulation. Without addressing them, your game risks feeling too robotic—or too chaotic.
Modeling Players Beyond Stats
Basketball isn’t just about raw numbers. Some players impact the game in ways that defy traditional stat categories. Draymond Green, for instance, doesn’t need to score 30 points to dominate a game. In Basketball Coach, he’s represented as a “Defensive Playmaking Menace”—an archetype within the Secondary Star tier. This archetype captures the essence of players whose value lies in their defensive versatility and playmaking ability, even if they don’t light up the scoreboard.
Here’s how that looks in the game:
const pfSecondaryStarSkillSetArchetypes: PlayerSkillSetArchetype[] = [
{
name: "Defensive Playmaking Menace",
strengths: [PlayerSkillSet.BALANCED_DEF, PlayerSkillSet.INTERIOR_DEF, PlayerSkillSet.PASSING],
weaknesses: []
},
];
...
'Draymond Green': { playerTier: PlayerTier.SECONDARY_STAR, archetypeName: "Defensive Playmaking Menace", playerPositions: [PlayerPosition.POWER_FORWARD, PlayerPosition.CENTER] },
Draymond’s strengths are in balanced defense, interior defense, and passing. These attributes combine to give him a unique presence on the court. While he might not lead the league in scoring, his ability to make plays for others and disrupt opponents’ offenses makes him invaluable. In Basketball Coach, this plays out in a few key ways:
- Skill Set Archetypes Define Player Strengths and Weaknesses
The “Defensive Playmaking Menace” archetype emphasizes defense and playmaking, while other archetypes might focus on scoring or rebounding. This ensures that players like Draymond feel different from, say, a “Stretch Big” or a “Lob Threat Defender.” - Tier-Based Attribute Scaling
Draymond’s placement in the Secondary Star tier gives him higher attribute baselines than a role player but keeps him below the elite Superstars. Here are the base attributes for a player at his position and tier:'PF_SECONDARY_STAR': { threePoint: 40, insideShot: 55, dribblingAbility: 40, pass: 40, perimeterDef: 30, insideDef: 50, steal: 45, rebound: 30, screenAbility: 65, offenseIq: 65, defenseIq: 65, freeThrow: 75, stamina: 80 }
- Impact on Gameplay Decisions
When users build their team, a “Defensive Playmaking Menace” like Draymond can anchor a defense while enhancing team cohesion on offense. His passing skill allows him to facilitate scoring opportunities, making him a key piece in game plans that prioritize ball movement.
Why This Matters for Player Impact
By tying a player’s archetype to their on-court impact, Basketball Coach avoids the trap of reducing players to generic attributes. Draymond Green isn’t just another big man—he’s a strategic chess piece that influences both ends of the floor. The Secondary Star tier ensures he’s not overpowered, but his unique skill set makes him a game-changer in the right system.
This approach keeps the simulation engaging and realistic. Whether users want to replicate Draymond’s role or experiment with a different archetype, Basketball Coach empowers them to see how players’ unique traits shape the game.
This approach lets me simulate qualitative impact while keeping it tethered to gameplay. It’s satisfying when a user sees how a player’s presence changes their team’s success.
Introducing Tunable Entropy in Basketball Simulation
Entropy is the backbone of Basketball Coach’s simulation. Without it, games would feel too rigid and predictable. Here’s how I’ve added layers of controlled randomness:
- Stamina Management
Players lose effectiveness as they get tired. This encourages realistic substitutions and bench usage. - Offensive Consistency Rolls
No player makes every shot. Offensive consistency rolls ensure that randomness doesn’t overshadow skill but still introduces enough variability to feel authentic. - Simulation Constants
I frequently use constants likeBLOCK_BUFFER
orINSIDE_SHOOTING_FOUL_MINIMUM
allow for the fine-tuning of outcomes like blocks or shooting fools:const BLOCK_BUFFER = 10; // Adjusts likelihood of blocks.
const isBlocked = offensiveRoll + BLOCK_BUFFER < defensiveRoll;
- Defensive Entropy
Defensive decisions—like which player rotates to defend in a scrambling scenario—are randomized within constraints:const defenderChoice = weightedRandom(defenderChoices, [1, rimProtectorValue, entropyValue]);
The goal is to let entropy enhance the experience, not hijack it. Every possession feels dynamic, but you can still spot schematic patterns if you pay attention.
The Balance of Control and Chaos
Introducing randomness isn’t just a coding challenge—it’s a design philosophy. Too much chaos, and players lose trust in the system. Too little, and the game feels flat. Here’s how Basketball Coach finds that balance:
- Transparent Outcomes
Logs explain every possession in detail, so players understand why something happened. - Team Identity
Players can see how different strategies and player combinations affect performance, adding depth to the simulation. - Iterative Tuning
Constants and formulas are regularly adjusted based on feedback to keep the game fun and fair.
Closing Thoughts
Entropy is what makes Basketball Coach feel alive. It’s the reason why underdogs win sometimes and why stars occasionally miss clutch shots. Balancing this randomness with realism has been one of the toughest challenges in building the game—but it’s also been the most rewarding.
Whether you’re playing as a defensive mastermind or an offensive genius, the beauty of basketball lies in its unpredictability. Basketball Coach tries to honor that. Check it out at Basketball Coach, and let me know what you think.