bemmu

LD24

Bemmu is in

Language: Actionscript 3 or possibly Javascript with WebGL depending on the theme. If I use WebGL, then will use this base code to skip the WebGL setup stuff.

Graphics: Gimp, iMovie and video camera. Frames from video camera turned into sprite sheets with a short script. Short example code to get an effect like this.

Music: Audacity, perhaps bfxr. Will probably have only sound effects, or horrifying procedural noise if you are unlucky.

Editor: Sublime Text 2

This is my first LD and my biggest goal is to just release anything acceptable enough that dogbomb tries it for 5 seconds in his ludum dare review.

It’s done: Let the Darwin Games begin

Looks like ass, but it’s a fully functioning winnable game that is fun to play.

Not a shooter or a platformer, it’s a betting game for a change. Bet on creatures that compete in running, swimming and diving events. The key to getting to 1000 coins is to pay attention to which creatures tend to excel in each sport.

Play the game.

Short postmortem

After learning the theme it took me about 30 minutes to come up with the game idea. The idea was to combine BoxCar2d with horse betting. I remember just staring at BoxCar2d hoping for the little cars to make it. I wasn’t quite sure of how the physics in it works though, so I went with what I know, which is just a bunch of vertices connected together with springs. Some strings are stronger than others (indicated by blue dots in the game) to try to maintain the overall shape of the creatures.

I didn’t use any physics engine and wasted some time trying to add angular joints in, but abandoned the feature after it seemed that it would take too long to get them working reliably. I wanted to have creatures that would have some muscles that would pulsate in unique ways and those muscles would then be inherited, the creatures getting gradually better like in boxcar2d. I abandoned the rapid evolution part and concentrated more on the betting aspects after it seemed that the engine would not be fast enough to get many iterations, and pure betting seemed to be more fun. There is still some evolution in the game though, the winning creature splits into two and mutates slightly.

What went right

I spent several evenings preparing for this LD by getting comfortable with Flash. Specifically I practiced coding stuff without looking up any function definitions or online help, starting a new project from scratch several times and trying to get sprites to move on screen, doing BitmapData manipulations, filters etc. without having to resort to docs. I felt that helped during the actual compo.

I hadn’t really used the Flash vector editing or components though, so I felt I was taking a risk in not doing everything in pure code, but it paid off. Laying out the controls using the visual editor was faster and it was easier to iterate.

 What went wrong

Things went quite smoothly. As sol_hsa warned though, tweaking physics takes time. But on the other hand, that’s the most fun I had doing this. Flattening my creatures by having too strong gravity. Having them explode because of a bug or joints being too brittle. Subtly tweaking collisions to make damage look as satisfying as possible. It took time, but didn’t feel like work really.

I wanted to livestream the coding, but CamTwist + FlashMediaLiveEncoder were taking about 75% of my CPU which made development too slow, so had to shut those down and end the stream.

I read a bunch of tutorials about choosing a color palette and trying to learn about graphics layout, but when it came time to actually make an interface, it wasn’t really clear to me how to make it look better. I ended up just forgetting about making it look good and spent the time on gameplay tweaks instead. I figured a fun shitty looking game is always better than a beautiful unplayable one.

LD25

A science experiment gone wrong has resulted in a grey goo scenario. You are the goo, hurtling down the road towards the city.

 

LD27

Preparing for Ludum Dare AS3 development

Looking forward to participating in LD27? If Flash is your tool of choice, but have not used it in a while, here are some things you might want to rehearse before the contest starts. There isn’t much time during the compo to start looking up the order of function arguments or trying to recall how the overall structure of your game is supposed to work, so I like to practice the most commonly used things before the start.

Creating a simple game class

From starting up Flash, how do you get the basic game loop going? One option is to just use Flash actions editor, but as the Flash editor tends to be a bit slow and is lacking in some features, my personal choice is to edit all code in Sublime Text 2 and use Flash only to preview the result.

You can pre-create a snippet to serve as a starting point. As long as you declare your snippet before the contest starts, you are allowed to use it. Here is my starting point that just displays some noise on the screen. To use it, you create a new AS3 project in Flash, then save it as say Game.fla and from properties set “Class” to “Game”. Then save the snippet below as Game.as and launch:

package {
 import flash.display.*;
 import flash.events.*;
 import flash.geom.*;
 import flash.utils.*;

 public class Game extends Sprite {
  var backbufferBitmapData;
  var frontbufferBitmapData;

  var past;
  function tick() {
   var now = getTimer();
   var elapsedSeconds = (now - past)*0.001;
   past = now;
  }

  var pixels:Vector.<uint>; 
  function render() {
   var i:uint = pixels.length; // declaring type here is a huge speedup
   while (i--) pixels[i] = 0xff000000 + Math.random() * 255;
   backbufferBitmapData.setVector(backbufferBitmapData.rect, pixels);
  }

  function flip() {
   frontbufferBitmapData.copyPixels(
   backbufferBitmapData,
    new Rectangle(0, 0, backbufferBitmapData.width, backbufferBitmapData.height),
    new Point(0, 0)
   );
  }

  function refresh(evt) {
   var start = getTimer(); 
   render(); 
   var renderTime = getTimer();
   tick();
   trace(renderTime - start, 'ms / render()', getTimer() - renderTime, 'ms / tick()');
   flip();
  }

  public function Game() {
   past = getTimer();
   backbufferBitmapData = new BitmapData(stage.stageWidth, stage.stageHeight);
   frontbufferBitmapData = backbufferBitmapData.clone();
   addChild(new Bitmap(frontbufferBitmapData));
   pixels = new Vector.<uint>(stage.stageWidth * stage.stageHeight, true);
   addEventListener(Event.ENTER_FRAME, refresh);
  }
 }
}

Screen Shot 0025-08-22 at 3.04.23 PM

Getting bitmap data into your game

Recall that in flash there is BitmapData that represents the raw pixels. Then it has to be wrapped in a Bitmap to actually display it on the screen.

One thing you almost certainly will want to do is to use an external editor like Gimp or Photoshop to create a graphic, then somehow get that to display in your game from code. Say you have cat.png in your game directory. The way to get it to appear is to first bring up the library in Flash (⌘-L on Mac), then drag the image to the library. Edit properties of the image, check “export for actionscript” and give the class a name.

Easiest thing to forget when now instantiating that class from code is that you have to pass it 0,0. So if you called your class Cat, to get the BitmapData instantiated you do

var cat = Cat(0, 0);

You can now access the image data from code. To check that it is working, you can also add it to the stage by doing the following as the last line in your constructor.

addChild(new Bitmap(cat));

Screen Shot 0025-08-22 at 2.57.17 PM

Clearing a rectangle

Recall that fillRect exists and that in AS3 you pass in a Rectangle object as an argument instead of separate coordinates. However for the color, an integer is expected. Like so:

// Clear a 100x100 rectangle at 100,100 to red.
backbufferBitmapData.fillRect(new Rectangle(100, 100, 100, 100), 0xffff0000);

Copying pixels from one bitmapdata to another

You call the copyPixels method on the bitmapdata that will be changed. Argument order: Source – rectangle – point.

backbufferBitmapData.copyPixels(cat, new Rectangle(100, 100, 100, 100), new Point(200, 100));

Screen Shot 0025-08-22 at 3.16.31 PM

Using filters

Filters are an easy way to make something look impressive easily. After you have a filter instance, you use it to change the pixels in a bitmapdata object.

You have to remember the following things:
– How to get an instance of the filter
– How to get that filter to change the pixels

Remember to import flash.filters.* first.

blur = new BlurFilter(10, 10, 10);
cat.applyFilter(cat, new Rectangle(0, 0, cat.width, cat.height), new Point(0, 0), blur);

Cat appears twice there, because applyFilter is called on the bitmapdata that the result is copied to and the first argument is the source of the data that is passed to the filter. In this case both the source and destination are the same.

Screen Shot 0025-08-22 at 3.24.41 PM

 

Other filters are already included. You can find the list here. After this preparation, some further things to do would be to play past winning games and think about why they won, how they managed their time. Look at themes that are currently being voted on, try to brainstorm what kind of games you might make from those themes. Good luck!

 

 

I’m in

Tools:

Flash, Box2D, Audacity, Milkytracker.

Progress so far

 

 

 

Screen Shot 0025-08-24 at 3.37.09 PM

 

Managed to drop some Box2D boxes around. What will this turn into?

Rocket Mechanic progress so far

Screen Shot 0025-08-25 at 1.31.48 AM

 

The idea is that you have a space ship on the launch pad otherwise ready to go, but they forgot to add thrusters! And there are only 10 seconds left in the countdown before take-off. Can you attach the thrusters in time to save the mission?

No graphics yet, that thing on the right is supposed to be the ship attached to a crane. On the left is a bin containing a pile of thrusters you could drag and attach to the space ship.

LD30

Connected Worlds? Derp.

Our solar system has been destroyed. Only the Earth remains. The sun collapsed into a strange wormhole and dangerous worlds from beyond are intruding our own. Our only hope was to turn Earth itself into a giant weapon to destroy these intruders!

Play here

711cf5085342341ac29c800b2298873e

Comments

24. Aug 2014 · 12:37 UTC
No sun>>no plantlife>>no oxygen>>no other life

LD32

I’m in

Tools:

Bosca Ceoli for music

Bfxr for sound effects

Haxe compiled to SWF for code

Gimp and Pixen for art

 

My goal for this LD is to beat my previous highest overall ranking, which was #180. For some reason I did best in the first ever LD I participated in, but after that each one after felt more like a slog and I never really enjoyed it as much and performed poorly (somewhere around #600-#800 each time).

Now I’ve studied a bit from the pros, learned some new tricks and will hopefully do better.

I switched from using Flash directly to compiling with Haxe instead, as it seems to be a better compiler. I tweaked the code-test cycle to close to minimum by using LiveReload and some glue code. Now when I write new code and save, it compiles and runs the Flash game automatically.

Here’s a Haxe minimal project and some sprite code I did as a test to warm up. Might use these as a base.

Still to rehearse before the compo starts:

  • Playing sound effects w/ Haxe
  • More pixel art / sketching practice
  • Try to make a passable song (something that is better than silence)
  • Make a simple walk cycle

First screenshot

 

ss1

 

Trained killer pets… what an unconventional weapon!

Screen Shot 0027-04-19 at 16.52.07

At the moment you have to use your pets to attack a horde of pilgrims attacking you in Japan. Why? I have no idea.

There’s still tons of stuff to do, but it’s approaching something that can actually be played. I wanted to get to playable state faster so I could start the juicing process, but it took longer than I hoped. Now at around 1000 LOC.

 

 

Screen Shot 0027-04-19 at 23.22.00

 

Woohoo, the game is now winnable! It has a randomly generated adlibs backstory. You travel in Japan from Tokushima to Nara and finally Tokyo. There is a shop between waves of enemies where you can buy more pets to attack with.

 

 

 

Screen Shot 0027-04-19 at 23.22.00

 

Gorilla Warfare is now done. You can play it here.

Your task, should you choose to accept it, is to travel all across Japan from Tokushima to Tokyo (via Nara!) combating various enemies by controlling your pet army. To complete the game you need to clear a total 9 waves of various enemies. Pay attention to the backstory, it’s randomly generated! Also, the background image of mountains for Tokushima was actually shot in Tokushima during the compo.

New stuff I challenged myself to do here:

  • Particles
  • Music
  • Filters and BlendModes
  • Setting up dev environment to hot reload changes (it worked and was a HUGE boon)

LD33

I’m in(sane?)

Will use paper.js. If it causes me to rage, I’ll go with Haxe & Flash again and use some of my old routines as base code.

For music, either Bosca Ceoil or Ableton Live.

 

LD34

I’m in

Will switch from Flash to Javascript with canvas this time.

While I’m at it, I’ll switch from pixel art to vector too, with Inkscape.

If there’s sound, I’ll use Ableton Live demo, Bosca Ceoil or timbre.js.

For effects http://www.bfxr.net/

I’m going to be doing some bézier stuff, so will use some base code and a simple canvas init snippet.

If there’s curves in it and it’s playable, I’ll consider this LD a success :) I won’t be seriously trying to rank well this time due to time limitations.

 

Comments

w4ffles
09. Dec 2015 · 05:52 UTC
This is the first time I’ve seen timbre.js, it looks really neat.

Timbre.js

I decided to make an audio-only web game, so I wanted to make sure I can manipulate sound well. I found a library which can do this called Timbre.js.

So yes, I committed the sin of trying to learn a new library to use for this LD.

The library allows you to chain effects and sounds together, kind of like BuzzMachines or Ableton Live. So for example you can start playing a sound, then feed that through an effect to make it sound muffled, then feed that through another effect to add an echo to it and so on.

This way you can create a rich sound environment that can be changed on the fly. My game starts with you waking up from a coma, so initially sounds are muffled and confused, getting gradually better. Timbre makes stuff like that possible.

It’s very cool and has pretty good docs too, but it still took me a long time to figure things out. After 9 hours of learning I’m just finally getting the basics to work.

Narrative-based audio game

If you liked games such as The Beginner’s Guide, Dear Esther or Stanley Parable, try my audio-only single-button controlled “text adventure”:

One Button Suicide

The object of the game is to die. But it’s not easy when you are blind and paralyzed, only able to move a single finger.

This is probably the only Ludum Dare game which can be played with your eyes closed!