15
10/2010

Softbody Physics - Demo

Written by arthur

I have always been fascinated by physics simulation - in real time. And when games are mixing physics simulation with traditional gameplay, it give often really good games! My main references are locoroco, gish, world of goo and even bridge builder, this is what I tried to make possible with my own physics engine. I made a few things with that engine, but I didn't release the source code, mainly because it's not clean enough, but you can still enjoy the demos.

Blob - Nintendo DS
blob
The goal of this demo was to be the closest of what we find in locoroco, but for the Nintendo DS. Unfortunately it doesn't succeed, but it's still nice to see physics simulation running on such limited hardware.
Download the demo.

Bridge Builder - World of Goo like - Nintendo DS
blob
Well, this is an unfinished bridge-builder/world of goo like for the nintendo ds, you place points with the stylus and all the structure is moving.
Download the demo.

Blob Volley - Windows
blob
Another example of what my engine is capable of. It was a game which was targeted to be released on gp2x, but I have never finished it. But you can still enjoy the windows work in progress!
Download the demo.

Technical tips
It is all about a spring/mass physics problem. I use a simple euler method for integration, it can be inacurate but the result is almost the same as a Runge-Kutta 4 method in a game. I also use a fixed timestep for the simulation, it is often more convenient if you don't think your simulation could have a drop in performance.
I think I can sum up a softbody physics engine by the code below. If you have any question or tips you want to share, don't hesitate to post a comment!
typedef struct {
    float px, py, vx, vy, ax, ay, mass, fx, fy, last_px, last_py;
} Mass;

typedef struct {
    float d, k;
    Mass* a;
    Mass* b;
} Spring;

void mass_update(Mass *m, float dt) 
{
    float inv_mass = 1.0f / m->mass;
    m->ax = m->fx * inv_mass;
    m->ay = m->fy * inv_mass;

    m->vx += m->ax * dt;
    m->vy += m->ay * dt;

    m->last_px = m->px;
    m->last_py = m->py;

    m->px += m->vx * dt;
    m->py += m->vy * dt;

    m->fx = m->fy = 0;
}

void spring_update(Spring* s)
{
    float distance = sqrtf((s->a->px - s->b->px) * (s->a->px - s->b->px) + (s->a->py - s->b->py) * (s->a->py - s->b->py));
    float delta_distance = distance - s->d;

    if(distance > EPSILON)
    {
        float inv_distance = 1.0f / distance;
        float ex = (s->a->px - s->b->px) * inv_distance;
        float ey = (s->a->py - s->b->py) * inv_distance;

        s->a->fx -= ex * s->k * delta_distance;
        s->a->fy -= ey * s->k * delta_distance;
        s->b->fx += ex * s->k * delta_distance;
        s->b->fy += ey * s->k * delta_distance;
    }
}

Categorie : Projects - Tags : physics, soft, simulation, blob, pc, c++ - no comments

13
09/2009

dududu - a game with birds

Written by arthur


dududu


Hmm... Another unfinished game! But in this one I made everything: code and graphics. The story and the theme is quite inconsistent but it's fun. We shoot on birds with a plane, is it a problem?!
When I started this game the nintendo homebrew scene was slowing down, so as my interest in this gaming platform. So I decided to make this game work in browser. At this time, WebGL wasn't really working, so I developed it in Flash. You can also get more information about the game in this forum thread (in french).

Categorie : Projects - Tags : nintendo ds, 3d, dududu, birds, flash, as3 - no comments

23
09/2008

Magic Touch - Nintendo DS

Written by arthur

magic touch

Magic Touch is an original game by Nitrome. I don't take credit for it, I just made the DS port. Nitrome allowed me to release this game as long as I don't make money with it. I don't intend to, so here is the game!!
I take this game as a challenge, I was very interested in doing the gesture recognition. I thought this game would be perfect with the DS, and then I adapted it to the Nintendo DS. The result works pretty well, I hope you'll enjoy this game!

Download Magic Touch for Nintendo DS

Categorie : Projects - Tags : nintendo ds, homebrew, magic, touch, nitrome - 1 comment

07
09/2008

Crocodingus In Cube Island - Nintendo DS

Written by arthur


Crocodinugs is a game I worked on during the summer in 2008. It's the result of two intensive months of development with madpxl. So, this game was made with a custom 3d engine, which I developed for the limited hardware of the Nintendo DS. Yet, the result is nice, and it runs at a smooth 60fps!

The game
You control the crocodile using the stylus, your goal is to catch all bananas(crocodiles eat bananas, it's well kown) and stars. Beware of monkeys, they can kill you if you're not watchful enough, of course you can get rid of them using your tail (very logical, I know). Well, this game can be sometimes tricky, so be careful not to get stuck when you are moving a crate!

The technical side of Crocodingus
  • A game made in collaboration with Madpxl in two months.
  • A custom 3D engine for the Nintendo DS:
    • Textures management (paletted, alpha-blended)
    • MD2 animation loading
    • OBJ loading and conversion to display list
    • Dynamic third person camera
    • Culling
  • Easy level creation with Mappy (a tilemap editor)
  • 60 frames per second guaranteed!

Links and download

Categorie : Projects - Tags : nintendo ds, homebrew, 3d, c++ - no comments

10
04/2007

A tribute to the GBA

Written by arthur

Well, I guess the GBA is one of my favorite gaming system (especially the 20th Anniversary Game Boy Micro!). I have always dreamed to make games for this device. So these games are my tribute to the GBA, I hope you'll enjoy them!

HotelHaut
HotelHaut gba

If you have played more than one time at reversi this game shouldn't be difficult for you. The AI is quite minimalistic but for average players (like me!) it is hard enough.
Download HotelHaut for GBA.

Oleminant
Oleminant gba

Oh! Another puzzle game! This kind of puzzle game is very common, but there wasn't any on the GBA, so I decided to make one. Rules are simple: you have to delete all balls in making rows or columns of each color. And be careful, you have a limited amount of trials! The concept and levels are from Riza Purwo Nugroho.
Download Oleminant for GBA.

Categorie : Projects - Tags : gba, homebrew, game, puzzle - no comments

previouspage 2 of 2