terraineer SourceForge.net Logo

worms (plotting; particle deposition)
v0.1; caminoix; 02.07.2006
v0.2; caminoix; 10.07.2006
download source | binary

worms (plotting; particle deposition) heightmap; multiple mode (upper half averaged 10 times) worms (plotting; particle deposition) heightmap; single mode

this plugin works in two modes: single worm and multiple worms (default).

single worm mode
the basic idea is that you first choose a random point on the map (the worm/plotter position) and elevate the map at this point. than you move the plotter by one pixel in a random direction, and guess what? - yes, elevate the map at the new position. pretty easy, isn't it?

there's just one catch: with the above method, the plotter tends to get stuck in one of the corners. you know, it moves by one pixel in a random direction so there's not much chance it'll do a sudden raid back across the entire map. it's rather buzzing somewhere around one point. it can't get out of the map, so once it comes near a corner, it's very hard for it to get back closer to the centre.
a solution to this little spoiler is to make the plotter make a random jump from time to time. in this plugin, the probability of such a jump is represented by a variable called sJump. the higher it is, the lower the probability: a random number is generated from range 0-sJump; if it equals 0, a jump is made to a new random position.

multiple worms mode
the multiple worms mode is a simple extension of the above. the difference is that instead of one worm making a great number of steps, there are lots of shorter worms in various colours.
to be more precise: there are sWorms worms, each in a random color in range sColMin - sColMax and of a random length in range sLengthMin - sLengthMax.
multiple worms can also behave in two ways:
1. (overlay=false; default) they change the map where they are to their colour;
2. (overlay=true) they add their colour to the colour of the map at the given point.

konqueror  valid xhtml  valid css  nemerle  opensource  gpl