Jason's Development Blog

Archive for October, 2010

Choice, Philosophy and Morality in video games.

by on Oct.30, 2010, under Life, Technology, Video Games

I’m not going to deny it, I find moral choices in video games fascinating. On the one hand, having options and therefore the illusion of control is very nice. On the other, for f*cks sake video games, why is the choice always to be either Jesus, Satan or apathetic?

At it’s core, our sense of “Morality” is just avoidance of the negative consequences of actions that aren’t worth the potential benefits of those actions. Conscience is the voice in our head that says “Well, if we get caught doing x sh*t will hit the fan and life will suck for awhile”. Whether this is something inherently involved into people, or a conscious process, does not change that this is where morality stems and a moral system in games needs to be designed to reflect that. Games have no real consequences anyway, which is why games have to dangle some form of engineered carrot in front of players.

Star Wars: KoToR had simple carrots, dark side powers which hurt enemies and light side which healed and buffed allies. Being light side or dark side was basically a playing style choice. Dark side sometimes had an extra money carrot, but not always. Sometimes you got more from light side. Or you could take less light-side points by asking for a reward but get more money or…you get the idea.

Mass Effect has two carrots: Being a bastard gives you renegade and lets you do more intimidation, being a paragon let’s you be more charismatic. But the carrots are the same both ways, being renegade is just funnier to watch most of the time. I can’t be the only player he basically did all the big paragon choices but at every other step of the way was a complete bastard, just so he could laugh at the bastardry.

Both these carrots give players “the weaknesses of amorality”, being a grey made you inherently weaker which sucked.

Personally I’d like to see a game implement a morality system akin to that of the World of Darkness: One-way. Being cruel cost you morality, but when only your current morality was above the level of cruelty of that action. A common thief would not lose any more morality from stealing, but if they ever kill someone they’d take a plunge. Also it means the game can easily keep track of how to treat the player, you can’t “puppy-poke” your way to becoming the Lord of the Sith.

Of course some kinds of carrots would be required. WoD implements “derangements”, as your character goes more (a/im)moral they go insane(r). This means players have to balance the rewards of their “evil” actions with the risked penalties of such actions. Also this situation can lead to interesting problems, like the “batman dilema”. If Batman (the player) kills Joker (some bad guy), killing becomes easier for Batman (Morality score lowers) and he may therefore do it again (no longer risk of gaining a derangement from murder). You effectively put the player at the top of the slippery slope and watch them roll down.

Understandibly, choices and a morality system can only be implemented into a relatively freeform game, otherwise they feel incredibly painful. They are best suited to games which, like novels, explicitly make one of their purposes simply to be making you think. Take for example, Planescape: Torment. A cult classic with very little emphasis on combat and much ultimately on a simple question:

“What can change the nature of a man?”

A question with so many answers that reveal so much about the person creating the answer. Take me for example, ask me this question and my answer would be profit. What can change the nature of a man? What he stands to gain from making that change. Others would come up which so many different answers, age, time, death, belief, hope, fear, regret, so many possibilities. These kinds of games are fascinating. They offer insights into the human condition, and our own depravities.

Knights of the Old Republic 2, Fallout 2, Planescape: Torment, all of these were story based in my opinion. It was the story that interested me, the story that kept me playing, and the choices that story provided that made me play again.

These are the games that we replay because we want to see real differences in our choices, they are highly character based, highly plot heavy, and I think we need more of them. I am interested in what you all think of almost entirely story-driven games, to the point of being almost if not entirely interactive fiction. From a game development point of view, the pros and cons of such games would be a fascinating discussion.

So, what is your opinion on low-action, high-narrative games? What do you think can change the nature of a man?

Quotes of the Day
“The belief in a supernatural source of evil is not necessary; men alone are quite capable of every wickedness.”
“What makes mankind tragic is not that they are the victims of nature, it is that they are conscious of it.”
Joseph Conrad

1 Comment :, , , , , , , , , , , , , , , , , , , more...

Java Event Maps

by on Oct.18, 2010, under Code, Java, Programming

I openly admit to not being fond of coding in Java. It’s just not got the elegance C# has. However, I will use Java if only to remind myself why I don’t like using it.

I recently did just this. Largely so I could see whether the event queue system I made in C++ could easily port to Java and C#. Guess what? It does. This pleases me.

Here’s a code example of how to use the event queue:

package eventtesting;

import JpmEvents.CEventMap;
import JpmEvents.IEvent;
import JpmEvents.IEventHandler;
import JpmEvents.BEvent;

/**
 *
 * @author Jason
 */
public class Main
{
    private class TestEvent1 extends BEvent { public TestEvent1() { super("TestEvent1"); } }
    private class TestEvent2 implements IEvent
    {
        public Integer Hash() { return Name().hashCode(); }
        public String Name() { return "TestEvent2" }
        public TestEvent2() {  }
    }

    private boolean OnEvent(TestEvent1 e)
    {
        System.out.println("Event One Called!!!");
        return false;
    }
    private boolean OnEvent(TestEvent2 e)
    {
        System.out.println("Event Two Called!!!");
        return false;
    }

    protected void Run()
    {
        CEventMap emMap = new CEventMap();

        emMap.Bind(new IEventHandler<TestEvent1>(){public boolean HandleEvent(TestEvent1 event){return OnEvent(event);}}, "TestEvent1");
        emMap.Bind(new IEventHandler<TestEvent2>(){public boolean HandleEvent(TestEvent2 event){return OnEvent(event);}}, "TestEvent2");

        System.out.println("Triggering events...");
        emMap.Trigger(new TestEvent2());

        System.out.println("Queueing events...");
        emMap.Queue(new TestEvent1());
        emMap.Queue(new TestEvent2());
        emMap.Queue(new TestEvent1());

        System.out.println("Flushing events...");
        emMap.Flush();
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
    {
        Main m = new Main();
        m.Run();
    }
}

And here is the link to the Project Kenai page I’m making the library and it’s source available on, under the MIT Licence

.

Quote of the Day
“I account for morality as an accidental capability produced,
in its boundless stupidity, by a biological process that is normally
opposed to the expression of such a capability”
George C. Williams (May 12, 1926 – September 8, 2010)

Leave a Comment :, , , , , , more...

Refactoring

by on Oct.16, 2010, under Life, Technology

“I don’t like how I did this at all! TO THE REDESIGN ENTIRE SYSTEM FROM GROUND UP MOBILE!!!”

So I basically had the realisation that my for Project Pauper design was modular so would be better fit into multiple Dynamically Linked Libraries than one Statically Linked Library. Unfortunately, my event system relied on RTTI, which in C++ under Windows can’t be relied upon across DLLs. At all. Ever.

So I decided to pull the event system and replace it with a new one. And one thing led to another and suddenly I had decided I wanted to refactor half the code. Joy.

Zip and date old Pauper, move it to backup directory and begin working on new pauper. Most of the start up is just getting what worked in the old to work in the new, copy and paste or rewrite as I go.

Whilst I was at it I decided Window and Graphics Device should not be one item, but separate. This design is one I dropped awhile ago, but fsuck old me, new me says it comes back. I have finally figured a good way to keep window logic in it’s own thread though, via a thread-safe event queue sitting between the window’s events and the events Pauper has to respond to. It just feels cleaner for some reason.

Leave a Comment :, , , , , , , more...

Adverts