Archive for the ‘rambling’ Category

Scourge, Part III – the ROPES

Sunday, January 13th, 2013

Scourge is a complex game, and programming its model involves accomplishing several tasks. Starting out, I wanted to separate the game concepts that are specific to Scourge from the concepts that form the underlying structure of a strategy board game.

So! What makes a good model for a strategy board game? By “good” I mean, “offers a representation of the system it’s modeling that best facilitates reasoning about that system”. I want views, net protocols and computer opponents to be relatively easy to map to this thing. So here’s the list of criteria that I came up with:

  1. Each player decision must be explicitly represented : rather than leaving it up to players to discover what options are available to them, the model should create options from the state that players may then evaluate, compare and choose from. This limits the role of an AI to purely strategizing, and reduces the amount of code that a player relies on to reason about a particular rule. (I could technically write a functioning AI that performs no rule-specific reasoning about its decisions, relying solely upon a coarse estimate of the board’s value. I think it makes for a good starting point!)
  2. A traversable decision tree : we can couple the aforementioned player decision generation with a rewindable history object, so that players can climb up and down the decision tree like a rock climber on a climbing wall, moving from handhold to handhold, trying to reach a goal position.
  3. Dynamic rules : there are games with many, many rules, with each one applying to a particular context. If the game is being played in a context where a rule never applies, then the game model should not represent that rule computationally– after all, it will never contribute to the available options to a player.

(more…)

Overthinking Text

Tuesday, July 27th, 2010

Remember 2008? What a great year. Especially in November, when we made history. I remember watching the ceremony on video feed with friends. People were cheering and crying.

No, wait. I mean 2007, not 2008. You know, when Adobe showed us a sneak peek of Flash Player 10, and Peter Elst’s posted video coverage gave his blog a bazillion hits as Flashmongers everywhere watched Emmy Huang spin a MovieClip in 3D. “Whoop dee doo”, you might say with hindsight-equipped eyes. It’s 2010 and all those new tricks are now old hat, right?

Not exactly. While the novelty of 2.5D and IK handles may have faded away, one of Flash Player 10’s new features– the advanced text engine– has lagged behind the rest. That’s because the text engine is very low-level, and wasn’t exposed to designers in the Flash Professional authoring environment. Until CS5 was released this past April, only developers had access to the FTE. That’s kind of ridiculous, and Adobe knew that. And so began the efforts (by many different people) to bring TextField-like usability and new text functionality to the Flash platform. (more…)

Thoughts on Apple

Thursday, April 29th, 2010

Today, Apple released something truly amazing– Steve Jobs’s personal opinion regarding the Flash platform. Like Apple’s other releases, it’s sleek, substantial, and loses much of its charm once Steve’s left the room.

Many of Steve’s criticisms are legitimate, but most of them have a valid counterargument that should be presented before the Grubers and Pogues of the world do their dance of exaltation.

Update: Apparently Steve’s triggered an impromptu Flash apologist essay writing contest. Here’s one of the more extensive responses.

(more…)

Caching timeline objects in Flash

Saturday, August 8th, 2009

Grant Skinner‘s talking about a Flash feature request that seems to make a lot of sense. It got me thinking about a problem I’ve experienced with Flash in the past, and whether it deserved anyone’s attention at Adobe. I decided that it did.

A lot of programmers new to AS3 reach a point, as I did, when they get very jumpy about their projects’ memory usage. It’s kind of a rite of passage, and during mine, I discovered that a set of animated buttons I incorporated into a GUI were spewing out gobs of display list garbage. (Display list garbage consists of DisplayObject instances, whose references to parents and children make them difficult for the garbage collector to quickly eliminate, kind of like digesting cellulose. For more on garbage collection, I’d suggest you conduct a hexosearch.)

Imagine your Flash animator friend makes you a MovieClip that represents a flashing bulb. She has probably made it go on and off by having a blank keyframe (lightbulb off) and a filled keyframe (lightbulb on) in a top layer in the Flash timeline, with the lightbulb outline in a bottom layer. Because the timeline is short, it will loop frequently, causing the bulb to flicker. (more…)

Are browser inconsistencies the “Flash killer” killer?

Thursday, July 2nd, 2009

It looks like the W3C is chucking the video codec specification out of HTML5. Audio, too. That must have been hard; a standard implementation for online media is a big deal, and it was apparently right about to happen.

Too bad that the people implementing our standards are Apple, Mozilla, Nokia and Microsoft. Inevitably these companies would start making power plays, but I didn’t expect any type of fallout this early in HTML5’s life cycle.

I don’t know much about standards or software politics– I write apps for a proprietary platform that just about everybody has– but I feel that whatever “takes out” Flash, as some people have been hoping HTML5 would, will not come from this peanut gallery of power-hungry industry giants. After all, <video> and <audio> are only two of several new “rich web” features of HTML5. Can we count on these bozos to agree on the <canvas> tag? HTML5 won’t compete with Flash if there is any discrepancy there. And what about local data storage for web apps? I doubt Nokia and Opera will agree on one implementation for that.

This bickering is only temporary, I’m sure. Markets swing, giants shift their weight and standards get worked out. But in the meantime, Flash implements all of these features in the same way across all browsers today (mostly) with very little competition, and is already delivering even richer web content that certainly won’t make it to HTML5 for at least a decade. For pete’s sake.