The Universal Draft Lottery Simulator

July 7, 2022-

Earlier today I released an update allowing the draft lottery to be customized, rather than only having a handful of preset options. You can set the number of picks to determine in the lottery, and set the odds for each team.

Previously, my draft lottery odds calculation code didn't support this kind of thing. Originally it was 3 hardcoded nested loops to handle the 3 picks in the NBA draft lottery. Then when the NBA added a 4th lottery pick, I added another conditional nested loop. At this point it was starting to get pretty ugly. Now the MLB has a 6 team lottery? I'm not doing 6 nested loops. I decided to rewrite it to support any number of picks. That made it easy to support the new custom lottery settings.

While doing that, I figured this might be a fun thing to play with on its own. So I took my lottery code and put it in a little self-contained website called the Universal Draft Lottery Simulator. Kind of silly, I know. But I bet someone will have some fun with it!

Also, it's open source.


Investigating a tricky performance bug

Some people reported performance issues in my games recently. After debugging I found that there is indeed a serious performance bug in some situations. For example, viewing the standings page and auto playing a season took 3x as long as it did a couple weeks ago. That's pretty bad!

After looking in my past commits to identify exactly when the slowdown started, I found it happened when I upgraded @rollup/plugin-commonjs from version 21 to 22. That's a package used in compiling JS for production. Annoyingly, it's only used in production mode and not in dev mode, which makes it harder for me to notice a bug like this. But for this package to cause a slowdown is strange... it feels more like something that should either work fine or completely break, not cause a performance issue. So while I could stop here, switch back to the old version, and call it a day... let's go further.

Read more...


ZenGM Baseball

June 22, 2022-

When I was a kid, I was obsessed with baseball. My dad says this dates back to watching the Mets win the 1986 World Series when I was a baby, but I don't remember that. I do remember my favorite childhood book. This was back before normal people had the Internet, and sites like baseball-reference didn't exist yet. But I had this giant book of baseball stats going back to the beginning of professional baseball. Just page after page of tables - standings, stats, playoff results, awards, etc. I would sit there reading those tables of stats without ever getting bored.

Baseball simulation games are the type of thing that a kid like me would get obsessed with. Except, they didn't exist yet. Well, they did exist even before computers as tabletop games, but I didn't know about them. The first real baseball simulation game that I heard of was Baseball Mogul back in the late 90s. It's still being updated today, you should check it out. I've talked about Baseball Mogul before as a big inspiration for Basketball GM, since as a got older I grew to like basketball more than baseball and I wanted a similar game for basketball.

And yet, baseball still exists, and there's still nothing quite like watching a good baseball game. After making football and hockey versions of Basketball GM, it's only natural to use that infrastructure for my first love, the only remaining major American sport.

So here it is: ZenGM Baseball

I've been working on this the past few months, which is why updates to the other games have been slow. Expect those updates to return to their normal pace soon.

ZenGM Baseball is definitely not perfect. But I did get a lot of help beta testing it from users on Discord, so hopefully it's at least somewhat good. As always, feedback is welcome.

Read more...


New "command palette" allows easy keyboard navigation of your league

Inspired by a really cool feature for GitHub, I just added a command palette to my games. Open it by pressing ctrl+k on a PC or cmd+k on a Mac. The command palette lets you efficiently navigate within your league while only using your keyboard. Here's what it looks like:

Read more...


New settings allow you to disable the salary cap and have more control over rookie contracts

Previously you could choose between a soft cap and a hard cap. Now you have an additional options: no salary cap.

Previously rookie contracts were based on whether you used a soft or hard cap. For a soft cap, there was a predefined rookie scale. For a hard cap, there was no predefined salary, drafted players got signed like any other players (except in ZenGM Hockey where there was a predefined rookie scale here too). Now you get some options to control this. You can set if you want a predefined rookie salary scale or not, and you get some control over what exactly that scale is.

That's the big picture summary. More details follow. First, about the salary cap:

Read more...


2021 was another great year for ZenGM

January 1, 2022-

Happy New Year!

2021 was the year of the variants. Here at ZenGM a new hockey variant escaped from our lab, and the existing basketball and football variants continued to evolve and spread throughout the population:

Read more...


A bunch of new acheivements, including rebuilds

December 30, 2021-

Omicron messed up your New Year's Eve plans? It's okay, you can stay home and try to win one of these new achievements:

Read more...


Playoff power rankings

November 15, 2021-

In Basketball GM, regular season and playoff games are a bit different. In the playoffs, the coach shortens the rotation. Stars play more, depth plays less, and everyone plays harder. This means that top-heavy teams tend to do better in the playoffs and deep teams without true superstars tend to do worse.

This presents a problem for the Power Rankings, which list ratings for every team in the league. Those ratings are regular season ratings, so they may not reflect how teams will preform in the playoffs, which can be confusing if you see teams consistently overperforming or underperforming their ratings in the playoffs and you don't know why.

Now on the Power Rankings page in version 2021.12.04.1335, there is a menu to switch between regular season and playoff ratings. Since team ratings are used in the point spread prediction formula, this means point spreads will also be more accurate in the playoffs now.

Here's an example.

Read more...


New "Season Preview" page lets you quickly see the top players/teams as well as who is getting better and who is getting worse

November 15, 2021-

Compared to other popular sports sim games like Football Manager and OOTP Baseball, the ZenGM games let you sim through many seasons a lot faster. I know some people like to take things slow and play very carefully. But on the other end of the spectrum, a lot of people sim through the season, sim through the playoffs (maybe game by game if your team made it, and maybe watching live sims of elimination games), only look at the draft prospects available around their pick, only look at the free agents that they can afford to sign, and only look at the roster of their own team.

One downside of playing like that is you lose perspective on what's happening in the league. When I added the news feed I was trying to address that, but if you play fast the news feed can sometimes just look like a whole mess of unimportant notifications.

So here's another try at helping people understand what's going on in their leagues: the new season preview page! This shows up at the beginning of each regular season, and you can access past ones at any time by going to League > History > Season Previews.

Here's what it looks like:

Read more...


No more size limit for exporting leagues

October 26, 2021-

Previously, exporting leagues only worked for small leagues. After you played a couple hundred seasons, it no longer worked unless you deleted some historical data. A similar problem existed for importing large league files, although that was probably not noticed much due to the issue with exporting.

That's why there have been no updates the past couple weeks - I have been trying to fix all these import/export issues. It's actually pretty tricky, because it requires rewriting a lot of my code and also working around missing features and bugs in various browsers. But I think I am finally happy with it, so it is now released in version 2021.10.26.0638.

As an added bonus, you can also see progress bars when importing/exporting leagues, which is nice for large leagues:

Read more...