Project link: https://starwu123.github.io/CClab/project-a/
Project Dreams
Scientific Name: Somnivenator oniricas
When digesting, its body shifts through colors, briefly flickering with energy as it processes the dreams it consumes.
it uses two pointy, antenna-like sensors to feel its surroundings.
Likes to stay in dark moist corners of rooms.
Concept
In this project I wanted to create an interactive environment with my created creature using different techniques we have wen through during class. My environment idea revolves around a simulated environment that can generate differently organized bedrooms, replicating the normal human beings environment. In order to observe the creature behaviors, interacting with the environment. Users can send floating dream bubbles that appear to change the creatures color, potentially indicating its shift in emotions from its reactions.
Key Features and Functionality
One of the main features I wanted to include in my project is the randomization of the bedroom setup to play into the story that this is a setup environment and can be changed. So I first created a simple layout of the room in a way I liked, by just using simple shapes and lines. Each piece of furniture was able to be randomized or move to a different location 50 percent of the time.
After trying to move my sketch from the setup in the mini project into draw, I noticed the room was being looped and randomized in each loop. I fixed this by giving different variables to each furniture's X location or the paintings drawing and calling them in setup.
I also wanted this function to be more noticeable instead of refreshing the page to see the changes, so I added a generate room button. everytime you click the furnitures location will be randomized. This gave me the idea to build on my concept of a science lab more by adding two other buttons to generate dreams and a security camera on the top.
Another one of my key functions is the dream bubble interaction with my creature. When its night time the user can press the dream buttons to create a dream bubble and the creature will absorb this dream bubble, then turning into the dreams color. My first idea in creating this is to use a distance function that would sense the location of the creature and the dream bubble and when they collide, that would trigger the dream bubble becoming false. You use the mouse pressed function to activate the bubble then I added speed values to the dream bubble so it would float in the direction of the creature.
When the distance d becomes smaller than the sum of the bubble’s radius and the creature’s size, a collision is detected, and the dream state ends. The color transition is handled by using time, so when it is over 300 frames the creatures color changes.
The good dreams dream bubbles are a more colorful and lighter color, while the bad dreams are a darker color between gray and black.
For my creature I used push, translate, and pop that we learned in class to change or move the creature easily. At first while testing I set my creature as a simple circle. I used that circle and more ellipses to create the creature. I had to change the offset of those ellipses to be in the correct position since the origin of the creature was in the center. I also created the movement of my creature from using noise and sin values, so the creature would look like its floating and airy from its pulsing effect.
Feedback and critique
I received feedback from interaction day suggesting that the dreams could be represented with different colors and patterns to convey various emotions or states of mind, adding more variety in the reactions. After I did change the colors of the dreams to differentiate between good and bad dreams. Guest critiques during presentation also recommended incorporating additional interactions, like responding differently to the different colored dreams, to make the creature more engaging. These critiques can be further improvements that I can make to enhance the project I have now.
Technical Challenges
During the project, I faced several technical difficulties, particularly with getting the dream bubble interaction to work correctly. One challenge was ensuring the dream bubble detected when it reached the creature. I used the dist() function to calculate the distance between the bubble and the creature, but initially, it didn’t trigger the color change consistently. After some adjustments, I used an if statement to check if the distance was smaller than the sum of the creature’s size and the bubble’s radius
Another issue was with the noise function controlling the creature’s movement. I intended for the creature’s movement to feel more organic, but the noise values were not moving as i expected it to. I realized I needed to adjust the noise input using frame Count to get smoother, continuous motion.
I gained a better understanding of how noise functions and conditional statements work together to create fluid and interactive animations. Debugging these issues helped me become more comfortable recognizing errors and fixing them.
Lesson Learned
Through this project, I learned the basics of coding by using if and else statements to control how the creature and dream bubble interact. I used these functions to check when the dream bubble reaches the creature and trigger a color change. I also practiced using variables to store positions and sizes, and applied simple math to make objects move smoothly. Debugging and testing my code helped me understand how small changes can affect the whole animation. This experience made me more comfortable with writing and adjusting code to create interactive visuals.
Future Improvements
In the future, I would like to add more complexity to the creature’s behavior by giving it different reactions based on how often the dream bubble reaches it. Using additional if and else statements, I could introduce multiple color changes or movements to show different emotions. Another improvement could be refining the dream bubble’s movement using smoother noise functions for a more natural effect. These improvement of interactions or creatures movement could especially be included more in the morning. These changes would make the interaction more dynamic and engaging.