Inspired by the intricate patterns of microscopic life, this week, my latest sketch offers a visual interactive exploration of the cellular automata ecosystem.
Inspiration: Microscopic Organisms Under the Microscope
The project draws inspiration from the mesmerizing appearance of microscopic organisms observed under a microscope. The delicate dance of amoeba, the vibrant hues of microorganisms, and their ever-changing patterns became the driving force behind creating a dynamic simulation using the p5.js library.
The overarching theme revolves around simulating an artistic ecosystem where each cell represents a microscopic organism. The cells evolve based on a set of rules, creating visually appealing patterns reminiscent of the microscopic world. The color palette, cell shapes, and interactive features are carefully curated to capture the essence of this microscopic realm.
Iterations
Scroll on touchpad – First I set out to build the main interactions of the project. I wanted to mimic the motion of magnification do when using a microscope. To zoom in and out if the sample. I did this by controlling the size of cells using the scrolling on touchpads. This was it looks as if we are sliding through different magnification lenses on the microscopic, examining the microbes.
Mouse click – this restarts the sketch on every left click.
Color scheme and figure – Next I focused on making the appearances more like the microorganisms I am used to seeing. I created two versions.
Lastly I also played around with the rulesets. Below is one I found particularly interesting.
Technical Aspects: Bringing the Microscopic World to Life
Code Snippet: Cellular Automata Ruleset
function updateCellState(x, y, neighbors) { if (board[x][y].state == 1 && (neighbors < 2 || neighbors > 5)) { // Any live cell with fewer than 2 or more than 5 neighbors dies board[x][y].state = 0; } else if (board[x][y].state == 0 && neighbors == 3) { // Any dead cell with exactly 3 neighbors becomes alive board[x][y].state = 1; } // Otherwise, the cell state remains unchanged }
This code snippet showcases the heart of the simulation – the ruleset governing the evolution of each cell. By adjusting these rules, we can create a myriad of fascinating patterns resembling the behaviors of microscopic life.
The updatecellstate() function encapsulates the logic, taking into account the current state of the cell, the number of neighbors, and applying the rules to simulate the dynamic evolution of the cellular automaton.
Challenges Faced: Iterative Refinement and Debugging
Throughout the development process, one of the main challenges was fine-tuning the ruleset to strike a balance between creating visually engaging patterns and ensuring interactive responsiveness. Debugging intricate interactions within the cellular automaton required iterative refinement and careful consideration of the aesthetic and thematic goals.
Future Improvements: Dynamic Interactivity and Realistic Simulation
As I look ahead, future improvements could include enhancing the interactive elements, such as introducing dynamic user-controlled parameters or integrating more realistic simulations of microscopic behaviors. Exploring optimizations for larger-scale simulations and incorporating additional visual elements would further enrich the immersive experience.