Lineup records, innings caps, and scaling

I haven’t rolled out any major new changes to the ottoneu platform yet this year, because I am working on a doozy. If you go back to my post about the 2014 plan, you’ll see the first bullet point is a new stats backend. The original goal was to get this done pre-season, but this problem ended up being more complex than I expected. In this post, I am going to walk through the infrastructure as it exists today, the proposed changes, and why it ended up taking a lot longer than expected.


Currently, the system is fairly simplistic. Every 5 minutes, a script runs that checks if games have started and thus if players should be ‘locked in’ to their fantasy team’s lineup. This creates a record in a table, and this table is now the script by how stats are compiled – it contains every team’s locked-in lineup for every day in the season. As long as nothing happens to this table, stats can be re-run at any time for any reason.

Every 20 minutes, a script is run against this table to update stats for the day. This script writes a record in a stats table for every single lineup record.

Let me write that again in a bit bigger font:

This script writes a record in a stats table for every single lineup record.

This is both completely unscalable and also required if a game is going to have a hard innings cap. Consider the following scenario: it is the last day of the baseball season, and in my league I am starting Clayton Kershaw and in your league you are starting Clayton Kershaw. However, I have 1497 IP this year, and you have 1490. Kershaw spins a complete game masterpiece, and I get the first 3 innings of it because I run directly into my 1500IP cap, and you get all 9 innings. This necessitates having two records for the two Clayton Kershaws we have created – one who pitched 3 innings and then the team couldn’t take anymore innings, and the other that pitched 9. (Aside: if only it was this easy to clone Clayton Kershaw)

The solution: moving from a hard inning cap to a soft inning cap.

About innings caps

Inning caps simply define how many innings your fantasy team can collectively throw in a season. Similar to game limits for positional players, the idea is to keep all the teams in a league around the same number of innings, so that teams are not incentivized to start every single pitcher they can in order to win counting stats.

There are two ways of implementing an innings cap: hard and soft. Every major site uses soft inning caps, meaning on the day a team goes over the cap, that team will get all the innings pitched on that day but none going forward. For example, if there is a 1500 IP cap and your fantasy team has thrown 1499 innings in the season, you can start 5 starting pitchers and 5 relievers and get all their innings on that day, but once you are over the 1500 IP cap you will no longer get credit for any innings your team throws going forward. A hard cap is more restrictive – as soon as your team hits the 1500 IP cap, that is it, no more innings for you. The hard cap was originally implemented to move fantasy owners away from ‘streaming’ pitchers on the last day of the season, or playing as many pitchers as possible in order to get as many counting stats as possible. Streaming felt like gaming the system, and ottoneu doesn’t care much for gaming the system.

However, it became clear that there are existing incentives in ottoneu for not streaming: keepers and cap penalties. Cutting players in order to pick up potential starters late in the season is expensive due to cap penalties, and towards the end of the season a lot of players on an ottoneu team are either keepable or expensive but productive players that simply should not be cut. If an owner chooses to cut productive and keepable players in order to stream pitchers at the end of the season, they probably have a good reason and the system of the game should accept that.

In leagues without keepers and without cap penalties, streaming remains game-y, which is all the more reason to play ottoneu.

Tomorrow (or, soon…)

The switch to soft caps will happen over the all-star break, because there are significant database operations required to make this switch. However, I can advocate for this change with two numbers:


As of writing this post, this is how many records are in the stats_batting table.


After making this change, this is how many records are left in the stats_batting table. That’s a lot fewer records.

How does this affect you? Speed. After this change, getting updated stats will become significantly faster, meaning your standings pages will be updated faster. It will also allow ottoneu to grow its userbase considerably, which would not be possible without this change.

What’s next?

Once I get this change ready to deploy, I am going to turn entirely to the lineup page experience. I believe it can be better, and I’d love your thoughts on what a great lineup page for ottoneu looks like. Or, let me know what you think could be a huge improvement to ottoneu – I’m always open to new ideas!

Please let me know your feedback on these changes and if posts like this are interesting!

29 thoughts on “Lineup records, innings caps, and scaling”

  1. Awesome work. A couple things I’d suggest for the lineup pages:

    – Points-per-game and/or points per PA/IP column.
    – Perhaps a “Last 3” or “Last 5” set of columns that shows points for the last 3/5 games (for pitchers, maybe the last 3/5 games they appeared in/started?).

    Not sure if these are possible, but just thoughts.

  2. Something yahoo used to do, I’m guessing its pretty hard to do is to show each players overall stats and then their stats while in your lineup. Its just a fun feature to see.

    1. I would love to see this and, in fact, suggested it to Niv last season. I really want to see how often I am using my players and how my platoons are actually faring.

  3. Great update

    One issue I have with the lineups page is making a bunch of changes including one that is invalid (Too many 2B, etc.) and having to redo all my changes. It would be much easier if it either checked as I was making the changes or if the error page kept what I had done and let me correct it.

  4. J.D. is onto the good stuff. Would be great if the only roster change Ottoneu didn’t allow was the one that was invalid, instead of scrapping three or four or 10 others because you have two guys set to 1B.

    1. This is annoying to me as well, and I’ve looked into solving it a few times but obviously have not addressed this fully. I’ll take this on as my next project and hopefully can have something addressing it this weekend!

  5. I definitely agree with the above. A few things I would like to see:
    1) Add DL to the position selector, so hurt players can be sorted away from the bench players.
    2) Make sure column labels are always visible. When I scroll down far enough, I can’t see them.
    3) Maybe a column for points over the last 30 days, along with season points?

    Looking forward to the changes. Thanks for a great game.

  6. One more suggestion, stolen from other Fantasy sites: Would it be possible to show the percentage of ownership over all of Ottoneu for a player?

  7. A tool that I would LOVE to see incorporated is standings as/of a particular date. I am trying to determine whether I should start selling for next year (yes, already…it hasn’t been a good start to the season)…to see if I have made up any ground over the past say, 15 days, would be a very helpful tool.

    1. Hey Brad, thanks for the comment. I have done a terrible job of surfacing this, but you should click on the Reports tab on your league homepage and then click the Graphs link. Such an amazing tool, so amazingly hidden.

  8. I agree with Larry’s post about overall stats vs. stats while in your lineup. I don’t know how feasible it is, but I’ve been doing a lot of platooning/matchup plays, and it would be very useful to know how well that kind of thing has been working.

  9. I don’t actually find the reports all that helpful. Yes, you could use them to figure out standing on a particular date. What I’d far rather see, is points of a given timeframe. That way, I could say, “Oh look, I’ve gained 200 points on the leader in the last 30 days, maybe it is worth trading my top prospect and making a run.”

  10. Few of things I’d like to see:
    – allow me to cut a player from his player page
    – allow me to see trades a player has been involved in from his player page
    – average ottoneu salary for same league type for a player
    – make the site more mobile friendly, at least the lineup page

  11. It would be awesome to make the Lineup page more mobile friendly. I’ve definitely been running against the clock and left gem starts on my bench b/c either I made an invalid swap or my sausage fingers were too big for my phone screen.

  12. Re the Graphs link, it’s good, but if I recall it averages out performance over the course of a season, so it doesn’t necessarily show relative gains and losses. What I’d like to see is single-day relative ranks, if that makes sense.

  13. Love ottoneu but still don’t care for either arbitration system. There must be a better way to promote roster turnover. I think 3-5 yr contracts would be better. It would be more like MLB. I especially don’t care for other owners adding $1-$3 each to your players…bogus.
    When you are out of contention. You try to build a good team for next year by trading your high priced players for younger solid cheaper players. Then it all gets blow out of the water by the arb process. At least in the other system you only lose one player. There’s got to be a better way. Just sayin…

    1. I disagree. I think in real life if you were to have a good cheap player, its true normally you would be lucky for a couple of years and then have to give them a significant raise in order to keep them longterm. Just like real life if you are willing to pay a player what the market values him, generally you get to keep him. Its the same thing with ottoneu, how its set up right now. It also helps with competitive balance. The worse teams will receive less money added to their players as they are a worse team. Currently my team is rebuilding, i traded my high priced players for lower priced better players. Its true, my opponents are probably going to put a lot of money on say Gregory Polanco, but if they do that, that means less money on George Springer etc. Then it allows you to decide to keep or get rid of the player at that price. I personally think its a good way to create some player turnover, and I don’t think it should be changed.

  14. Thank you for always looking to improve an already awesome system!

    As for the lineup page, most of my suggestions have already been mentioned:
    -points/PA, or points/IP would be a helpful addition
    -15-day and 60-day DL spots for separating players
    -%own would be helpful, especially if you can sort by it in the player search

    Also, is there a mobile site in the works? On most weekends, I forget to set my lineup until I’m already out doing something, and then have to use the website on my phone, which can be a terror. But if no mobile site is the trade-off for being able to use ottoneu, then it’s worth it.
    Thanks again!

  15. It would be cool to see things about other leagues to see how your team and league stacks up to others. Particularly, a leaderboard that shows the top-scoring teams across all leagues and a ranking of league quality/competitiveness such as the one that was done in the last post here:

  16. I agree. A way to see the stats from the last few days/last week/last month/season without having to go to the fangraphs page would be a really nice feature. I also agree about the error when making roster changes. Finally, I would suggest sound effects.

  17. Lots of great ideas here, and I’m really enjoying the game. One other idea I thought might be useful would be a little notification (Yahoo does this too) next to the player’s name indicating if there’s recent news about that player. A lot of times I won’t click to check on a player (if it’s not “news-making info” that’s up on other sites) until I see they’re out of the lineup for a day or two in a row as it is.

  18. Two things:
    First, to be able to adjust the time frame of the stats you are viewing; i.e. last 5, 15, 30 days or what not.

    Second, a couple of extra stat columns that can be adjusted by the user; to keep tabs babip, iso, obp, etc. Opening a new tab and going to the player’s Fangraphs page for each player can be troublesome.

    Other than that please keep up the great work.

  19. A new message board! Please, a new message board!

    Having P/G and P/IP on the lineups page & on the FA FG page would be awesome, too.

Leave a Reply

Your email address will not be published. Required fields are marked *