Feb 25 2010

Portability Primer – Sticking to basic principles helps

I had a very interesting discussion yesterday. I want to summarize it below.

There is a fresh new group of developers who want to start making games. They have quite a decent (but various) programming experiences with different platforms, different project types and scale. All outside gaming of course. During my discussion I heard two very interesting questions, I’ve tried to answer then and will answer also here.

1) Which platform choose for casual indie games.

2) What if we choose wrong platform, how about portability?

Questions seem to be academic and I have a feeling, that I answered quite academically. As for first problem, I asked more questions to better understand it. I was curious what games is that group aiming at and for what audience in specific.

Answers I’ve heard were not clear which I understood as the group is rather looking for certain ideas, than have a complete vision of a certain title. Sounds like a pitfall, right? In further discussion we agreed that first goal is rather to better understand technologies and possibilities potential platforms can offer.

Fair enough. Knowing what you can do and binding it together with some assessment on who usually has such a platform and what games that player expects can help to work on realistic ideas and innovations that have better chance to work. It is good to know though, that it’s not real game development. Rather a technological training, which later can help to better discuss differences and potential on platforms like Facebook, iPhone, XBLA, XNA, PSN and Steam, just to mention a few different examples.

Answering to the second question: what if we choose wrong platform, how about portability?

In this case I believe that sticking to basic programming principles can help. Most programming platforms have for sure one thing in common -> objects and object oriented mechanisms. Syntax may vary and language specific elements can trick out porting efforts. Avoiding them should be part of that best practice, I think. Having objects on mind, in front I’d design abstraction layer with objects that share common elements. Any specific platform just should expose it in its implementation.

Simplified example: If I want to develop 2d sprite based scroller shooter, I need objects like screen that supports pixel-by-pixel redrawing, sprites, some routines for clipping, collision detection for sure. Those should have interfaces which are platform independent as much as possible. Then adding DX, GDI, Silverlight with WriteableBitmap, Xna support or whatever technology should become a task bound to platform but not breaking game features themselves.

This approach is implemented in Unity and Unreal Engine too.. what we see there is a common interface (even including WYSIWYG editors) and platform related implementation that we don’t care much designing game at its basic level.

Sounds very much obvious, yet question like this is really fantastic, because it reveals inexperienced developers or developers who have been bound to a single technology stack for long, if not forever. No big deal, good moment to start learning as many different technologies and languages as possible to push the perceptional horizon further.

From these obvious truths in answer, I suggested to these guys a task, challenge for the team of five as I heard.

I suggested them to develop some short game which isn’t time-consuming as for development. Let’s say it’s Tetris.

In this challenge each team member has to pick a technology and/or platform, different to the rest. When everybody finishes, then each developer should take somebodies else code and port it with the thought and structure of the original concept to another platform&technology.  Take C# or Flash port of Quake (originally in C) as good example of similar task.

When everybody finishes group should meet and discuss what was the biggest pain and if somebody failed, why?
Conclusions taken from that final discussion should help them to avoid practices that are potentially dangerous in such migration.

Interesting porting paths (to and back), I can recommend are:

  • Direct3d to OpenGL
  • Xna to DirectX
  • WPF Xaml+C# to Direct2D based 2d vector graphics and sprites
  • From HTML5+Canvas+Javascript to Silverlight and WritableBitmap

Even with Tetris complexity, above examples should be good to reveal some bad habits.


Feb 23 2010

Dreams in Digital

Dreams have powerful impact on many things from our real life to mediums we used to play with as entertainment. From psychological drama to mindful refresh and relax, lucid stories while dreaming, we barely remember them in the morning. That terrible loss and potential hidden meanings were inspiring philosophers, psychologists and entertainers for many years, if not centuries.

Books, movies and games go into dreamworld occasionally and as in first two examples its mostly another art form hard to perform well and so easy to ignore in games I perceive the biggest power of dreams for interactive usage.

I’m not the first one who observed that, in fact I have found many interesting examples of dreams in games already developed, mostly in two scenarios:

SPLITTING WORLDS: DREAMS AIN’T REAL

Dreams by its nature are perfect to give hints and formulate breaks between acts with some important summary and new points in plot yet not revealed fully to give us a reason to stay and ask questions when awaken. In this example role-playing games seemed to be perfect to put dreams in game as specific cut scene in most cases rather to read than watch. Take a look at good&old Baldur’s Gate where without any interaction we were given some clues about the story going forward:

Not so impressive even those times of its origin. Main reason: dreams in BG were only a summary of current achievements. Told well by an intriguing voice of narrator, but completely non-interactive and without any mystery dreams should have.

It’s little bit better in quite a new (comparing to BG) Lost Odyssey, but still has the same flaws even though presentation, including visuals and sound effects, is really well balanced:

In Lost Odyssey, through dreams, we can try to discover some hidden memories from the past. Stories are really well written, but confusing not valuable for the main story at all.  After a couple of dreams, I stopped reading them because of schizophrenic lack of useful content. In jRPG I really respect my gaming time. Dreams in their formula inspired me personally only to dwell for new techniques how to present text on screen (as a programmer).

Role-playing games have no monopoly for dreams and fuzzy memories presented in quite a somnolent way. Action games also presented them in many examples. Take Max Payne and its comic book heritage.

max_payne_comic

Different approach but still passive, unfortunately. Action game like above is really good to show much more interactive usage.

LIVING THE DREAM THAT HAS COME TRUE

How about utilizing dreams not to cut scenes or acts and summarize something with blurred memories and reality hardly real? From previous examples and Max Payne as a bridge take a look at Darkness. Main character is dead, undead, not dead, hard to say. Monsters helping him, all strange things bound to the story and especially alternative worlds in different time and dimensions. That’s all what we could easily call dreams, not an idyllic one. Darkness has them, one of the reasons I love to come back to this game:

Game mood like from famous The Crow movie, but with much more dark magic and horror – dreamworld in Darkness is closer to terrors of Lovecraft’s prose than sissy stories full of banality told us literally in Baldur’s Gate and Lost Odyssey.

Writing so, I may sound ignorant, no point in that. Dreams may vary from joyful sex dreams through, “I don’t need to wake up” and “I won a lottery” relaxations, to “My grandma visited me and warned me” and “I died in accident” or “Somebody killed me”. These different settings and atmosphere of dreams can be used in games, but by its interactive nature it’s much easier to expose fear, drama, regret and other not so clear and positive feelings for which as players we rather like to dwell deeper and ask more questions than stay and relax doing nothing. Sometimes as in the best up to date Call of Cthulhu game, we not only didn’t want to wake up, we hadn’t wanted to fall asleep first place. (WARNING FOR BELOW MOVIE: IF YOU DIDN”T FINISH THE GAME, IT HAS OBVIOUS SPOILERS, WATCHING IS SPOILER FREE UNTIL 1:40)

Great escapes full of drama and not possible in real world I found also in one of my favorite games – Fahrenheit (Project Indigo in US). This game and interactive storytelling offer it has, is one of the best usage of dramatic dreamworld as a game-play medium.

All these examples show, that for this medium visuals and music have to get married fast and furious. I’m waiting for tomorrow’s launch date of Heavy Rain. I presume I’ll have more examples from Quantic Dreams, who named themselves perfectly for this article.

But narration shown in Fahrenheit and Heavy Rain with atmosphere where music, visuals and story come together is not Quantic Dream’s invention. They put a lot of innovation in their games for sure, still I find their precursor from mid 90-ties. I mean game called Dream Web. Take a look at intro where setting is already established:

All above examples remind me only one last thing – my dream. I wish to see more games with interactive dreams blended into game-play. I’m also glad for games that have already showed these dreams coming true.


Feb 19 2010

What makes Pixel Junk Shooter so great?

I really enjoy my time spent on playing Pixel Junk Shooter. I haven’t finished it yet, currently I’m in 3rd stage. I’d beaten two interesting bosses and got addicted to the game mechanics. From developer perspective, meantime, I started asking myself a question: What makes this game so great?

I found this game by reading various reviews and watching movie clips like that one above. First thing I noticed, was how well game mechanics and visuals are connected. Literally it’s just a scroller shooter, but much of its spirit is made by fantastic 2d fluid simulation presented visually in very attractive way.

If you’re a programmer interested in further investigation, take a look at below movie, it shows similar concept:

Above clip shows an application developed by Microsoft MVP Rene Schulte. Rene published .NET Framework sources on his personal pages. He’s programmed basic example of technology that can inspire for Pixel Junk Shooter alike physics in games. The only technical problem left to do, is that in PJS you have different fluids interacting between each other (liquid fire, lava, water, oil, etc). Skill to master by a smart coder, I believe.

Aside of fluids, I can’t stop thinking on Pixel Junk Shooter without connecting it to old Amiga games. Sometimes it’s really abstract but it triggers my imagination for potential sequels.

For example, shooting part of game’s mechanics remind me Cannon Fodder. I dream to play Cannon Fodder with two analogs. It should be so much better and PJ’s Shooter shows that well. In Cannon Fodder though, encounters were more dynamic and not so much was to rescue:

Some of game’s mechanics remind me old games from Psygnosis (currently and for long SCE Studios Liverpool).  Take strange combination of Lemmings or maybe rather Benefactor, put it together into a scroller shooter action game with puzzles strictly related to fluid physics. If you take a look at this game this way you immediately start dreaming on more Lemmings/Benefactor alike features. I did, I believe that many ideas should fit well into Pixel Junk Shooter. Imagine situation that little folk you have to rescue moves, and moves in very stupid/uncontrolled way. Imagine situation that you’re bound into a conflict between two sides and rescue good and leave bad guys. Imagine situation, that even though there are two bands of miners who fight/compete for something, you have to rescue both groups before deadly lava will kill them all.

Maybe some of that mechanics will appear in further levels. I’m not sure now, as currently I’m fascinated with maxing up results on these first 15 levels. I’m pretty sure though, that this game will surprise me even more. If not, then it’s definitely worth further experimenting and development.

I’m really glad this game showed up. It proves well my theory of evolutionary design.  I’m expecting good sequels and clones of that concept in near future. It’s rather obvious that games where mechanics are strictly bound to physics seem to be 100% success warranty. I can’t recall any example where it was not.


Feb 11 2010

Story-driven design: Way of a Hero

I’m a believer, that each story should have well defined structure. There are many ways to build it, method depends on dimension we want to bring details for. Analyzing and mapping that well defined structure on actual stories, movies and games can help to comprehend it better and use it while building your own storyline.

Hero-centric approach

Many stories are driven by a central persona – a main character. To have that story truly epic, a hero is chosen. Hero who takes a journey first to discover his heroic abilities in a mundane world, then using those skills and with heroic faith mentioned character goes forward to make the world better, rescue the princess and so on, THE END.

There is no better way to structure hero’s journey than using method discovered and named so by Joseph Campbell. In his book “Hero with a Thousand Faces” he defined a theory of so called monomyth. Under this monomyth’s umbrella Campbell described the same or at least very similar structure of many myths coming from different parts of the world and different cultures. Centric part of that theory is that hero, person who sometimes accidentally finds himself on a journey from a mundane life to and epic end.

Hero’s Journey has three big phases: Departure, Initiation and Return. Before Departure starts our hero just like in Fable (games), Frodo in Lords of the Rings (book and movie) has his mundane life, he’d just got used to have. Then first motif appears on the horizon which Campbell named “Call to Adventure“. It’s nothing but the signs of the vocation of the hero. Some may be just built by curiosity, some by personal drama, some just happened and still not much is visible both to the character and the audience watching it on the screen, reading a book or simply playing the game. During next step, a “Refusal of the Call“, our character quickly realizes, that it’s not what he wished to have. Folly of the flight from the god is often described in many stories as great wish to come back to the life before adventure started.  Frodo in LOTR had that moment when he wanted to give One Ring to Gandalf. Sometimes it’s just an refusal to agree on an heroic status already given, like modest behavior of Aragorn who didn’t want to discuss his rights to the throne for long. Neo in Matrix also wanted to come back to the “unreal” world shortly after awakening. Manifestations of that refusal may vary as you see. Next step in this theory is a “Supernatural Aid“. Sometimes it’s not literally supernatural, but for sure unexpected assistance that comes to one who has undertaken his proper adventure. “Crossing of the First Threshold” is the first obstacle, a guardian, hero has to “defeat” to enter the realm of magnified power. When he succeeds, he passes the gate to the magical world and he starts believing in his heroic ability. This phase is called “Belly of the Whale“. For Neo in Matrix, that guardian is represented by Morpheus in the martial art combat they performed. Neo entered the passage when he’d started learning all possible fighting techniques with fascination described by single yet powerful sentence “Hit me!”. Funny, the same thing Keanu Reeves said in Johny Mnemonic when his hardrived-head was loaded. Frodo found his guardian in the forest while Orcs had attacked his fellows. Boromir was the the guy who helped Frodo to find his passage. Crossing the river is that magical moment.

Anyway, after crossing the passage, Departure ends and Initiation starts. First moments are hard, our hero is on “The Road of Trials“. Those trials are dangerous aspects gods have put on the road. Neo had to learn how to jump from one building to another. Frodo had to find his way from swamps and other dangerous areas directly to Mordor itself. Moments during trials are really tough. It’s easy to start disbelieving even if hero thought he is the One. To reconstruct, even indirectly his heroic faith “The Meeting With the Goddess” is necessary. Oracle in Matrix made the moment providing more questions than answers to Neo. Frodo met Faramir and during those moments when he helped to save Gollum’s life he encountered that phase. Joseph Campbell, giving analogies to our myths, described it as mythical marriage with the Queen Goddess of the World. That’s why I dare to say, that the Goddess and Campbellian marriage in LOTR is between Frodo and Gollum. When Gollum was “fishing”, Frodo realized truly how strong the bound between them was. Next step called “Woman and the Temptress” Joseph Campbell described as the realization and agony of Oedipus. This is the moment when hero’s life is fully controlled by his Goddess wife. It’s a trap. In Oedipus’ myth, mother and wife concept is blurred. While trapped and in agony hero starts looking for a father, a brother. Helpful hand which Frodo found in Sam, but first he was betrayed by Gollum and almost killed by big spider, Shelob. That moment, reunion, is called “Atonement with the Father” in Campbell’s taxonomy. “Apotheosis” is natural after step. To describe it at the best I’d like to quote Campbell: “Like Buddha himself, this godlike being is a pattern of the divine state to which the human hero attains who has gone beyond the last terrors of ignorance”. If that father, brother or god himself is the true partner, a necessary ingredient hero needs to become the Chosen One, during apotheosis these last “terrors of ignorance”, masks of the world are gone. Neo in Matrix had found that partner  in Morpheus when he rescued him from Agents. Frodo found that partner in Sam. Good thing to train imagination is that in these two examples, different roles were physically suffering. In Matrix Morpheus was on high, interrogated by Agents and hero rescued him. In LOTR hero was deadly trapped and in scenes full of drama he was rescued by his partner. It shows very well that this generic concept works very well even though you as a writer will like to go with different details. “The Ultimate Boon” is a lovely moment that ends Initiation. The ease with which the adventure is here accomplished signifies that the hero is a superior man, a born king. That’s very much visible in The Matrix.

Even so end of initiation looks like end of the story (a happy end indeed), we still have one more part to tell. It is called a Return. With such heroic impact on everything and big success just achieved hero refuses again. “Refusal of the Return” is like avoiding bullets in Matrix. Neo didn’t need a phone call anymore to escape, there was no need to come back to the real world to refresh, reload or get additional aid even though Frodo was still in the middle of Mordor crowded by villains. In fact true refusal of the return in LOTR was when Frodo hesitated to drop the ring to the Mountain of Doom. Responsibility is refused. “Magic Flight” is the moment when hero triumphs and wins blessing of the goddess and is explicitly commissioned to return to the world with some elixir of restoration of the society. The final stage of his adventure is supported by all the powers of his supernatural patron. After that hero may have to be brought back from his supernatural adventure by assistance from without. “Rescue from without” it is called. Birds did it in LOTR rescuing Frodo from certain death on the top of the Mountain of Doom. “Crossing of the Return Threshold” is coming back from the magical world of heroic ability to the mundane world from the beginning. Hero has to accept it to become “Master of Two Worlds” and experience “Freedom to Live“. Realization of inevitable guilt of life as Campbell described may so sicken the heart that Frodo decided to leave world he’d known. Cycle ends and new adventure may just appear on the horizon or not, helping to build the sequel or forget about the creation.

Studying Joseph’s Campbell monomyth’s theory is really fantastic adventure itself. Reading his analogies in many myths from our history is amazing. Mapping this structure on books, movies and games may be really enlightening. Building your own storyline and being aware of the journey is a benefit worth considering.

Many writers and game creators base their plots on that theory. They don’t need to declare it, it’s obvious and visible. Many have modified the original concept and theory has evolved.

One of the variations strictly based on analyzing movies is  Nine Acts Structure invented by David Siegel. In past years it was published on-line, but original dsiegel.com pages are long gone. I found good reference  in Internet Archives. Modifications David Siegel made mainly focus on setting two goals. It gives an illusion of nonlinear plot. Steps (or acts) David Siegel described are outlined below.

Nine Acts Structure with two goals (D. Siegel)
Act 0: Someone Toils Late into the Night.
Act 1: Start with an image.
Act 2: Something bad happens.
Act 3: Meet the Hero (and the Opposition).
Act 4: Commitment.
Act 5: Go for the wrong goal.
Act 6: The reversal.
Act 7: Go for the new goal.
Act 8: Wrap it up.

As you can see many aspects are similar, some aggregated but the clue is, that somewhere in middle of way hero realizes that he wanted to achieve wrong goal. That’s the culmination point and then he finds true goal which opens second part of the story.

Conclusions

I encourage you to carefully take a look at these steps and their different variations (Internet search on Hero’s Journey can bring even more references). I have given you some snapshot analysis of Matrix and LOTR. Try with other movies like Avatar for example. Try with games too. Try to build your own story based on this structure, it’s real joy.

In this article I mixed my interpretations with some real quotes from the book, Joseph Campbell wrote. I recommend to get it and read it. My thoughts are based on the 3rd edition published by New World Library in 2008. It should be easy to buy it.