Monday, March 31, 2014

Gridiron Solitaire #99: Penalties

I've noticed that I get a little anxious whenever I temporarily "disassemble" the game. I don't like ever having less than a fully playable game (maybe because it took me years to get it playable in the first place). Somehow, unplayable--even for only a few days--seems dangerous.

Fortunately, though, my high anxiety period is mostly over, because GS is fully playable again, and it's much improved. Better run/pass balance for the human player, which gives the game a flow much more like real football. Dynamic, big images for important game events (with more on the way, thanks to Fredrik).

Oh, and Penalty cards! I never thought I'd be able to include penalties without slowing the game down. They're an important part of football, but I'm not adding anything that slows down the game--it has to be in the 15-20 minute range, no more. People need to be able to sit down with the idea of playing several games, not just one. Pace has always been a very high priority.

A suggestion was made in the Steam forums a few weeks ago, and in significantly misunderstanding the original idea, I accidentally stumbled onto a solution (that's how about 90% of my good ideas happen).

First, I give you the penalty card:


Here's how it basically works. A penalty card is added to the deck. That means there are 54 cards in the deck--the standard 52, plus a wild card and a penalty card. If the penalty card is dealt, it blocks a card stack unless it's matched with a wild card.

That's a simple mechanic (seriously, why didn't I think of it before?), but it adds an important element of real football to the game. It's not exactly like a real penalty, which has several discrete elements (the flag, the end of play announcement, the decision to accept or decline the penalty, the replaying of a down in many cases), but it captures the essence of a penalty, which is to reduce the offending team's success on that play. Generally, that's what happens.

Just adding a card to the deck, though, is not very satisfying. Generally, good teams are penalized less than bad ones (one of the reasons they're good). Plus, teams that are poor at one particular thing are usually penalized more often in that one area. As a random element, penalty cards are "nice", but there needed to be more.

The tricky thing about making this more complicated, though, was that in making it more ratings-dependent, it would be easy to go overboard. Bad teams can't get penalized all the time, and good teams still have to get penalized. I needed to find a way to keep penalties in some kind of NFL range, so bad teams would see them more often, but the number of penalty cards in a game would have a real-life distribution over time.

There are three ways cards can get dealt: on the initial deal for a play, as replacements for matched cards, and after the Big Play button is pressed. Originally, I added a ratings influence to the Big Play press. If the card to be dealt was the penalty card, I did a ratings check for the play type, then set a probability that the card should be skipped based on that rating.

This worked, but the frequency of penalty cards was way, way too high. The probabilities of a standard card deck guaranteed that. I needed more than one level of control. What I needed was a blunt instrument on the front end, and a finer tool on the back end (hmm, that somehow sounds kind of threatening). I needed a macro level of control and a micro level of control.

Here's what I eventually worked out. When I shuffle the cards prior to dealing them, I check to see if the penalty card is in the first eight positions. If it is, I do a check against a universal probability number to see if the card should be repositioned in the deck. If so, it gets randomly switched with any other card in the deck. That doesn't guarantee it won't be in the first eight positions, but it will be about 85% of the time.

This is the macro level of control, because the probability I set up front controls the total number of penalty cards very well. It's not ratings-specific, so this is the blunt instrument.

What provides the NFL distribution is the code attached to using the Big Play button. That's how I wind up with different penalty frequencies based on team ratings. So when you use the Big Play button, your team's rating for that play type have a significant influence on whether a penalty card gets dealt.

It's not entirely in correspondence to the NFL distribution, because I don't think anyone wants to see 10 penalty cards in a game (high end of the NFL), but there's enough ratings-based variation that it has verisimilitude.

Next week, I hope to have additional "big images" for you to see. Right now, they're being used on kickoffs and player touchdowns. The structure is in place to easily add them, so I'm going to use them as often as possible.



Site Meter