Ludum Dare

banner800x300

Ludum Dare 30 ended some days ago, but unfortunately I couldn’t post this before, so much work to do, so many projects! Anyway, In this post I will tell my experience within this last Ludum Dare, my third one.

Before the announcement of the theme, I was making some plans:

  • I wanted to do something with Behavior Trees. As commented on the last posts here, BT is part of my research in the doctorate program, and LD is a good event to have some real practical experience with it;
  • I wanted to use AI for several agents. A lot of trouble implementing a behavior trees for this compo and then using it in a single NPC? It seems a waste;
  • I wanted to make a game not literally connected to the theme. The thing is, most people take the theme literally and make the default game option, specially the composed words such as “lost in space”, “connected worlds” or anything involving dead things (which means you are going to have zombies).

On Friday night the theme came out: Connected Worlds. At first I hate it, I was expecting something like “you are already dead” or “no one can see you” (I have a cool idea to make something related to these themes), but was Connected Worlds. Then, still on Friday, I made some brainstorm and came out with:

  • A game that uses the theme metaphorically: each person is an independent individual, with its life, with its own world. Thus, connecting worlds refers to connecting people. Therefore, a relationship game in which the player must help the agents (which I call chibis) to connect themselves and to fall in love.
  • Following the idea of using behavior trees on this game, I planned to each chibi be autonomous, controlled by the behavior trees, i.e., they move and talk by themselves, without the command of the player.
  • I predicted that I would spend a lot of time with the behavior trees, thus, the game mechanics needed to be simple: drag and drop! maybe a reflex game! Finally I came up with the following: the player must let the chibis talk with each other in order to make couples; he or she also must drag problems away. Problems are: meddler chibis (which interrupt talks); birds (which poop on chibis); and rains (which wet the chibis).

chibi_plan

After the planning I slept (bad night, unfortunately ;/), and Saturday I started the development.

Tools Used

Same as always:

  • createjs for canvas drawing, preloading, tweening and sound control;
  • creatine for the game structures (such as scenes and layouts);
  • inkscape and gimp for graphics;
  • sxfr or similar, guitapro and audacity for sound and music;

 

Gameplay

First thing I’ve implemented, a simple drag and drop mechanics with trivial gravity implementation. I’ve spent some time on this to organize the game architecture and some more time later to fix all bugs after the BT implementation.

I think I’ve spent about 10 hours on this.

Graphics

Graphics needed to be simple, I couldn’t lose much time on this because I was already late on my schedule (BT implementation at this point were very buggy). I also wanted that they would be cute. Then simple + cute = chibis!

chibis

Example of cute little Chibis

mychibis

My Chibis

I also needed a feedback to the conversation, showing to the player that the chibis are talking to each other. I remembered that The Sims do that brightly with the conversation balloons. Thus I also drew something similar.

balloons

Some conversation Balloons, inspired on The Sims

To differentiate the static objects to the draggable ones, I tried to draw white borders on draggables and no border for the statics, but at the end I think this made no difference to the player.

I spent about 6 hours on this.

AI

IMG_36472

This was the tough part. I was risking the whole game when I decided to base the gameplay on this, but I tried anyway. My idea was – using behavior trees to control all actions of the chibis – but I had to implement the BT from scratch! Of course, I’ve looked for BT implementation in javascript, but all frameworks I found seemed very poor to me. Thus, I started the development based on the paper [Marzinotto, 2013], which have a formal description of the model.

And of course, implementing a fully functional behavior tree in few hours basing it on some paper is completely insane. There was a lot of bugs, man, A LOT. This forced me to learn that debugging BTs without a visual help is VERY, VERY, VERY HARD.

I used the following structure for my behavior tree library:

  • AIBehaviorTree: is the tree class, it only have the root node and a function to propagate the tick signal. This function receive the “target” object, which, in this case, was the Chibi object;
  • AIBaseNode: all nodes inherit this one. It doesn’t have much code, just a wrapper to help me debug the model;
  • AIInternalNode: nothing special;
  • AILeafNode: nothing special too;
  • AIDecorator: nothing special tooo;

and with this I’ve implemented the base internal nodes:

  • AISequence: the sequence composite node (similar to the AND operator);
  • AIPriority: the priority composite node (similar to the OR operator);
  • AIMemSequence: similar to the sequence node, but it remembers which child returned the RUNNING state at the last tick, and doesn’t execute the children before this node, i.e., The Mem Sequence execute directly the last RUNNING node, skipping previous children. To know more about this consult the reference.
  • AIMemPriority: similar to the AIMemSequence.
  • AIMemRandom: similar to the Mem nodes, but it choose its children randomly.

With all this implemented, I had my little improvised and buggy BT framework. Notice that, all this code have ugly hacks. I NEEDED THIS WORKING!

Other important detail. Nodes on the BT does not store any control variable on the tree structure, this allowed me to use a single BT to all chibis. To make this work, each chibi object have a “memory” variable (an empty javascript object) in which the tree nodes can write and read information. For example, a “Wait” action write how much chibi is waiting on this memory, e.g., target.memory.tree.node[id].timeWaiting += fdelta .

Other problem related to developing a game based on behavior trees it that, modeling the agent behaviors without a visual tool is also pretty hard!

Firstly, it is not trivial to decide which behaviors an agent will have, and how to implement them to coordinate with each other. After too many hours I had 21 unique actions, 15 unique conditions, and 2 unique decorators; resulting in 92 nodes to model the chibis. With this, I’ve also learned that modeling this kind of thing is pretty hard programmatically, you need a visual tool to understand what is really happening to the model.

I spent more than 20 hours on this!!!!!

Fluffy Things

In the last 4 hours I had to fix some minor bugs and to make things more beautiful (or, at least, not totally crap). Than I made the visual to all screens (menu, credits, …), including deciding the name of the game and the logo. In the last 2 hours I also could create a tutorial and 4 different levels to the game (which is not that cool because there is no real variation on the levels neither they are challenging).

So, 4 hours on this.

 

Sounds and Musics

Unfortunately, I couldn’t manage to create sound effects nor music. I don’t have much experience on this and probably would take more than 4 hours to make something reasonable.

Summary

GOOD:

  • First Ludum Dare that I didn’t change the plan in the half of the compo!
  • Behavior Tree worked very well and there were no relevant bug at the final version of the game;
  • Despite the time I spent on it, the visual of the game is pretty good;
  • There are very few games on Ludum Dare that uses AI as this one, I’m very proud of it;

BAD:

  • Constant fear of failing to finish it;
  • Very hard to model behavior trees programatically;
  • VERY hard to debug behavior trees without visual helper;
  • Mechanics is incredible boring and repetitive;
  • I couldn’t finish several aspects of the game, but the worse was the sound and not fixing the crap mechanics;

 

ss5-gameplay

(VIEW LUDUM DARE ENTRY | PLAY LOVE CRAFT)

Read more

I’ve just finished the planning for my game (still untitled)!

chibi_plan

Well, even before the theme, I was planning to base the game on AI in order to use some behavior trees. Thus, I was hoping to include some autonomous agents to the game. So, when the theme was revealed, I had this idea:

Everybody wants a person to share a life, to found a family, to fall in love, to marry, etc; and when this happen, one person connects its own world to the other.

My game aims to connect worlds metaphorically: chibis walking in the park looking for their unknown loves while you protect them from obstacles (such as bad matching and meddler chibis).

It seems that this is an ambitious game and I hope I can finish it in this weekend.

Read more

Beneath The Sea is the game I created to Ludum Dare 29, under the theme “Beneath The Surface“. In this post I will talk a little bit about how was the process to create it, including all the good and the bad things that happened on the way.

icon

The Game

As all Ludum Dare games (in the solo competition), this game was created in 48 hours. Well, actually, it was around 30 for me.

Initially, I was thinking in creating a platform game using physics and tiles. The player would have to run, jump, grab and climb to make his way out from a desolated and unknown cave. I would like to related this “run-away-from-a-dark-cave” game with clinical depression and how hard is to be free from it and how easy it is to fall into this dark cave.

That wasn’t going very well. I’ve implemented the tile system using CreateJS and Tiled and integrate the physics engine. But after 12 hours, I’ve realized that it is pretty hard to create a good platform game. I mean, you have to tweak a lot of variables to make a satisfactory gameplay. To make things worse, my plan also included pixel art, but I also realized that I have no idea how to create pixel art!

So, in half Saturday, I forgot my first idea and had to formulate a plan B. Now, I wanted to create something simple, using only the mouse or a single key button, and I wanted to create something using vector art, because I can do it on Inkscape pretty well.

Last week I was taking a look into the Orisinal games, and I remembered their Silent Water, which is an example of simplicity and which I could based my game.

With these conditions and references, Beneath The Sea came up. I thought in put the player in the charge of a battleship with the task of killing the evil summons of an ancient badass god, holding them as long as he/she can. I know that this isn’t an original idea, but it was what I could do with the 30 remaining hours.

Graphics

I’ve started with the background and the core sprites because I think it is easier to see want you will need in the game – despite the fact, that is so much better to program a game with pretty graphics.

I choose to use only silhouettes to represent the battleship, the bullets and the creeps because it was the easier and faster alternative I could find. Silhouettes also have the advantage to work well with a various graphical styles.

The background was based on classical vector art tutorials, other water games, and sponge bob. If I had more time, I would make the clouds, sun and water animated. I also wanted to put some bubbles and explosion effects, but the time was short.

Programming

Programming Beneath The Sea was pretty easy. I used the CreateJS bundle and some utilities functions (such as scene management, scene transitions, layout management and flexible images) I had here. Notice that, you can only use personal code if you make it public before the beginning of competition.

The code logic is pretty simple: create creeps and make them go toward the surface; create bullets and make them go toward the bottom; check collisions among bullets and creeps; check collisions among the ship and creeps.

Then, after a long night of work, and an exhausting Sunday morning, I had the games mechanics ready to go.

Sounds

Sounds were my biggest problem. I had no previous experience on audio edition or composition and I only know how to use Guitar Pro.

As a priority, I created the main music, which is the most important audio in the game. You can’t put several sound effects without a background music! I’ve based on the Terminator theme, with a lot of bass beats. After trying several instruments, melodies and combinations, my music was complete.

For shoots sounds I’ve used drum beats amplified and equalized on Audacity. To the explosion I’ve recorded the sound me lightening a match, and slowed and equalized it on Audacity. Finally, for the overheat signal I’ve just whistled.

I hate the sound effects I put on Beneath The Sea, I had just a few hours to finish the game and I still needed to adjust the gameplay and the kongregate api.

Gameplay

I’ve tweaked the gameplay as fast I could. I added the overheating system to control the bullet flow and created a mechanism to increase the spawn rate of creeps and weapons relative to the time.

Summary

Based on my experience on this Ludum Dare, I can summarize some important things:

  • Keep It Simple, Stupid! I didn’t followed the KISS principle when I was creating the conception of the game on Friday night. As a result, I’ve lost a lot of precious time.
  • Do what you know. My first plan involved too many technologies, mechanisms and techniques that I am not familiar with. You can’t learn everything in 48 hours.
  • Take a break, periodically. The lack of sleep and fatigue are your enemies. Without sleep, you can’t concentrate very well, so you need to take some breaks periodically to rest a bit.
  • Make TODO lists. Without concentration, you lose efficiency and time, so, make TODO lists to keep tracking what you are doing. Before starting the development of the game, create the TODO of the features. Before starting each feature, make a TODO of the tasks need to complete the feature. Before each task, make a TODO of simple changes and additions to the game.
  • Prioritize the features of your game. You probably won’t finish your game, so, prioritize the core features. If you finish the important parts and got some time, then you can do the fluffy things.

Results

Check it out the screenshots of the game:

You can play Beneath The Sea on kongregate

You can see the entry on Ludum Dare

Read more