Level Scripting in Max Payne

What follows is an outline of a level from start to finish. Most of the work (including the write-up) took a day, but I’m still fine tuning it.  While I’m using MaxED, the Max Payne level editor, the basic ideas and approach are quite general and will work in any action-adventure game focused around melee combat.

Level name: Defence Training

Overview: Simple encounter against an increasing number of enemies in a martial arts dojo, with a catch – 1 hit kills the player.

Design Purpose: This optional challenge map is designed to encourage players to practise fighting defensively against multiple melee attackers.  The individual enemies are easy to defeat, but unlike the main game, one hit kills the player.  Inspired by the principal of Darwinian Difficulty and Hotline Miami, as well as the challenge maps in the Batman Arkham games, my reasoning is that allowing players to practise in an extreme (but fair) scenario should help them refine their fighting ability to the point where regular encounters in the story mode are trivial.

In particular, this level is designed to raise the player’s awareness of actions/moves which have invincibility frames – both defensive sidesteps, twists, and rolls, and special attacks. Controlling the positioning and movement during a fight is also encouraged (i.e. don’t get backed into a corner).

While called ‘defence’ training, there is a strong emphasis on interception — those who wait for their attacker to hit them; dodge or guard the hit; and then counter; risk getting hit (especially when attacked from all sides by multiple attackers). Player should quickly realise that survival relies on a balance between defence and offence; as well as range, timing, movement, prioritisation; and positioning. In other words – hit attackers before they have the chance to attack you; move defensively to avoid being swarmed; position yourself so that you can attack without being hit; time your attacks, so that you are not left vulnerable; prioritise which adversaries to take down first.

Lastly, efficient use of Bullet Time is encouraged to slow down time to concentrate on defensive movement and attack.

An additional purpose is to expose any flaws or bugs in the combat system. Testing under the hardest difficulty possible should highlight problems with difficulty, fairness, balance and flow (unexpected, random deaths; hitbox tuning; damage per move).

Design approach: I’m reusing the Dojo level for speed and simplicity – it’s a small-medium sized arena, suitable for combat with a small number of enemies (guessing 13 – 21 before it gets crowded/laggy).

The fight is broken down into several encounters, focusing around an enemy type; and each encounter will be broken down into 5 waves. Each wave will throw an increasing number of enemies at the player, in accordance with the Fibonacci sequence (1,2,3,5,8,13…). First encounter will start off with very slow and easy enemies; then we will introduce faster and tougher enemies; enemies with weapons (possibly including firearms); and finally mixed sets of enemy types. Between encounters might be a bonus/challenge wave.

Example:

Encounter 1

  1. 1 White dragon enemy, hostile when approached, very slow and weak
  2. 2 enemies
  3. 3 enemies
  4. 5 enemies
  5. 8 enemies

Encounter 2 – Same as 1, but with Yellow Dragon, an enemy which sprints at the player.

Encounter 3 – Mixed white and yellow; introduce red dragon (tank) 1. 1 red 2. 1 yellow, 2 white 3. 2 yellow, 3 white 4. 3 yellow, 5 white 5. 1 red, 3 white, 2 yellow?

For the sake of keeping things simple, I’m just going to focus on the first encounter.

Implementation

Encounter1

Fig. 1

Encounter 1 looks like this. Blue spheres are the actual NPCs, green spheres are the custom FSM scripts I use to control them. Note the first guy is missing because he starts in the level itself.  To preserve name-spacing, I should have placed him here and teleported him into the playing area when the level starts, but I don’t think this level is big enough to warrant that level of discipline.

An annoying facet of Max Payne level design is that NPCs cannot be spawned into a level, like they can in Unreal, for example. This means you have to frontload all of the enemies you want to use, and usually hide them in a room off the level somewhere. In many ways, this is actually a good thing because it forces design and coding discipline — you can’t afford to spawn hundreds of guys in a room (which is problematic design anyway), because it results in a huge scripting overhead. In levels where I want a lot of guys on screen, it’s a good idea to constrain yourself to the Fibonacci sequence, and organise encounters into waves to keep things sane, and to control pacing.

Another approach is to simply re-use NPC assets. You can see above that the maximum number of white dragon enemies the player will ever encounter in this level is 8. Hypothetically, it makes sense to simply load 8 of these guys, and simply respawn them on each wave (respawn meaning to resurrect to full health and then teleport to the desired location). I would do this, but honestly NPC necromancy can be problematic in Max Payne — especially with more complicated scripts. Usually it works, but sometimes it results in the enemies doing strange and unpredictable things when they respawn like standing in a dazed trance, playing an incorrect animation, or dying immediately on spawn. It also makes counting kills in waves much more complicated than it needs to be, because you have to work out a way for the level to know exactly which wave this enemy belongs to at any given time. Finally, re-using enemies results in bodies disappearing during combat. The absolute worst thing is for an NPC’s body to suddenly vanish moments after you just KO’d him.

I mentioned custom FSMs earlier – those are the green spheres. I had hoped that this level would be simple enough not to require individual FSMs per enemy, but the nature of the wave system requires me to count each time an enemy dies, so that the next wave is started when all enemies are dead. A quirk of our mod is that it’s possible to ‘kill’ NPCs multiple times, during what we call a ‘juggle’ combo. One frame before the player’s punch or kick lands, we spawn a ‘juggle’ area projectile which heals the NPC briefly (dealing -0.01 damage), which resurrects knocked out ‘dead’ enemies just in time for the kick to KO them again. This allows the player to ‘juggle’ defeated enemies, and perform stylish combos to finish them, which is both intrinsically satisfying and serves a gameplay purpose — you gain health back for juggling enemies.

An individual FSM is therefore required to count the first (and only the first) time the player ‘kills’ an enemy, otherwise juggle hits are counted, and the whole script breaks down. It’s for this specific reason that variants on the Kung Fu mod (including Katana) break the level scripts in vanilla Max Payne — especially the Jack Lupino fight in Ragnarock. The original Max Payne levels are not scripted to take into account juggle combos, and therefore scripted events can be triggered prematurely. This is why you have to be careful resurrecting NPCs.

Fortunately, this is fairly simple to implement in MaxED. NPCs have two primary states – Alive (default) and Dead. When the enemy is killed for the first time, they switch to the dead state, and a message is sent to the Wave script to increase the kill count by +1. If they’re killed again (by juggling), it doesn’t count because no further messages are sent to the wave script while the enemy is in the ‘dead’ state.

states

messages

In the story levels, regular melee enemies have between 3- 8 states (called ‘lives’ to distinguish them from HP), which allows them to get back up after being knocked down. This system originated from Max Payne: Katana, where I wanted to simulate combat by having enemies block a certain number of attacks before being defeated. Each enemy had a pre-set number of ‘lives’ and tougher enemies, such as bosses could withstand as many as 20+ hits before dying.

You make this system more interesting by having enemies regenerate lives over time, forcing the player to focus their attacks on a single enemy; or by layering this system with others (bosses in TRW have a regenerating ‘guard’ or shield which has to be ‘broken’ first before you can do permanent damage).  The exact implementation in TRW is much more complicated, because we wanted the enemies to do more interesting things, like get off the ground if they get knocked over, and allow the player to kick them into walls, or punt them across the floor like in the film; but I’ll save that for another post.

Even on modern systems, Max Payne can grind the framerate down if you’re sloppy, so it’s generally a good idea to remove NPC bodies at regular intervals — especially if you’re scripting an arena type level. For this map, enemies are removed every other wave to reduce the likelihood of the player noticing them disappearing.  In my experience, most people are too focused on fighting off adversaries to notice downed enemies being removed.  For best results, create a timer for every enemy and randomise the time between dying and removing the body, but that requires considerable overhead.

Zoning

Although the Dojo level is fairly small, it’s good design practise to divide your levels up into modules, or zones, and track where the player is. This allows you to control stress and tension by spawning enemies intelligently, relative to the player’s location.

As the Dojo is a square shaped arena, this is straightforward – I simply divide the level into thirds horizontally and vertically, giving me 9 zones. I could have divided into four quadrants, which is simpler, but offers limited tracking – especially if the player stays in the centre of the ring. With 9 zones, no matter where the player is, I can easily surround and envelop them by spawning enemies in the adjacent zones. 9 zones is also convenient because, if you remember, the maximum number of enemies I want to spawn (for now) is 8. So if I wanted to, I could spawn one enemy in each zone, leaving one space for the player. As you can see, working with the golden ratio naturally leads to more elegant designs.

Zones

For this to be manageable, the naming scheme for the zones has to be straightforward and meaningful; so I’ve gone with Centre, North, South, East, West, NE, NW, SE, SW.

This is fairly straightforward to implement in MaxED – you have a tracking FSM called Zoning with your 9 states (North, East, South,…). You then create 9 player collision triggers evenly spaced across the map to cover each zone, and on the activation of each trigger, you simply switch the state of zoning to whichever trigger was activated. So if the player activates the trigger ‘North’ the state of zoning switches to North. Although this is fairly simple, I recommend printing a direct message to the HUD to display which zone you’re in for initial testing — you don’t want to go to the effort of creating a complicated zoning system, if the actual tracking isn’t working correctly.

Another consideration is the fact that in MaxED triggers are spherical, which means that there will be some gaps between triggers. You can fix this by nudging the corner triggers (NE, NW, SE, SW) towards the centre a bit, or by simply increasing their radius slightly, along with the central trigger.

Zoning implementation

Fig. 5 An FSM tracks where the player is in the level, so we can spawn enemies in smart locations.

As for the actual waypoints used for spawning the enemies, originally I thought about using 3 per zone. However, this leads to a total of 27 waypoints, which is far too many. In the end, I settled for a total of 16.  That leaves me with 3 in the centre, 2 in each corner, and 1 for every point of the compass. This means I can spawn as many as 18 enemies at once, if I wanted to (which I don’t, as my budget is 8 npcs)

The final step is to write the code to actually spawn enemies. For every wave, there are nine possible zones where the player could be, so it’s a case of working out where the best location to spawn enemies is (i.e. the adjacent zones).  So that means there are 45 possibilities in total.

This might sound like a lot of unnecessary work for simply spawning enemies in, but in practise it doesn’t take that long to implement, and (aside from the challenge of building it) I think the results are definitely worth it. It’s also fairly scalable – assuming we don’t increase the number of enemies on-screen from 8, most of the work can be duplicated for additional encounters with minor modifications to the scripts.

Now we have a good foundation for this level.  It might not be apparent in the video, but the zoning system allows for a fairly natural ‘feel’ to the encounter – enemies spawn close to the action, not randomly; and the waypoints and timing can be tweaked to adjust stress, tension and flow.  Although basic enemies work well for this specific level (remember 1-hit kills, so anything complicated will overwhelm the player), were this an encounter in a ‘proper’ level, the next logical step would be to increase variety, by adding enemies of different class and role, as explained in this excellent and authoritative article on the topic. At any rate, this level is now the perfect template for testing all manner of encounters.

The ‘Small and Agile’ approach – A retrospective

I’ve finally gotten around to posting my honours work /dissertation for my final year at the University of Abertay Dundee, for my degree in Game Production Management.  It comprises of a dissertation proposal, the dissertation itself, and supporting project work which serves as a worked example of some of the concepts proposed in the dissertation body.  It was published in May 2008.

  1. Part 1: Proposal (The problem for Independent Game Developers)
  2. Part 2: Dissertation (Survival of the fittest – Investigating the survival strategies of “Small and Agile” game studios)
  3. Part 3: Honours project (Game Development Plan and Reflective Log)

Some five years have passed since I wrote this work, and back then the prospects for indie game developers looked quite bleak.  Since then, the games industry has changed dramatically — Angry Birds demonstrated the huge potential for small developers in the mobile apps market; the rise and fall of Zynga highlighted the potential and risks of Facebook as a games platform; Humble bundle, Good Old Games, and even Xbox Live emerged as reliable digital distribution channels for independent developers; crowdfunded projects on Kickstarter took off in a big way, resulting in the world’s first crowdfunded indie games console the Ouya.  Oh, and Minecraft happened. :)

At present, I feel confident that independent games development is thriving in a very positive, if unexpected way.  Yet, many of the problems and challenges surrounding Next Gen / AAA development reported in my original proposal are still present.  With the latest round of next gen consoles – the PS4, Xbox One, and Wii U – the costs of games development for the home consumer is unlikely to go down any time soon.  The business model, as far as I’m aware, is still broken, with regards the developer royalties. In particular, the use of Metacritic scores as another way to control and limit how much a studio earns is particularly troubling.

There are still development horror stories — L.A Noire was a critical and commercial success, but plagued by a protracted development schedule (7 years) and controversy surrounding poor working conditions.  In spite of the game’s success, the developer, Team Bondi, was shut down after failing to secure another game project.  What’s more revealing is the recent downfall of middle tier publishers such as THQ, and the closure of several notable development studios (e.g. Psygnosis), throwing doubt into the previous convictions that being acquired by a major publisher would offer financial security and was a viable end-game for any independent developer.  The Radar Group, which I had high hopes for, seemingly disappeared after 3D Realms ran into financial difficulties, and at the time of writing, no one else seems to have taken the concept of a production studio on board.  To be fair, why would they?  Having another middleman to share royalties with is unappealing to both publishers and developers, even if it does reduce overall project risk.

If asked on my views of the games industry today, I’d refer to Dickens and say it was the best of times, it was the worst of times.  Better games are being made, and there’s good reason to be hopeful.  Yet, there’s still much to criticise and past mistakes aren’t being learnt from (for instance, sexism in games / production is still a prevalent issue).

In closing, Scott Miller, who I used to admire quite greatly and referenced heavily in the above work, once posted the question “Who’s left who can design their own game?”  Back then, the answer was very few.  Today, it seems like there are plenty of opportunities for anyone with a clear vision, and the skill and talent to see it through.  Time will tell if the kickstarter bubble bursts, but for now at least, it seems like an exciting time to be developing games, and I’m looking forward to seeing how these projects develop.

Story telling in games

This is something that’s been on my mind for a while now.  Story telling, recounting experiences – both real and made up – is something quite fundamental to human culture.  We tell stories to entertain people, to teach them, to inspire and challenge people.  Much day-to-day conversation falls into the pattern of listening to what people have to say, and retelling stories from your own life.  Even when we are asleep, a good portion of our brain is devoted to making up stories in the form of dreams – wild and fantastical.  Most organised religions are founded on stories from the past.

Like any art form, I see games as a medium for creating and telling stories.  For example, when you look at traditional pen-and-paper RPGs, they largely boil down to a group of friends making up stories. The game just gives them a framework for telling the story.

Gameplay, as a craft and discipline often gets overshadowed by the story and presentation; and yet I think gameplay design is at its most effective when it can facilitate story creation. Sure the vocabulary of the theatre and film transfers directly to games in terms of cast, set, props, and so on; but the best games create worlds, for which multiple stories and adventures can take place in (I’m thinking along the lines of Elder Scrolls, Minecraft, Journey, and probably MMOs like Warcraft as well).

Look at the new X-Com game that came out last year — there’s a game that has a very basic premise (aliens are abducting people, you must stop them!); but basically gives you a blank canvas to craft your own stories. As a game it plays like a modern version of chess (or more directly, warhammer 40k), with both you and the computer taking turns to move pieces, and the winner is the one that captures all the other pieces, or meets their objective. The genius of X-Com, as a video game, is that it lets you name your pieces, and customise their appearance and voice — it lets you turn them into characters. In doing so, players can reframe the events of the game, as a story. Every mission is just one episode in a bigger, personalised narrative, starring a cast entirely of your own creation. It’s compelling because you don’t have full control over the plot and you don’t know what’s going to happen next — characters can die, and the plot can twist in unexpected ways.  In RPG terms, there’s a games master (or story teller) in place to ensure dramatic conflict and uncertainty, whilst still allowing the player to own the story.

For me, that’s where I think story telling and games should go. Anyone can write a story, and then craft a game around it (yo). That’s fine, but I don’t think it’s using the video games medium to its fullest. Granted, you can personalise the story by adding branching plotlines, as with Mass Effect, but you’re still constrained by things like character arcs, audience expectations (Mass Effect 3 ending anyone?), consistency, and practical logistics.  Writing a good story is hard enough — writing a branching story makes things exponentially complex.

There’s always going to be a place for big, cinematic story games (nothing beats a well written, well told story); but I believe that games that allow players to make up their own stories are the way forward as an artistic medium.  I think that’s why games like Journey left such an impression — without a predefined story and no way to verbally communicate with other players, it forces the player to come up with their own personal interpretation of the journey they experience.  They can then recount that experience to others.   I think that’s also why Minecraft has become so popular — it’s simple to play, but has almost infinite potential for making up stories and games.

However, my growing concern is that we’re going to see a regression — instead of games, I think we’re going to see more “interactive experiences”.  Big budget, summer blockbuster entertainment titles, that you don’t play or explore, so much as participate in.  Modern incarnations of Dragon’s Lair (which is beautifully animated, but not really fun).   Again, on the scale of art and entertainment, there’s place for these titles to sit, but I think it would be a great shame if those are the games that get the most funding in the future.

Human’s are natural story tellers.  Our entire civilization is founded on our natural ability to recount events and characters from the past, and imagine and foresee events and consequences that might happen in the future.  As a game designer, I think we can make more meaningful, more impactful games by tapping into this natural instinct of interpreting and reinterpreting events as stories.  Instead of spoon-feeding people hollywood-esque drivel that would make even Dan Brown cringe; we can give people the tools and settings they need to create their own worlds and realise their own stories.  That’s something only games can do.

Custom Last.fm stations

With RQL and Combo.fm

Some of the most frequent questions and complaints we get at Last.fm include:

  • “I’ve added hundreds or thousands of artists to my library, but it doesn’t play them.”
  • “Is there any way to filter my music by a tag or genre?”
  • “Can I ban artists from my stations?”

Fortunately, there is a way.  Read on.

Radio Query Language (RQL) lets you combine Last.fm stations (artists, users, tags) and allows you to filter them with basic logical operators (or, and, not).

For example, if I want to filter my library radio to only play jazz, I can do this with the RQL string:

library:Maddieman and tag:"jazz"

If I want to exclude ‘Lady Gaga’ from ‘Pop’ tag radio:

tag:"pop" not simart:"lady gaga"

If I want to combine two unrelated stations:

tag:"classical" or tag:"electronic"

It’s perhaps easier to illustrate these as diagrams (click any image to launch the station):

Intersection between My Music Library and the tag ‘Jazz‘.

Exclusion – Pop tag radio, but not artists similar to Lady Gaga

Union between Classical and Electronic tag radio.

If you want, you can make more complicated stations, such as “1980s, Rock, Female Vocalists“, which hopefully will give music like Blondie and The Pretenders.  In practise though, this station didn’t give me the results I wanted (use the 80s tag at your own risk), so this one required a slight adjustment:

tag:"80s" and tag:"rock" and tag:"female vocalists" not tag:"pop" not tag:"hair metal"

However, be forewarned that overly complicated queries are unlikely to work. If you just want to listen to a very limited range of artists, you’re probably better off just creating a Spotify playlist.

Combo.fm

That’s all fine and good, but how do you actually create your own stations? Fortunately one of our moderators, tburny, created a very nice user interface for RQL, called Combo.fm.  It might not win any awards for web design, but it allows you to quickly and easily create custom radio stations.


On the left hand side, you pick the stations you want to include (from personal stations, artists, users, and tags). In the middle of the page you can edit the query and adjust the operators (or, and, not). On the right hand column you can launch your custom station, and you can also tweak the mainstream/obscurity of the artists played, as well as the repetition rates.

As a reminder:

  • Or = Union of two or more stations, gives you everything.
    • e.g. Pop OR Rock will play artists tagged as either pop or rock.
  • And = Intersection of two or more stations, used to filter a station by tag.
    • e.g. Pop AND Rock only plays music tagged as both Pop and rock.
  • Not = Excludes content from your stations, used to ban artists and tags.
    • e.g. Pop NOT Justin Bieber plays artists tagged as pop, but not those similar to Justin Bieber.

Discovery Mode is an advanced feature that attempts to play only music you haven’t listened to yet.  It effectively treats your scrobbles as banned tracks.  However, due to a quirk in its design, it doesn’t work with your standard Library radio by default, so simply selecting ‘Discovery mode’ won’t make any noticeable difference to your station.  In order to activate it, you need to include a dummy tag as well, for example:

library:Maddieman not tag:"pornogrind" opt:discovery|true

None of the music in my library is tagged with “pornogrind”, so nothing is actually excluded; all this does is enable Discovery Mode to launch, and play me music from my library that I haven’t listened to yet.

That’s basically all there is to it. I tend to use it mostly for filtering my library or recommendations radio by a particular tag (e.g. french + female vocalists). It also works well with friends and neighbours radio, and for setting up multi-user stations (good for parties, etc). Give it a go, and see what you can come up with!

Further Reading:

Finishing touches…

I’ve been somewhat restless this year…  looking at my wordpress dashboard, I have no less than 19 posts sitting in the ‘draft’ queue.  There’s so much more I want to write about, and yet it seems like these days I can only get two thirds of an article written before I run out of energy or inclination.  I guess a 45 hour week will do that to you.

I’ve been studying game systems and the art boss design with intense interest this year.

One of the limitations of making turning Max Payne into a fighting/adventure game has been that fights always come across a little underwhelming.  All of the characters are regular bipeds, and they share the same movements due to the enormous amount of time and effort animation takes up.  It takes a lot of work to prevent these fights from getting repetitive.  Even in the regular Max Payne games (1 and 2), the weakest aspects are the boss fights because they either boil down to basic shootouts, or elaborate stage puzzles.

This week I realised that the reason the boss fight I was designing fell flat is because there’s no payoff for actually beating the bad guy.  In Katana, when you defeat The Big Bad – your reward is crude but satisfying: –  the music intensifies; blood and light particles flood the screen; and your character echos  “Wuuoooaarhh!!!” as he tears his adversary’s head off in slow motion with his sword.  All of this happens in about 3 seconds.  A fitting, and brutally honest end to a  game is entirely focused around violent, bloody confrontations.

It is called Katana, after all.

Whereas in this fight I’m working on… it’s a bit of strange one because the conflict is optional.  The whole premise is that the player character is starting to believe in their inner strength and chooses to fight the big bad boss, even though they don’t have to.  In game terms, that means that the player should also want to choose to fight, because it’s fun; but if they want to, they can actually run away and load the next level.

This boss is intentionally tougher than anything they’ve faced before, so assuming they choose to fight on, I’ve added another shortcut — ring outs.  The setting is a small subway, and the player can lure the boss onto the tracks, wait for a train, and then jump to safety at the last moment.  The boss is scripted to try and climb back onto the platform, but most of the time he still gets hit.  Of course, the player can also get splattered by the train, so there is some risk involved.

So, I think all that stuff is okay, but what happens for the players who do take the time to beat this boss properly?  

He just yells “Yarrrgh…!”, keels over, and vanishes.

Until this week, I’d not given it that much thought, but I had an underline sense that it just felt wrong.  For stylistic reasons, I can’t have the player decapitate him or have him explode (the game is not gory at all); but I wanted to visually reward players for winning the fight.  Then it occurred to me — why not make it like a Mortal Kombat stage fatality?  I mean, sure it’s cheesy, but the train is already there.

So, after you ‘win’ the fight, the boss staggers to his feet, precariously near the edge of the platform.  I must stress that the player can still choose to run away at this point.

“overcome adversity… in an honest and visually unique way” 

It’s a very simple set up that guarantees that the train will suddenly appear and hit the character if the player chooses to kick or punch them off the platform.  This means the player can run up to the guy and perform their own custom juggle combo on the boss – really lay into them, and then cap it off with a cool stage finisher.  It’s not quite finished, but already the level feels more complete after this addition.

It occurs to me that not enough games outside of the fighting genre actually let the player beat up the boss after they’ve won.  And why the hell not?  Bosses are, by definition, challenging and borderline frustrating, so it makes sense to reward the player once they’ve overcome them.  Yet, off the top of my head, I can’t think of a single recent game that lets you ‘finish’ a boss.  Bayonetta perhaps?  Even if the fight itself is solid, too many games these days retreat into a cutscene or quicktime event the moment that the boss hits zero HP.  It’s a real shame, because the idea of allowing the player to ‘Finish’ his opponent in style is a stroke of genius.

Say what you will about Mortal Kombat’s exaggerated violence and gore, Ed Boon and his team really understand the idea of overcoming adversity “in an honest and visually unique way”.  It’s about understanding your characters, something which MK has always excelled in — whether it’s Sub Zero with his deep freezing powers, Scorpion with his harpoon spear, Raiden with his electricity, or Kung Lao with his razor sharp hat.  All of these characters are instantly identifiable, and their finishing moves are appealing because they fully utilise the uniqueness of the character and their powers.

You can see this in their new fighting game, Injustice:

I can’t say I’m a huge fan of the DC universe, but who wouldn’t want to play as Superman when you can uppercut your opponent OUT OF THE EARTH’S ATMOSPHERE.

Getting back to finishing moves, besides being visually striking, the most important thing is that they are interactive.

What do I mean by this?

  • They can only be performed if you win the match.
  • You can choose between 2-4 unique moves per character, and some levels offer special stage finishers.
  • You have about 5-10 seconds to enter the correct input.
  • You have to be standing in the correct place for it to trigger correctly.
  • They can be failed, and there’s no ‘try again’

The key point to take from that list is choice.

We’re not talking about a glorified quicktime event, where the player presses buttons in sequence as cool stuff happens.  And we’re not talking about violence for the sake of violence.  The point is that the player can choose exactly how they want to finish their adversary – even if that choice means running away or letting them go.

Something Ninja Gaiden 3 utterly failed to do:

http://kotaku.com/5894896/heres-everything-i-cant-stand-about-ninja-gaiden-iii  (skip to 1:30)

In this scene, the player character backs a defeated, unarmed soldier to the wall, and is then prompted to kill him.  All the while, the man is begging for his life.  It could have been quite thought provoking, adding a level of ambiguity to the character, and making a brave point about thoughtless killing in promoted in videogames.  Instead, it’s unsettling — and for the wrong reasons.  As the reviewer points out – “the player has no choice but to run him through, in slow motion.”  In his dying breath, the soldier reprimands the player for being inhuman.

This is a design mistake.  If you’re going to have your character commit a morally ambiguous action, you either don’t make it interactive, or you let the player choose and accept the consequences.  Forcing the player to participate in an action they morally disagree with only serves to alienate them from the character and the game as a whole.

Contrast that with the ending of Max Payne 3:

It’s subtle, but you have about ten seconds to decide whether or not to pull the trigger.  The game doesn’t judge your decision.

Meaningful choice is important because humans are problem solving machines.  When confronted with a problem, we make a choice and take action based on it.  We then analyse the consequences of that action (rewards and punishments); we consider the alternative choices that could have been made; we weigh these factors up and we determine whether or not we made a mistake.  Through this process of trial and error, we learn from our mistakes, and when confronted with similar problems, we apply this learning to make more informed decisions.  As we become more knowledgeable and experienced, we start to make less mistakes and gain a sense of accomplishment.  We then seek more challenging problems, so we can further our learning, and inch closer towards mastery.

Problem -> Choices  -> Consequences -> Learning -> Meaningful Choices -> Accomplishment

However, if you take choice away entirely, then you short-circuit the whole learning cycle.  Without choice, you can’t make a mistake, and without mistakes you can’t really learn.  Your actions become meaningless events with no significant consequence.  In the simplest terms: if learning equates to fun, then removing choice kills the fun in your game (although remember that overchoice can overwhelm players — everything in moderation, as always).  On the other hand, introducing subtle tactical and strategic choices can make a basic game system more refined and interesting.

For instance, even when God of War uses quicktime prompts, many of them are optional and have different strengths and weaknesses.  Usually performing a quicktime finisher lets you defeat the enemy early (when they have 20% – 33%  health left), makes you invincible during the animation, and it rewards you with a health or magic bonus.  In other words, these finishing moves give you an immediate, tactical advantage, as well as a visually strong way to defeat your opponents.  However, if you beat the enemy with regular attacks (slightly more challenging), you’re rewarded with more orbs — the game’s currency, which lets you purchase upgrades.  This gives skilful players a long term, strategic advantage.   

This means that during almost every single encounter, the player can choose between a tactical vs. strategic approach, depending on their current situation, and their goals and motivation.  But it’s not required of them — there is an optimal path, but they’re not forced to play it.  This adds subtle layer of depth to the game, without ever over complicating it.

In closing, when designing games and levels, I think it can be helpful to think of “the player as the director”.  Always remember that when the game starts, when someone calls “Action!” (or “Finish him!”), it’s the player who fulfils the role of both the lead actor and the director on set.  While it’s tempting to push them down the best possible path, ultimately it’s their story, and when it comes to the big set pieces, they should be the ones who control how the action unfolds.  Do they viciously finish their adversaries, or do they just walk away? That should be their decision.  Your job is to give them the opportunity to decide.

The Why, How, What of game design.

MMOs designers need to focus more on the ‘why’, not the ‘what’ 

This is an interesting article, in so far as it highlights a good thinking discipline — if you can’t accurately explain ‘why‘ a user likes an existing product or feature, you shouldn’t be thinking about how or what to build next.
It’s very easy to slip into a reverse thinking pattern where you do this backwards – what shall I build? How shall I build it?  Why would they want it? (i.e. how do I justify it?).  Instead it should be: Why do they like this, how can I improve it, what do I build to facilitate it?

In gaming terms, I don’t think MMO’s are any different from regular games, but they’re problematic because often skill based gameplay is substituted for repetitive grind tasks.  However, all games have one common goal and motivation (the why), and that’s to achieve a sense of accomplishment.  How do players get this? By making meaningful choices, through applied learning and mastery of the game’s world and systems.  Minecraft is a good example of this.

The  -What- varies from game to game, but generally speaking it’s signposted by overcoming challenges — beating other players in the game, finishing the game’s levels, reaching the highest level, or conquering all the game’s environments.  If the list of challenges dries up, or becomes stale (e.g. generic, never ending missions in GTA and Skyrim) the player loses interest – so you facilitate this by introducing more challenges to overcome.

For example, Tekken hasn’t really changed its core gameplay since Tekken 3, which came out 15 years ago.  They’ve extended the game with subtle refinements to game system, and more importantly by drastically expanding the character roster (to over 50) and the number of moves per character (which is in the hundreds).  In other words, they keep pushing that bar of ‘mastery’ out of the grasp of all but the very best players (who compete in tournaments).  As a result, there are always more characters to master, and always new opponents to overcome.

With an MMO, it’s pretty simple – you need to keep pushing that level cap, build new areas to explore, and even bigger monsters to beat (particularly those that encourage team play, or even an entire community of players, like that mobile game that has a billion HP boss).  Why do players do this?  Again – to get a sense of accomplishment, by overcoming all challenges.

Exporting DAZ Studio 4 figures to Blender

Information on this is a bit scattered, so here are my findings.

There are two reliable ways to export Daz figures to Blender (and other programs).  One is to export the mesh as a wavefront object (*.obj), the other is to export as a COLLADA file (*.dae).

After experimenting with both, I found that exporting as a collada file was quicker and more reliable because:

  • Textures  are automatically mapped and assigned to materials correctly
  • The model is automatically rigged to an armature (skeleton) which means you can animate and pose it in Blender.
  • I encountered geometry errors using obj.

On the downside:

  • Daz Studio operates in Y-up whereas Blender works in Z-up, everything has to be rotated on the X axis by 90 degrees.  This adds an unnecessary layer of complication to your workflow.
  • The figure’s pose / animation is lost in the process.

Fortunately you can restore this by exporting the pose separately as a BVH mocap file.  It’s a bit of a hassle to correct the rigging, but if you prefer to pose your figure in Daz Studio (or Poser), or have hundreds of stock poser poses saved over the years, this is the way to go.

Workflow

In Daz Studio:

  • Hide everything in your scene except the model you want to export.
  • Export the scene as *.dae using custom options (without daz enhancements), and tick all of the settings.  Be sure to combine the alpha and diffuse maps into a png file (more on this later).
  • Now export the scene as a bvh file, using the default settings.

In your operating system, navigate to the directory where you exported the files.  You should see a *.dae file, a *.bvh, and a folder which contains the model’s textures.  Move the *.dae file into the newly created folder with your exported textures, open it in notepad and then search for references of “./filename/” and delete them.  (where filename is the name of the *.dae file;  e.g. “./filename/texture.jpg” becomes simply “texture.jpg”)

For more help on exporting, please read this excellent article.

In Blender:

  • Open Blender and import your bvh as an armature.
  • If you select the armature and go to edit mode, you’ll see that some of the child bones (fingers, eyeballs, toes, etc) will not have imported correctly.   Either delete or fix these bones (I would just delete them).
  • Import your *.dae file

Now you have your model with it’s own armature (in a t-pose), and a standalone armature imported as bvh with the pose or animation you want to use. The final process is to use the constrain bone tool to link the two armatures together.  I know it’s not the most elegant solution, and if you know of a better way, by all means let me know. :)

So, under your model’s armature pose node, go through every major bone, and add Copy Rotation and Copy Location constraints.  These should link to the bvh armature’s pose as the target.  This process is fairly tedious and the biggest drawback of using a collada file; however were you to export as an obj, you would now be messing about trying to reassign materials and figure out how to fix or hide geometry errors.

Finally, you might find that some bones (hip, abs, chest) appear twisted out of recognition.  On the rotation option, choose ‘offset’, and then rotate the bone 90 degrees on the X axis to correct the error.  Offset basically combines the values of the source bone with the target bone, which simply means you can make corrections without losing the original pose.

Hair and alpha maps

Daz models use alphas for details like hair and eyelashes.  Alpha maps in Blender are something of a headache for new users like myself, so here’s a quick note on them.

When exporting from Daz, it’s important to select the option that combines the alpha map with the diffuse map – this will give you a png file, with automatic transparency, which is a lot easier to work with in Blender.  One thing to bear in mind though is that if the material doesn’t have a diffuse map (e.g. eyelashes), it won’t create the png, so in this case it might be best to set the alpha map on both the opacity (alpha) channel and the diffuse one before exporting your model.  In fact, this might be the best practise anyway, as you can then set the material’s colour using a shader, rather than a diffuse texture.

With your model and materials loaded, you need to quickly adjust the material and texture settings to enable the alpha to work correctly.  To do so:

  • Enable transparency (Z-transparency) on your material.
  • On the material’s texture, under image, enable premultiply
  • Under influence, enable alpha and set it to -1.0, set Dvar to 0.

That’s it — apparently ‘use alpha’ under image sampling is not necessary.  You might also consider turning ‘traceable’ off, under material options, to reduce render times.  For simplicity, I also recommend exporting hair style objects/figures as a separate *.dae file; that way you can use them for other models.  You can then fit them to your model using the Copy Rotation and Location bone constraints as before.

Thanks for reading, I hope this helps a bit.

Further reading:

Exporting from Daz to Blender 2.5: http://www.4colorgrafix.net/2011/06/dazstudio-blender2-5/

Exporting bvh files:  http://www.ipisoft.com/en/wiki/index.php?title=Animation_export_and_motion_transfer#COLLADA

Alpha maps in Blender: http://wiki.blender.org/index.php/Doc:2.4/Tutorials/Textures/Use_Alpha_for_Object_Transparency