Thursday, March 20, 2014

Cheat,Hack and Simulate!

All programmers like to show of their skills by implementing things in an interesting way.
This is done most of the time of the time for the purpose of optimization and has a clear function and scope, which is unfortunate because premature optimization is bad.

What I would like to say however is that this hacks outside of optimization are never bad.
Optimization is the crutch that kills them.

Game programing is all about this hacks that propose novel solutions and have interesting side effects that let you do more with little.
One line of hack code can affect much more what is possible with your design then thousand of lines of conventional code.

You have to think of it in terms of loose problems and actively think about the code and the resorces available and how they work.

Hacks can be simple rules used to calculate hit chance, damage,evasion and so on. You can say DnD was built on this kind of hacks. Simple rules that do great things.
 So when you make an RPG be inventive when you implement your stats, don't follow the standard and make a nice hack for it.

Some of the best RPGs I played have done some wonderful hacks to the combat system.

One type of hack the developers don't really like to use is the cheat.

As we all know the AI is a cheating bastard.
And to some extent it can't be helped as the AI is limited in its ability to think.

To think is to gather information and what we are doing is giving the information away.

What developers don't understand is that this should be embraced.

There is no visible difference between intellect and cheating.
An AI that gathers vast amounts of data and makes calculated guesses and AI that has the information given to them can make the same decision.

The simulation of believability is not necessarily dependent on the ability to gather information.
It is in fact the quality of information that impacts the hardest believability, the more types of information you have the more you can work with. Things like heat maps that know where the choke points are a great addition in both believability and effectiveness.

But cheating is not limited to AI bots.

In fact cheating is a powerful tool for a designer.

The only thing you can't control is the player and cheating is taking one step into his domain.
Every instant a Player prays to the RNG God is an instant that you can be that God.
You do not have to always cheat against the player, when the player is in the flow in a high risk situation you can cheat and let him live that situation. If the player grows strong you can devastate him.
You can act as his fate bestowing opportunities and placing obstacles.

Keeping players alive for the first time in a situation can be a very thematic thing, in the game the player will be low on health, resources and their armor broken. It would be a mercy just to kill them but the player will live on and play more carefully. In a game that has a high learning curve this and hard battles this careful play is required, so cheating the player to survive can be a great learning tool.

And finally simulate!

The most terribly underutilized tool a game designer has.
The thing that the designer has full control of.
The NPC.
I still remember when I was playing Gothic for the first time.
I was meet by an NPC, along the path I meed some hunters in a camp in the woods, I entered the town and seen NPC have some limited day/night routines. A NPC guided me to another town.
That is all the game did, no complicated AI here, and to this date NPCs are still more limited then this.

Simulating NPCs is the most important thing you can do, you don't have to do them for all of them but always have some.

The most important rule to follow is to always be visible to the player.

If you simulate and the player doesn't see it you are wasting your time.

First vary your NPC location, it can be as simple as teleporting different adventurers to a pub.
You can have the main villain be chased by a player all over the world and the locations could be completely random.

Second let NPCs interact with players, NPCs should strike a conversation just as much as the player does especially if they have something important to say, interaction is key, whatever bits of interaction you ca think of put it in, let the players be chased by enemies he made and unwanted admirers.
If you can implement things like emotions in NPCs you could create powerful stories with only that.
It all boils down to action,stats and reaction.
For every action that can be a reaction from a NPC.

Another thing to simulate is a different layer of the game altogether.

In an RPG a very powerful thing to do is simulate the plot with an actual strategy game on top.

NPCs become units that move around the map and conquer the land.

The player becomes the hero unit and has to play the game as an RPG, he does not control personally a faction. He can only setup things acting as a diplomat and placing the right pieces in the right places at the right time.  He could strike as a special unit the weakness of the enemy and have support from the enemy's rival factions. He could meet with adventurers NPCs and gather their support.

All this while a real strategy game is played above the player between factions.






Wednesday, March 5, 2014

Plot Tracer

The idea behind this concept lays in a simple trick, inspired by something we do every day.
Every day we go on google and search for something.
And a vast array of data sorted by  incomprehensible algorithms gives you what you want.
What is relevant.
Collapsing a huge amount of data into a simple result.
Why not use this for games?

The fundamental concept for this is context. Everything bit of data is related to other data. Everything character in the game can have endless possibilities of locations ,equipment, characteristics and from this endless possibilities of events and interactions. Its like having a wiki in the game where the page of something defines how it behaves.

The tracer part of the name signifies, like how in a ray tracer it is the rays that hit the camera that we are interested in so here we are interested only the player perspective.

Based on how the player interacts with the world so does the world generate characters,items,events and actions. The world is a blank slate until a player comes and gives it meaning.

Every decision and interaction has this continuously linking of data, and every past interaction is recorded and reused in the next context. Think of it like navigating a wiki, where the wiki is actually the game and the continuous links the player chose the plot.

How the narrative works procedurally is as follow.
A trace of context that is generated randomly that ultimately results in an even is called a thread in this concept. And there is supposed to be a constant stream of this mundane threads to give life to the world.
Above mundane threads is plot threads. They aggregate the context generate from event threads into a form that can be considered a story, with conflict, high stakes, and rewards at the end for the player and can incorporate many elements from stories.

While the threads can do much it is up to the game designer that it ensures proper pacing by analyzing the player. Cycles of conflict and calm as well as proper progress.

Plot threads can scale from small quests to epic heroic stories. And the theme can be varied to bittersweet tragedies, or tense horror.

A interesting thing you can do with permadeath is instead of recreating the whole world you can pick up where you left of with a new character.
However the context you generated with that character remains and he is now dead. So for example your hero's girlfriend  you might find has been stuck in grief and despair that is now on a path of revenge and destruction out to kill us all and your new character has no relationship with her.

The gameplay part outside of combat events and other normal game systems (management of resources, mini games, strategy and tactics) is the unique resolution of context.

A plot thread has a win and failure state that is resolved through generated context, just like everything else the condition to win or lose is also generated and  the player must have a clear path to reach it and a absolute way to lose it.

An example, lets say there is an evil wizard out there that is immortal and is causing a havoc, to defeat him you need the staff of light. The staff itself has context, as it is an ancient and legendary artifact you will need to go to an archive to find about it. There you read about who made it, what does it do, who weld it and in what battles it has been in and who it has been entrusted to.

Those entrusted is an actual faction in the world with a real location so you go there. You enter the dungeon and get it at great expense and guile and finally defeat the wizard. If  the staff is destroyed by the antagonist forces.

An import thing to remember is to keeping the condition clear, sometimes is better to just ignore a plot thread completely if the player didn't mange to stumble on the information. It might be need to just force some opportunities  to generate.










Tuesday, March 4, 2014

Procedural Narratives

Gameplay and narrative in games has always has some tension between.
They sometimes clumsily step on each other toes. So they are kept at arm's length with some sacrifices to either the directed experience or limiting gameplay.

This is not a bad thing, the combination of this 2 powerful domains has made a wide variety  of genres on both sides. Narrative has become more open with different branches,endings,choice and consequence, even to the point that what you experience can be up to you when you go from quest to quest an as a result we had unprecedented world building and immersion.

You can see the world interact with its characters and locations and with a bit of thematic game mechanics you can even feel it.

Gameplay is also enchanted by the addition of story, it raises the stakes that makes it worthwhile when they are achieved in the climax of gameplay, it immerses you into a world and lets you imagine it.

The holy grail of this marriage of 2 forces resides in the tabeltop RPG.
You have perfect blend between gameplay and narrative, gameplay affects the story and story leads to gameplay. They each dance between each other, gameplay becomes choices in stories and story leads to development and conflict that turns back to gameplay.
A wonderful theater of play.

Computers are a powerful thing, it is the third force that is hidden from view. It can calculate and interpret but it cannot think. With the current development by the industry they make poor directors of the experience, poor Game Masters in a RPG and that role is crucial to creating the dance between gameplay and narrative.

For a long time designers have underestimated the most important concept.

The Non-Player Character.

The best examples of what can be done with characters to date has been limited to companions and dating sim like games.
Companions are more like Non-Non-Player Characters as their gameplay is usually controlled by the player or limited to some fighting, outside of just leaving the party they don't do much. As for sims the gameplay is just an achievement to reaching some stats.

Most NPCs are relegated to be a signpost, sometimes a walking signpost. Some branching choices in the story is the only treasure they could hope for.

They are terribly underused for they do not act.
Which is as shame because they are the most powerful concept to take games to new heights.
You cannot fully control or direct the player. You can control an NPC fully.

They can act any roles, they can do any thing, they can walk any where.

Procedural Narratives is not about creating some events, or creating quests with different conditions.
You are not going to get a story out of that.

Procedural Narrative most fundamental concept is teaching NPCs how to act in a world and react to the player procedurally that makes sense in the context of that character and the world he lives in.