Sunday, August 8, 2010

Thinking out the program

Just taking some notes for myself on how to build out this choice interface from here out. This is still rough terminology.

First, each decision node has to be its own class; a decision node, or decNode, is comprised simply of two or more choices.

A choice is one of those choices, and each one contains a variable stating what the next decNode is.

FirstChoice, SecondChoice, ThirdChoice, and FourthChoice are the names of each choice under the decNodes, and each one also contains a variable called decY, which is different for each one of these. Using purely hypothetical numbers, FirstChoice.decY would be +10, SecondChoice.decY would be +5, ThirdChoice.decY would be -5, and FourthChoice.decY would be -10. This all relates specifically to how the decision tree chart will fill itself in. Each Choice and each decNode has a "name" variable for labeling purposes. Each decNode, of course, has the text corresponding to its narrative passage, and each Choice has text corresponding to what exactly the choice is.

Specifically: the chart starts at the first decision, moves forward by an "X" coordinate value with each decision, then moves up or down by the "Y" value contained in each choice's decY value, then creates the node referenced in the NextNode variable under each choice. Repeat for every node until we reach a decNode that has a boolean that says "LastChoice=true." We now have somewhat of a system that allows us to draw the chart procedurally, moving from one decNode containing multiple choices to another. We have one parser that automatically does this, alleviating me from having to sit down in Flash and draw the entire chart and reference its coordinates by hand, and we have a second parser that saves the user's decisions thus far in an array--with the array saving not the names of the choices but the decY variable for each one--and then traces through each one of those until the current decision node.

In the main program:
currentNode is the player's current choice node.

is the array containing the decY variables of all the player's previous choices, which the second parser uses to draw out their path.

op1, op2, op3, op4 are all corresponding to four buttons in the main program, namely the ones for the choices. They automatically fill themselves with currentNode.FirstChoice.text, and their event listeners reference functions that immediately substitute currentNode with currentNode.FirstChoice.nextNode. Their functions also parse through the prevNodes array until they count to the end of it, then add 1 to the last position and stick in currentNode.FirstChoice.decY at that position into the array.

The chart will draw itself, but it'll look sloppy as branches will end up crossing with one another and nodes will end up overlapping visually. It would go +5 for one decision, then for the next one go -5 and run straight into the +5 node for the next one, which isn't what we want to have happen right now. At least we have the basic logic for getting these charts to work, but we'll have to find a better way to get the nodes to diverge visually.

Prototype in Progress: Choose Wisely

Figured I may as well update on the state of my prototype. Right now it's DEAD simple. Just one choice, simple interface, STUPIDLY simple choice. Do you take the crappy cup (the real Holy Grail) or do you take the gold cup (fake Holy Grail)?

Click here to see the full-sized image

My plan right now is a little crude as I'm just exploring what all has to happen for there to A: be a tree of multiple choices with this interface and B: be a bubble diagram of all the narrative choices available that will dynamically color itself to indicate the path the user has taken thus far. It's less challenging than I thought it would be, which makes me feel really stupid for taking so long to get started with this.

Displaying text dynamically and making the buttons work is the dead-easy part. Right now I'm grappling with how to make the bubble diagram view work; AS3's not been cooperating with me too well on that score as I've got the chart on a different frame of the timeline and it keeps erasing things. I'll probably need to find a different solution to get around Flash's errors. I'll need to make the main variables global, for one, which involves a really loony workaround by turning them all into a package but makes them all accessible everywhere, and I'll have a lot of stuff to do with arrays and dynamic instantiations, which I'm a little out-of-practice with. The big pain in the butt as this thing scopes upwards is that I'll have to figure out the coordinates of each node in the bubble diagram--which means a lot of clicking back-and-forth between the code window and the stage--and record them in such a way that the code can access it. I keep thinking there's got to be a better way to get this thing to procedurally build the diagram. If I make "choice" into a class of its own I should be able to do that in some way, but first thing's first--let's get this thing generating that chart...

Saturday, August 7, 2010

Additional Pylons: More Starcraft 2

Took the time to get a little bit farther in Starcraft 2 between work on my screenwriting class and attempting to program. Finally came up to a REAL choice, displayed below.

Baby, you can construct additional pylons with ME any day, heh heh heh... .... what does that even mean?
Note: Right-click and use "View Image" to see the full-sized screenshot.

Up until now I've just been taking and leaving missions, and no, the choice I mentioned in my last post didn't matter--I ended up doing both missions. Most of the time the player has a choice between multiple missions, with each featuring a brief outline of the job to be done, a number of protoss or zerg research points, a cash reward, and a new unit the player earns by doing the mission.

In sheer gameplay terms that is a ton and a half of stuff for players to think about when they choose missions. All stuff earned heretofore carries over to subsequent missions, so it's important to build a formidable arsenal by taking jobs tha are profitable. At the same time, every completed mission unlocks more missions, and the storyline thus far has presented me with a few ongoing goals: fight the Terran Dominion and protect Terran colonists from the ever-growing Zerg onslaught. Forgetting any moral ramifications surrounding these goals, I feel obligated to pursue missions that directly pursue them simply because they have been presented to me rather subversively as the possible means of winning the game. To do that, I need help, which means doing side missions and getting the allegiance of other characters and parties, which means I'll be framing the missions I take in the context of who I need to please.

The choice presented above is one of the bigger ones. I've taken a mission to investigate a colony that's been blacked out. I've been helping these colonists for a while. It turns out they've been infected by the Zerg, which means they'll turn into a pack of mutants any day. The good doctor on the left is their advocate; I picked her up on my crew when I saved them. She's working on a cure for the infestation, which is incredibly unlikely. The protoss lady on the right just wants to fry the colonists, purging the infection before it begins. Either one is a reasonable solution to the problem within the context of Starcraft; I've seen infested colonists before and I know they're huge trouble and that Zerg in general need to be eradicated when possible; but I'm also a humanitarian who wants to believe they can be saved--especially since I've been spending several missions babysitting them and I don't want that investment to go to waste.

However, time's a-wasting and I can only side with one of these two. If I side with the doctor I have to protect the colonists from the Protoss attack while she works on the cure; the Protoss, long-time allies from the past game's continuity, will be angry wtih me for taking so many of their lives. If I side with the Protoss I have to clean the infestation out myself. The doctor will be pissed, and I'll still have to work with her in the future. Either way I get some research: whether the doctor's successful or not she'll unlock a bunch of Zerg research, and likewise the Protoss will happily provide me with some of their knowledge and tech for further upgrades if I side with them.

There's a lot at stake here and a lot of context built up to help frame this decision. I'll need to spend a bit more time picking it apart under my rubric, but first thing's first--I've got some work to do on this program.

Thursday, August 5, 2010

Goals for the next few days and also the adventures of Jon Arbuckle in Sad Land

Present work: Building a prototype app in flash to display a narrative choice architecture. I'll be using the Choose Your Own Adventure book "Space and Beyond" as a placeholder for original content. By Monday I want a prototype working.

Present research: Hamlet on the Holodeck, Starcraft 2: Wings of Liberty, Heavy Rain.

Still waiting for Hamlet on the Holodeck to arrive from Amazon--with my luck it'll turn up Monday, if at all--but it should provide some kind of perspective on interactive narrative, which is a body of research I'm lacking in right now. I've got a few more gaming textbooks on the way also, all of which comprised basic reading for other SCAD students but none of which I've ever laid eyes on.

Heavy Rain... time to indulge in the adventures of Jon Arbuckle in Sad Land. I've found a Let's Play that actually does a good overview of the different kinds of decisions you can make, but it's only gone about as far as I have--which isn't far enough to show the ramifications of the branching paths... Meaning it's time to bite down and spend a couple of evenings playing it. Right away I can tell that it's not really a game about choice and personalization so much as a game about success and failure. It's more like they wanted to test how much players wanted to get into the story than that they wanted to provide room for personalization.

Poor Mr. Arbuckle. So sad that Garfield shipped his son off to Abu Dabi.

There's still a sense of personalization to it in that everything that the player interacts with skews their interpretation of the characters; for instance, on one hand Ethan can be a responsible, loving dad, on the other he can be a broken-down, tormented, and cowardly drunk. The events don't change, but who and what he is ends up falling on the player. Otherwise the branching element comes down to mostly success or failure on specific tasks. There's probably a lot more to it than that, which is why I've got to play it far enough to see that branching element at work, but that's the impression I have so far.

Meanwhile I also have to play Starcraft 2, which purportedly ALSO features a narrative decision system. I dove in and I'm actually surprised at the level of detail they put into the narrative so far. For ONCE these characters don't feel like they're just blips on my radar. Mainly the decisions boil down to which missions you take and which ones you don't take. I've only hit the third mission, which presents such a choice, and I have yet to see if you give up one to take the other at this stage, but I'm aware that this DOES happen and that the magnitude of decisions escalates quite a bit.

Evacuate the colonists, or help an old friend...

The decision I've got: nab a priceless artifact for a bunch of black marketeers, gaining hundreds of thousands of credits in the process, or help a colony evacuate from a zerg invasion, gaining hundreds of thousands of credits--but a few thousand less--in the process. Each one gives me a different heavy unit--some generic heavy infantry unit called a Marauder or the classic Firebat, an anti-infantry flamethrower trooper; thus a gameplay incentive behind the decisions is attached as well. Additionally I've got a buddy character named Tychis with me who has a deal with the guys I'm selling the artifacts to. Already I'm feeling a lot of weight behind this choice as Tychis purportedly saved my ass in Starcraft 1/Brood War and he's already helped me gain a lot of ingame resources, but at the same time in fulfilling the identity of main character Jim Raynor I feel an obligation to help the colonists; plus I'm left wondering which of these two units I want more. It's legitimately a dilemma as I have no idea what consequences there will be, if any, further down the line. I've got a rebellion to organize and zerg to squish... choices. It SEEMS like a good reflection of the practical philosophy behind WDL--IE practical decisions over moral decisions--but we'll see how far Blizzard took it.

Monday, August 2, 2010

A Proposed Architecture

In my exploration of viable prototypes I've developed something of a proposed architecture for a narrative choice system; I'm still looking for the right narrative, but at least I've got the mechanics in mind. The architecture is called "WDL," or Win-Draw-Lose.
WDL follows a structure wherein the player is given a choice of different events to take part in within an ongoing story. Whichever one they choose, they must deal with the consequences of the other events moving forward without them. Antagonists and other parties involved in the story's events pursue their goals regardless of what the player decides to do. One way or another, each choice offers a logical decision that conceivably advance's one or more of the player's goals, if not necessarily the overall goal of defeating the antagonist. A few nodes into the story, however, that overall goal will reach its expiration date and the player will be forced to confront it.

Depending on what decisions they've made, what long-term threats and short-term threats they've neutralized, what support they've gotten from third parties, et cetera, players will encounter one of three entirely different end scenarios, approaching this ovearching goal from different perspectives. On one hand, the "lose" scenario, wherein the antagonist has gotten a major foothold and will probably get away with whatever plan is being carried out; the player is left, at best, to take care of damage control and insure that the situation is at least not a total catastrophe. On another, the "draw" scenario, where the player and the antagonist have fought one another to a standstill. On another still, the "win" scenario wherein the antagonist is all but fully thwarted and the player gains some major advantage.

To put what kind of outcomes are possible here into perspective: a "win" would mean that Indiana Jones gets away from Cairo with both the Arc of the Covenant and Marion Ravenwood safely, which means that Indy will simply have to defend them. A "lose" means the Nazis get it and have Marion prisoner, which means Indy will be forced to go after them one way or another--and as long as Marion is within their grasp they know exactly where to expect him to show up. A "draw" means the Nazis got the Arc, but not Marion, which means Indy has more of an element of surprise and more options as the story continues.

As should be implied by this only partial coverage of a "Raiders of the Lost Arc" scenario, the WDL format isn't applied to an entire game but rather pieces of it; it branches across one level at a time rather than throughout an entire game, giving each level one of three different endings rather than trying to apply a colossal branching structure to every possible event in the game. This gives a strong sense of variety without overloading the production. In an ideal situation the levels are episodic and self-contained, and the player is exploring the same story no matter what way the game branches.

Sunday, August 1, 2010

Shadow the Hedgehog Revisited

I've already said a lot about Shadow the Hedgheog and given my two cents on the whole thing, but I think it would be best to give it the rubric treatment. To give a quick rundown of the rules again, we're working off five categories: Narrative Integrity, Gameplay Integrity, Discernability, Personalization, and Supporting Factors from reviews and articles. The game starts with 0 points in all of these and either gains points for good things that support and enrich the game or loses points for bad things that take away from the game. The technical execution of the game itself isn't being taken into account here so much as the narrative choice system's impact on it.

Narrative Integrity

Story makes no sense except with respect to a fistful of specific paths. Character development and plot flow are very inconsistent (-2). Scenarios between different levels may not be relevant to one another, undermining any sense of dramatic tension until the very last stages; tension is undermined further with consecutive playthroughs as the player realizes that the grid is completely arbitrary in its arrangement (-1). The story is only completed when every level has been played and the "real" ending scenario is unlocked, completely undermining all the other "fake" endings from the main game and any sense that any of those events actually mattered (-1). At the very least the narrative choice system reinforces the game's themes surrounding Shadow's internal struggle (+1), giving players the chance to explore it for themselves.

Final Score: -3. Shadow's Narrative Choice system actively harms its narrative.

Gameplay Integrity

Choices affect which levels the player visits and are made by selecting one of three potential goals for completing each level. These goals are not consistent between levels, however, and can range from "kill all enemies of one type" to "find all the switches and activate them." Many of these goals can change what would be a straightforward five-minute level to a frustrating twenty-minute scavenger hunt in a looping stage for that one tiny bat the player didn't kill, making the game's overall pacing very inconsistent (-1) and possibly discouraging the player from making particular narrative choices that they ordinarily would want to make based on the relative difficulty of the goals presented (-1).

Final Score: -2. The narrative choice system in Shadow the Hedgehog offers players the choice of either having gameplay impose decisions on them or of having their decisions impose heavily on the pacing of the game.


Player's choices essentially don't matter as the same ending scenario can be accessed through multiple, completely different paths. If the player goes evil for one level, then goes completely good, that one evil choice will more or less be completely forgotten, without so much as a minor manifestation of consequences (-1), meaning that an hour into the game players will completely forget their choice as well. There's absolutely no sense that the other characters are acting on this story or reacting to the player's input in any way (-1); if the player helps the aliens in one level, Sonic won't care three levels down the line as choosing to help him still has to be an option, and vice-versa.

Because levels aren't necessarily in a logical progression, characters and entire plots may in fact disappear, creating confusion as to the player's preferences but not necessarily ambiguity (-1), as they can be nursing a friendship with a specific character or faction only to have it suddenly be gone for an entire level with no further reference. The recency effect takes hold as players are more likely to make choices based on what they've seen in the last cutscene and how they interpret the identity that's been built for them up until now (+1), but this is extremely tenuous.

Final score: -3. Shadow the Hedgehog is so married to a specific scheme of choice that it completely disallows the manifestation of consequences, and the lack of logic to the game's narrative progression actively harms its discernability.


Players don't necessarily get the sense that they're building Shadow's identity so much as choosing paths. Shadow makes the real decisions entirely on his own depending on what levels the player moves through, leading to arbitrary conclusions that players wouldn't necessarily draw on their own (-1). Relationships with other characters are nonexistent as they do not respond to Shadow's choices (-1). Enemies of one faction or another will attack Shadow whether he's helping them or not, and there are no rewards or penalties from either side or any of the ancillary characters one way or another.

As said before, the progression of stages/cutscenes does influence the way the player perceives Shadow (+1), which can influence their own choices and make them feel like they're doing something, and the game does build a new narrative for each playthrough (+1), even if it doesn't make sense. However, as cited in the Narrative Integrity section, there is a canonical "real" ending that the player unlocks from completing all the different paths available in the game, completely undermining any sense that the player's participation matters in this story (-1).

Final score: -1. Players make choices that affect the outcome of the game, just not in any logical fashion.

Supporting Factors

Metascore for the PS2 version of the game: 45 (-2).

Most reviews cite that the choice system is a neat addition, but poorly executed due to lack of response in-game; IE, opponents from either side will always attack Shadow whether he's helped them or not (-1).

Final score: -3.

Average Score

-2.4 -- Shadow features an extremely harmful narrative choice system, owing most of its problems to a lack of discernability and a highly inconsistent narrative.