Lens #13: The Lens of Infinite Inspiration

The lens #13, the lense of infinite inspiration from The Art of Game Design: A Book of Lenses written by Jesse Schell.

The core of this lens is to look everywhere else than to other games.

  • What experience in my life would I like to share with others?
  • In what small way can I capture the essence of that experience and put it into the game?

I will make a collection of thoughts and in the end, I will apply lens #2

Here some inspirations

  • A smooth skateboard run in a bowl
  • Martial Art
  • Hellboy comics

Smooth Skateboard run in a Bowl

I love to watch skateboard clips, especially smooth bowl runs. With this slight scratch sound when the rider corrects his board with all four wheels on the ground. My aim here will be to make moving the character smooth, precise, and nice. The player should be able to move through a world smoothly and fluidly. This will include a lot of testing and adjusting. The problem I face here is that adjusting the player control will affect the existing levels. A slight change in the jump height, speed, or friction can have a great impact on the levels.

Applying lens #2 leads to the following 3 questions

  • What experience do I want the player to have?
  • What is essential to that experience?
  • How can I capture this essence in our game?

The player should get a feeling of great control over the character. The walkthrough must be fluid and to the point.

Like the smooth and almost effortless-looking run of a skateboarder in a bowl or skatepark, the player should be able to smoothly navigate through the levels. It should always give the player a very good control over the character.

To navigate through the levels smoothly the levels should be crafted in a way that the player doesn’t pump his head, the platforms are reachable without being pixel exact, as well you always see where you go, there is no blind rattlesnake hole. Whenever you have to jump blind, make sure it is always a safe jump without surprises on the landing spot, this could be a storytelling element.

Martial Art

Martial art is my choice of sport. It trains your brain, your body, and your balance. To watch skilled martial artist is a joy, the moves are seamless, almost effortless, the weapons are super precise. I love choreographed fight scene, compared to a real fight, that looks just beautiful, almost like a dance.

Let’s apply lens #2 here as well and answer the three questions.

  • What experience do I want the player to have?
  • What is essential to that experience?
  • How can I capture this essence in our game?

It’s important that the player feels always capable throughout the gameplay without feeling bored or overpowered. The control over the weapons and aiming while walking and shooting should be smooth and precise. Even if the controller isn’t that precise the game has to be, that should be an experience I want the player has.

Martial art is about a combination of attack and defense patterns nicely rowed up to defeat the opponent. The martial artist has great control over his weapons, everything is smooth, fast, and precise. There is no hesitation, no struggle, no fuss. Even modern action movies are filled with martial art and that makes them so enjoyable to watch. It’s not just the explosions and the fx, but as well the moves, attack, and defense during a gunfight.

The aiming of the guns should not be fully automated, but if you start shooting at an enemy it should keep track to a certain degree. The player has to point roughly in the direction of the enemies and the auto-aiming should then take part. I’m thinking of having an automated switch weapon, whenever you are too close to enemies, nevertheless the player should be able to oversteer the choice of the weapons. Maybe I can make this configurable.

Hellboy Comic

I admire the Hellboy comic style from Mike Mignola, it’s dark, simple in a way and hence full of little details. I like the sceneries he set’s up in those comics. One of the stories starts at a door and as soon hellboy opens it hell breaks loose. The battles are often short but intense. And it’s always a boss fight for hellboy.

Let’s tackle lens #2

  • What experience do I want the player to have?
  • What is essential to that experience?
  • How can I capture this essence in our game?

One of the things I like from Hellboy is the silent moment and the intense but short fights. Sometimes he gets catapulted to the next level of the story. I’m thinking of having some silent moments to tell a story in this game. But fights should be always intense, no matter if it is a boss fight or not. I’m not yet sure if it will work.

Essential to this experience is, that there is not continues battles going on like in a shmup but as well some story elements, like silent moments or falling down a hole and find your self in a new room, after battling a boss (which might have survived so he can show up later again).

I think by adding a transition from one battle to another and after boss fighting getting catapulted to another world even. Like in hellboy where he went to hell after the witch grabbed his heart. So actually hellboy looses but this doesn’t mean to be the end of the game. I like that very much and gives this dying a new perspective. I kinda have an idea, but not written in stone. I have to try this experience and see if that could work.

I like this idea and I accidentally stumbled over it in analyzing what exactly I like from this comic, what underlying mechanics which drives the story to the weirdest places on earth and the underworld.


I get commissions for purchases made through the following links, I only put stuff in this section I also would buy or I already bought

Lens #10: The Lens of Holographic Design

The next lens I want to look through on our game All Fucked Up is the lens of holographic design from the book The Art of Game Design: A Book of Lenses written by Jesse Schell. This lens is about seeing the four elements (Aestetics, Story, Technology, and Mechanics) and the player experience in a holistic way. Let’s tackle the following questions in this lens.

  • What elements of All Fucked Up make the experience enjoyable?
  • What elements of All Fucked Up detract from the experience?
  • How can I change game elements to improve the experience?

The cute characters, the little details, the smooth gamepad integration, and the guns make the experience enjoyable. To watch and experience guns in action is satisfactory. The gamepad optimized precise control makes the navigation of the character smooth and nice and does not distract from the game experience.

The double barrel shot gun with it’s late shell ejection, like in reality, as well the camera and character kickback makes the feel of the weapon nice and power full.

Here we see wall jumps in action. The control is smooth and lets you navigate quickly through levels.

The environment and the level-design do detract from the game experience. It looks nice but not brilliant. Quite flat and too simple. The levels don’t look exciting enough way to simple and linear. This can be improved, I need to design much more level also to get more experience on what works and what does not work. If I want to introduce the switch from rifles to handguns or knife I need to design the levels accordingly to make that a need. The same for shooting enemies, if I just can jump over them it makes no sense to shoot them except for the joy of using the collected weapons and ammo.

I think it is very clear that the element level needs a big improvement to make this game fun to play. I feel I’m far away from that. I probably first try to improve the existing levels not on the graphical level but on how I compose the platforms, weapons, ammo, and enemies. I need to make it impossible to jump over enemies and evade but have to design it in a way that they are a danger if not eliminated. As well I want to avoid that there is only one way to manage a level.


I get commissions for purchases made through the following links, I only put stuff in this section I also would buy or I already bought

Lens #9: The Lens of the Elemental Tetrad

The next lens I want to look through on our game "All Fucked Up" is the lens of elemental tetrad from the book The Art of Game Design: A Book of Lenses written by Jesse Schell. Elemental tetrad is the diamond shape of the four elements aesthetics, story, technology, and mechanics.

I will now answer the following four questions:

  • Is my game design using all four elements?
  • Could my design be improved by enhancing elements?
  • Are the four elements in harmony, reinforcing each other and working together toward a common theme?

Our game focus on gamepads rather than keyboard or joystick. For testing and development purposes it is currently also possible to play it with the keyboard. But the main focus will be the gamepad. We will not go into a twin-stick game, so you can only shoot vertical.

The mechanics are laid out for gamepads to have good control over the character while jumping around. As well all the buttons to make reload, switch weapon from rifle to handgun smooth. The mechanics are rather simple, you can walk, jump, double jump, wall jump, shoot, reload, and switch weapons. The levels support this as you often close to enemies you have to switch to the handgun, as rifles don’t work on man to man combat. As well you will need the reload mechanics to have always enough ammo when you enter a platform.

The story is around a man who has been dropped into a weird world full of people who want to shoot him. To go back to his normal life he has to go through all the levels. The man has amazing gun skills he didn’t even know.

The aesthetics are rather simple. We focus more on the little things to add love to the game, like shell ejection. Every weapon does have its shell ejection and reload behavior.

We plan to add more little animations like dust, falling leaves, papers which whirl up if the characters rush through a room, flickering neon, and many more. We focus on these little things and keep the overall graphic design simple.

The very simple graphics might need improvement, I’m not sure if it is enough to just have these little animations. It’s not really up to date graphic design but unique. The animations of the guns reinforce the theme a lot as it is kind of a gun porn game. The cuteness of the characters helps to improve the overall aesthetics I think.
The levels drive the story and the goal is that the player wants to finish a level to see what is coming in the next level. We plan to have different worlds, starting with a grass and bunker world. But as well an office world, tower world, and more. The gamepad should make it more attractive to game shows, it’s much more likely that somebody picks up a gamepad and give it a try than sit down in front of a computer and uses the keyboard. Gamepads also need much less introduction as it is so much more natural to play.


I get commissions for purchases made through the following links, I only put stuff in this section I also would buy or I already bought

Lens #5: The Lens of Fun

The next lens I want to look through on our game "All Fucked Up" is the lens of fun from the book The Art of Game Design: A Book of Lenses written by Jesse Schell. I try to answer the following three questions:

  • What parts of the game are fun?
  • What parts of the game need to be more fun?

I add my latest sneak peek to document the current state. That might of course and hopefully change over time while improving the game.

I have cute and very simple characters. And using weapons is fun, it looks fun too. The main character is cute, stupid, mean, and funny, I borrowed that from the minions. The dead animation is simple but effective, just a blood and meat splatter for all destroyable characters and targets with a boom sound.

The levels are short and I will add a timer to the game, so that you get points for enemy hits, ammo left and time. That could add extra fun to beat the highscore.

The enemies look a bit 1 dimensional and boring. I would like to improve the soldiers’ behavior and add some funny animations. I like the way BroForce did his enemies, especially when you throw a hand grenade and the enemies are coming close with questions marks above their heads, hilarious. I probably will not copy that, but find other ways to make my enemies funny. One funny thing they offer is, if you are in the middle of two soldiers and jump, one of the soldiers starts to shoot and kills his buddy. That wasn’t intentional but it’s kind of funny that you can outplay them. But not sure if I will keep this "feature".


I get commissions for purchases made through the following links, I only put stuff in this section I also would buy or I already bought

Lens #3: The Lens of the Venue

The first article of my game design diary, probably not daily. If you have recommendations or ideas you want to share let me know in the comments section below.

I look through the first lens of the book The Art of Game Design: A Book of Lenses written by Jesse Schell on our game, the emotion lens. There are three questions

  • What emotion shall my player experience?
  • What emotion do they have now?
  • How can I bridge the gap between these emotions?

The player should experience a powerful feeling using the guns, it’s a gun porn game and everything should be around these guns and ammo. The better the experience of these guns the better.
Cute characters should provide a playful experience.
As well it should have a badass experience with those badass comments.

When I play the game using the guns is already very nice, the kickback (camera and player), shell ejection, and also the sound is nicely put together and it feels really good to fire the weapons. As well the enemies are easy to kill which makes the feel of powerful guns even stronger. I have to be care full not to rush to the more powerful guns as this is the trophy of finishing levels. I probably need a lot of guns
I need to add more cuteness to it, the heart emoji is just one that needs to be improved. I like the minion’s way of speaking, so I want to add more of that to improve that "it is cute" emotion.

To improve it I have the following points on my list

  • Add more bass
  • Improve the flashlight
  • Add more weapons
  • Design the levels that I can use the weapons a lot
  • Add badass comments
  • Add more cute sound and animations if we accomplished something.

I get commissions for purchases made through the following links, I only put stuff in this section I also would buy or I already bought

I look through the third lens, the lens of the venue from the book [The Art of Game Design: A Book of Lenses](https://amzn.to/2EWvFk3) written by [Jesse Schell](https://en.wikipedia.org/wiki/Jesse_Schell) at our game “All Fucked Up” and try to answer the following questions

* What kind of venue suits our game the best
* What kind of special properties does the venue have to support our game
* How do the elements of our game harmonize with the chosen venue

This is quite tricky for me and I hardly can get my head around it. My game is a single-player game so far as co-op isn’t something I was thinking about when I started the game. It might be fun to watch somebody playing this game similar to [Mario Bros Games](https://en.wikipedia.org/wiki/Super_Mario) which are both fun to play and fun to watch. The funny cute elements shall make it joyful to watch not only to play it.

This game might be playable as a console, PC, or mobile game. The levels are short and quickly played. The story is implicit.

Let me know in the comments what you think about this lens and if I interpreted it properly?

————

*I get commissions for purchases made through the following links, I only put stuff in this section I also would buy or I already bought*

Lens #1: The Lens of Emotion

The first article of my game design diary, probably not daily. If you have recommendations or ideas you want to share let me know in the comments section below.

I look through the first lens of the book The Art of Game Design: A Book of Lenses written by Jesse Schell on our game, the emotion lens. There are three questions

  • What emotion shall my player experience?
  • What emotion do they have now?
  • How can I bridge the gap between these emotions?

The player should experience a powerful feeling using the guns, it’s a gun porn game and everything should be around these guns and ammo. The better the experience of these guns the better.
Cute characters should provide a playful experience.
As well it should have a badass experience with those badass comments.

When I play the game using the guns is already very nice, the kickback (camera and player), shell ejection, and also the sound is nicely put together and it feels really good to fire the weapons. As well the enemies are easy to kill which makes the feel of powerful guns even stronger. I have to be care full not to rush to the more powerful guns as this is the trophy of finishing levels. I probably need a lot of guns
I need to add more cuteness to it, the heart emoji is just one that needs to be improved. I like the minion’s way of speaking, so I want to add more of that to improve that "it is cute" emotion.

To improve it I have the following points on my list

  • Add more bass
  • Improve the flashlight
  • Add more weapons
  • Design the levels that I can use the weapons a lot
  • Add badass comments
  • Add more cute sound and animations if we accomplished something.

I get commissions for purchases made through the following links, I only put stuff in this section I also would buy or I already bought

History Back and Forth

Whenever you write a level editor or maybe a turn-based game (like chess) it would be of great help having undo and redo functionality at hand.

Based on the Game Programming Patterns book from Robert Nystrom I did like to implement an undo/redo history class. The design pattern is based on the Design Patterns book of the gang of four.

Side Note

I use this programming pattern for my test-driven development workshop, I do occasionally. If you are interested in that, just let me know in the comments below.

Implementation

Introduction

A command can be anything from move one square to shoot, cast a spell, and more. The command must encapsulate everything needed to execute and to undo his action. Every command is an own instance. The commands then get stored in a history object which I will show you in this blog post.

Command Interface

The whole thing starts with a command interface which looks like this

package mygame;

public interface Command {
    public void execute();
    public void undo();
}

The only thing you need in command is execute and undo. With that, you can even make a redo. Really?

History Execute, Undo, and Redo

I’ll show you the idea of the history implementation.

package myexample;

public History {
    public void execute(Command command) {}
    public void undo() {}
    public void redo() {}
}

To make the whole thing work you need to encapsulate everything needed to execute the command in your command object, which is of great importance.

For the implementation of the history class, I used LinkedList as it was the simplest way I found for this. Of course, you can implement as well some ring buffer structure using plain arrays, but I did not have the nerve for this.

Ok, let’s start with the basics. First of all, we need to execute the command like this

public void execute(Command command) {
    command.execute();
}

That wasn’t too hard, but to be able to undo it, we need to hold that command instance in a data structure, a linked list in my case.

    private LinkedList<Command> commands;
    public History(int size) throws InstantiationException {
        commands = new LinkedList<>();
    }

    public void execute(Command command) {
        commands.add(command);
        command.execute();
    }

    public void undo() {
        commands.removeLast().undo();
    }

Oh, wait what if I undo when the list is empty? Yes, it fails, so we need some guards to protect it.

    public void undo() {
        if (!commands.isEmpty()) {
            commands.removeLast().undo();
        }
    }

Improvments

That looks not that bad and it works already. But let’s improve it a little more. For example, does this implementation not limit the number of commands in our history, so let’s introduce a size.

    private int size;

    public History(int size) throws InstantiationException {
        if (size == 0) {
            throw new InstantiationException("0 is not a valid history size");
        }
        this.size = size;
        commands = new LinkedList<>();
    }

And now we have to improve the execute method with this size information, by dropping the first command f we hit the capacity of our history.

    public void execute(Command command) {
        if (commands.size() >= size) {
            commands.removeFirst();
        }
        commands.add(command);
        command.execute();
    }

Redo

A redo would be cool and it turns out to be very simple. We need a second linked list for book-keeping.

    private LinkedList<Command> redoCommands;
    public History(int size) throws InstantiationException {
        // ...
        redoCommands = new LinkedList<>();
    }

Then we have to store all undoed commands in that redoCommands list.

    public void undo() {
        if (!commands.isEmpty()) {
            Command command = commands.removeLast();
            redoCommands.add(command);
            command.undo();
        }
    }

Now we are prepared for the redo method

    public void redo() {
        if (!redoCommands.isEmpty()) {
            execute(redoCommands.removeLast());
        }
    }

One small problem we have to solve, what if we did undo 2 times and then call execute and after that call redo? Yeah, it will end up in redo commands which actually should be cleared. So let’s clear the redo command list on execute. This is not that easy as the redo itself calls execute to have the command book-keeping for free. The easiest way is to have an internal execute which is called by execute and redo and only execute clears the redo commands list.

    public void execute(Command command) {
        redoCommands.clear();
        internalExecute(command);
    }

    public void redo() {
        if (!redoCommands.isEmpty()) {
            internalExecute(redoCommands.removeLast());
        }
    }

    private void internalExecute(Command command) {
        if (commands.size() >= size) {
            commands.removeFirst();
        }
        commands.add(command);
        command.execute();
    }

Copy & Paste Code

And to make it a simple copy&past task to take this into your project here the things you need

package myexample;

import java.util.LinkedList;

public class History {

    private LinkedList<Command> commands;
    private LinkedList<Command> redoCommands;
    private int size;

    public History(int size) throws InstantiationException {
        if (size == 0) {
            throw new InstantiationException("0 is not a valid history size");
        }
        this.size = size;
        commands = new LinkedList<>();
        redoCommands = new LinkedList<>();
    }

    public void execute(Command command) {
        redoCommands.clear();
        internalExecute(redoCommands.removeLast());
    }

    public void redo() {
        if (!redoCommands.isEmpty()) {
            internalExecute(redoCommands.removeLast());
        }
    }

    public void internalExecute(Command command) {
        if (commands.size() >= size) {
            commands.removeFirst();
        }
        commands.add(command);
        command.execute();
    }

    public void undo() {
        if (!commands.isEmpty()) {
            Command command = commands.removeLast();
            redoCommands.add(command);
            command.undo();
        }
    }
}

That’s it, folks.

Related Books

This design pattern is based on these two books, I have both ot them, I like the game programming patterns better than the original but the orignal is almost a must have a for any programmer.

Game Programming Patterns

I recently read Game Programming Patterns from Robert Nystrom one of the best books about programming I’ve ever read.


I get commissions for purchases made through the following link


I read the entire book from beginning to end in one go, I couldn’t stop. Normally I use programming books to fall asleep, the design pattern book of the gang of four doesn’t make any exception.

The book Game Programming Pattern from Robert Nystrom on the other hand is one of those very rare books which keeps me awake even late in the night. It is crispy, fun and it explains you the design patterns in a fresh and understandable way. It is also helpfull if you are not a game programmer as it explains the design patterns from the gang of four from a different perspective than you know from your daily work.

The author starts always simple without a pattern until he ends up in a dead end and solve the problem by applying graduadly the corresponding pattern which makes it so easy to understand the patterns in all his depts. It’s a very practical approach and even the samples are in C++ they can be easily adapted to any other language.

One of my favorit one is the command pattern with history functionality. Very use full for level construction tools.

If you are interested in design patterns and don’t like the original one, give this one a try.