Posts under “Flash Studies”

Diffusion Limited Aggregation : Inverted ( with source )

Here we extend our Diffusion Limited Aggregation to invert the growth model. This one would not be able to grow indefinately due to the limited space. However it still is captivating and reminds me of growths inside a petri dish. This requires Flash 8. This was done purely using FlashDevelop and MTASC and includes the project file.

Diffusion Limited Aggregation : Quad Start (with source)

Here we extend our Diffusion Limited Aggregation to provide four initial seeds instead of just one, in the interest of comparison. The growth model does not change tremendously, but it does yeild some differences compared to a larger central seed. It seems that quite often the different seed growths will stay separated, forming sometimes intricate channels. And other times you will see them join up - though if they join they will typically do it earlier in the development of that...

Diffusion Limited Aggregation : Fractal Growth Model

This is a simple demonstration of Diffusion Limited Aggregation, which is a fractal growth model. It can be found in both living and non-living structures such as coral and snowflakes. The basic idea is to take an initial seed in the environment, then present other seeds which wander - in this example using simplified brownian motion. If the particle wanders outside the acceptable radius, it is killed and a new one spawned to take it's place. If it hits an existing structure, it sticks, and a...

Steering Behaviors in Flash 8

I spent a little time converting some of the steering behaviors over to Flash 8 format, and I must say it never ceases to amaze me how much the flash player keeps improving. In strict speed tests I was able to have around 30 automata avoiding each other and several obstacles on the field with acceptable results - of course milage may vary. I also noticed that the 8.5 stand-alone player seems to be much faster than the 8.5 browser plugin. Bringing this to AS 3.0 would be a real treat. The...

Flash 8 : Perlin Noise Landscaping

Well, I finally got around to fleshing out something in Flash 8 and I must say I absolutely love the perlinNoise function! This is an adaptation of the fractal landscape generation (which was also recently re-written and optimized for a flash 7 version using random midpoint displacement) that uses perlinNoise to generate the height-map for the terrain. In addition, there are minor color variations to make it look a tad less plastic, blurring for land further in the distance, and...

Fractal Landscape Generation

Well, it seems that Kristin from Galaxy Goo has another great challenge up and running in the Galaxy Goo forums - fractal landscape generation in flash. Of course I couldn't resist giving it a shot, so I spent a couple of hours throwing something together. I didn't spend a lot of time on it, so the code isn't the cleanest (though it's fairly clean for a first pass). One of the things I would modify first in it though is to make the primary processing loop an iterative routine instead of a...

Automata Spaceship Progress

I spent a few hours on getting all the basics in place for the spaceship automata. Some of the code isn't the cleanest, as I kinda ended up getting into "code mode", but seems to do the trick for now. Currently the AI ships will: + Acquire the nearest target + Turn towards it + Fire if there's a reasonable chance of hitting + Thrust forward if too far away + Try and avoid the asteroids + Take evasive action if under fire In addition you can control your ship (the red one) using the...

Maze Generator Code

Uploaded some code into the studies section for generating mazes. It currently supports using either the Depth-First Search algorithm or Prim's Algorithm for generating mazes. The object can be invoked simply by using o = new maze(width, height, style);. In addition, a method is provided for detecting if a wall exists in a particular direction from a given cell (o.isWall(x, y, direction)) so you can either add your own solving agents to the maze or allow for user-controlled agents. Click to...

Automata as Art

I've placed another modification to the cellular automata under personal studies. This time, we take a random number of the ants and place them in our environment and vary the size of the markings they leave. Each time the file is reloaded, the lead ant has to go back to the source, allowing a temporary dissemination of the code it carries, reinserting the prime program. Each view of the file will result in different patterns due to a varying number of ants, a variance in the size of the grid...

More Cellular Automata Goodness

In a continuation of my earlier example of cellular automata, I was curious what would happen when adding a second entity into the fray, using the same set of rules. As it turns out, it can drastically change their behaviours. I've now witnessed several different things happen: The ants leave each other alone and eventually go into bridge building mode, like before. The ants interfere with each other and eventually cancel themselves out ending up back at their starting position. Sometimes...

Langton

Got interested in Langton's Ant recently, and decided to make a flash version of it. Langton's Ant is a 4-state, 2-dimensional Turing Machine that is the simplest example of 2-dimensional cellular automata. It follows a very simple set of rules (reference from wolfram mathworld: 1. If the ant is on a black square, it turns right 90° and moves forward one unit. 2. If the ant is on a white square, it turns left 90° and moves forward one unit. 3. When the ant leaves a square, it inverts the...

Steering - Obstacle Avoidance

Time for the next installation in the steering behaviors series of files. This time we take on some obstacle avoidance. Each creature is given a random skin and speed attribute. From there, they simply travel through the environment, putting out invisible feelers in front of them based on their range of vision (ROV). If one of their two feelers come in contact with an obstacle, then it figures out which way it needs to turn to avoid a collision. One thing of note in the source is how the...

IP Atlas Work

Well, it's very exciting to take a look at the IP Atlas and see people visiting from all over the world. So I decided to take a look in the database and was quite surprised at the sheer number of records that didn't have coordinates assigned to them that I would really like to see on the map (Japan, Hong Kong, Taiwan, Thailand, Greece, Austria, South Africa and more). I'll be spending some time tonight after my Hwa Rang Do class getting coordinates in there for those (using the latitude &...

Evasion Steering

This time, we add food that is alive and aware that it has a predator. This gives us two distinct entity classes: predator and prey. The predator wanders around in the environment, constantly seeking out the nearest food source to feed it's voracious appetite for killing. Meanwhile, the happy, innocent little prey saunter along (exhibiting wandering behavior) until they get spooked by the predator coming within their danger zone (range of vision). When the predator is within range of vision...

Steering Behavior - Survival

I've put up another file in the series on steering behavior. This one builds off the last one, still showing seeking behavior with an additional attribute for health. The characters have differences in their attributes: One of them is slower with better agility, while the other is faster with a lower agility and narrower field of vision (FOV). The characters both have a decay rate which steadily decreases but is boosted by food, so now they have a need to seek out nutrition. The characters...

Steering Behavior - Seek

As promised, another file demonstrating seek behavior for autonomous creatures is up. The characters now have four attributes: speed, agility, field of vision (FOV) and range of vision (ROV). The two new attributes are used so the characters can seek out food. If a food pellet is within visual range, the character will turn and seek the food. Otherwise, the character will exhibit wandering as in the previous example. When a creature touches the pellet, it is considered eaten. Once consumed,...

Steering Behavior - Wandering

Put up a basic file to demonstrate basic wandering steering behavior for characters. The characters have no purpose, but the steering force in one frame affects the steering force in the next. This gives a more natural appearance to the movement than simply choosing a new vector each frame, or using simply brownian movement on a particle (though that too has it's use). I aim to make at least a small series of files building on the concepts for autonomy, probably with the next installation...

Smooth Resizing

Threw together a sample file today in response to a question to demonstrate sizing a box like you can find on http://www.nooflat.nu/ and http://www.ankerbedding.com/magnitude/index2.htm. The file is up under Source / Studies or you can view it directly here.

IP Atlas

Updated the IP Atlas to show the information for the various visitors and also added distance calculations using the Haversine Formula. I want to tweak some of the back-end stuff before I release the source code. In the meantime, you can check it out here.