crowd simulation and auto-walking algorithms

5

Click here to load reader

Upload: joshwedlake

Post on 03-Apr-2015

1.074 views

Category:

Documents


0 download

DESCRIPTION

An overview of the algorithms used in my implementation of crowd simulation, auto-walking and 'scribbler' image processing. See the video demo here http://vimeo.com/19078611

TRANSCRIPT

Page 1: Crowd Simulation and Auto-Walking Algorithms

Unless otherwise disrupted each insect will aim to keep walking straight ahead

Every insect repels

its neighbours to

avoid collisions

Every insect looks

for ‘escape routes’ in case of collision

In a collision an insect hit in the back will not stop moving, but an insect which runs into another insect will.

‘Controllers’, for example attract, vortex and direct, can be used to explicitly control the insects.

“Spiders”

I produced this video as a demonstration of various programs I am writing. The spiders are controlled using my own crowd simulation algorithm, outlined below. Data from this is fed into my multi-leg auto-walker. The renders are processed using custom ‘scribbling’ code I developed based on an algorithm by zefrank. I sampled the motion paths to produce waveforms, and combined the result with an audiopaint process.

Page 2: Crowd Simulation and Auto-Walking Algorithms

‘Panic’ causes random variation in the movement.

‘Flock centre’ causes each insect to head for a central position between its neighbours.

‘Herd’ causes insects to align to their neighbours.

An insect which has been collided with will panic.

An insect which has been blocked in will sleep.

‘Emotions’ can also be manually adjusted using controllers.

Data generated by the insect crowd simulator can then be visualised as motion paths, adjusted, smoothed, and then fed into the auto-walker script.

Page 3: Crowd Simulation and Auto-Walking Algorithms

Auto-Walker Algorithm

This is a simplified explanation of my auto-walker algorithm.It was used to animate all of the spiders in the demo.

body

guide pointsrotate with body

placed legs stay put

airborne legs head to the guide point to start with...

...then they extrapolate the motion vector of the guide points

Page 4: Crowd Simulation and Auto-Walking Algorithms

airborne legs become stationary when stray too far from their guides and vice versa.

group 1 group 2

To sequence the legs, the script keeps track of how long each leg has been airborne or placed for. A preferred leg order is given and at each frame this is compared to the current leg order. Legs are sped up or slowed down to correct the order.

raised legs placed legs repeats...

time raised

choose ‘easiest’ option

21 3 4 5 6 2/81/7 3/9actualorder

24 1 5 3 6 24 1preferredorder

+2

+1 -1 +1

-3

Page 5: Crowd Simulation and Auto-Walking Algorithms

...it then selects a few of these at random as start points...

...and looks around at neighbouring points for darker pixels...

...and tries a few random points further away...

...considering all of the options,each start point will then move on to only one pixel...

...remembering only darker pixels.

...and the algorithm repeats. On subsequent runs the algorithm prefers to jump to pixels in a similar direction to the last jump. It also avoids pixels which have already been ‘scribbled’ on.