11
Jan/09
10

Ponstructor beta release!

Since the last post I’ve been quietly working on a real good version of the bridge builder game for flash.  Take a look at the result after the ‘Continue Reading’ link and tell me what you think, (or if you spotted a bug) in the comments.

28
Dec/08
2

Bridge Builder Game! (Concept)

Constraint based bridge simulator

Constraint based bridge simulator

Some of you might remember a game called pontifex or bridge builder if you don’t; it’s a game in which you construct a bridge with beams and than let a train or car drive over it to see whether it holds. It is really fun and quite educational at the same time (equals morally appropriate right?). After some more research into rigid body constraints I found out that pontifex probably used the same stuff like I used in the 2D constraint based rope. So with some minor modifications it was easy to create a bridge simulator and with a littlebit more code even a bridge builder. It is still far from a game suitable for release and profit but it is definatly a playable minigame. Take a look at the working example by clicking the  ‘Continue Reading’ link.

26
Dec/08
19

2D Constraint based rope

Constraint based rope simulation

Constraint based rope simulation

So I was looking into some cool stuff to do with my 3D engine when I came across this. I’ve always been a fan of physics simulation based realism so I began to work this out in 2D. The first demo was using elastic constraints between particles but that made a very instable system. It can be improved with better integrators like RK4 but that still didn’t result in the desired result. I might have other plans for these elastic constraints later though. You can read more about elastic constraints here [Gaffer's tutorial on spring physics] and here [Gamasutra's "Exploring spring models"]. So I went on with inelastic infinitely ’stiff’ constraints which were mentioned in this ["Advanced Character Physics" by Thomas Jakobsen] great resource on computer physics simulation. The result worked out pretty well and will be easy to port to 3D. Which will happen when I’m done with a little (very interesting) side project using the same code. More about that later… Check out the working demo after the ‘Continue Reading’ link.

19
Aug/08
0

Proof of concept: Flexible 2D Particle System

Something very powerfull for creating reallistic and flexible effects is a particle system. This is a flexible and basic particle system I created about 2 months ago. Again this is just a proof of concept, currently the max. number of particles is about 400-500. But this can be greatly increased by removing the blur and replacing it with an image, this would however make it lose some of it’s flexibility. Below is a smoke demo, but the posibilities are endless, steam, fire, explosions to name a few…

Usage is as follows:
[sourcecode language='actionscript']import com.particles.particleSystem;

var scene:particleSystem = new particleSystem();
this.addChild(scene);
scene.pX = 40; // The x-position of the particle’s source
scene.pY = 50; // The y-position of the particle’s source
scene.vY = 0; // The speed on the y axis (can also be negative)
scene.vX = 4; // The speed on the x axis (can also be negative)
scene.deviation = 2; // The possible deviation from the standard speed
scene.transparency = 1; // The transparency of the particles (levels lower than 1 greatly deteriorate the performance
scene.color = 0×000000; // Colour of the particles
scene.lifetime = 5000; // Lifetime of the particles in milliseconds
scene.size = 10; // Size of the particles
scene.maxParticles = 300; // Maximum number of particles
scene.startBlur = 10; // The amount of blur
scene.bExplode = false; // Set this to true if you want to let the particles all explode at once

scene.start();[/sourcecode]
There is still quite some room for improvement, especially getting to know when to stop the particle system is a bit tricky.

Download the Particle System class