WP2WS – W02 – Firefly (Force)

For this week’s assignment, we have learned basic knowledge about forces and practiced them.

Code

Inspiration

Since I decided to code about fireflies, I did some researches on it. Different from the gravitational attraction we have practiced in class, fireflies have a tiny mass and move relatively random, won’t be attracted by each other (cause the lighted fireflies are all males). They will sometimes gather to form a large scale to attract females. From the documentary, you can find a small light you can use, but make sure not to use a blue-tinged light. A keychain LED flashlight is a perfect choice. 

Technical

The two forces I am applying to the fireflies particles are the attraction between particles and the torchlight (user’s mouse), and the wind slightly blowing up from the ground. 

Difficulty & Progress

The first difficulty is that since I want to create attraction between the particles and the mouse position, the mouse position has to be assigned when calling the function. Therefore, the object of the function inside the class needs to be defined as a vector input for it to work.

The second is about acceleration. As mentioned above, how fireflies fly & get attracted in my mind is different from how planets rotate and attracted. I don’t want gravitational attraction – which means I want the insects to keep their original velocity or even slow down when approaching the mouse. At first, I thought limiting the velocity in update() would work, but it later turned out that all the particles will stick together due to the slowness.

all the particles sticking together

To solve this situation, I increased the velocity limitation, also added the applyWind() to add some upward movements to the particles, which is inspired by the street lamp out of the school back gate (If you have observed them you will find the insects keep flying randomly some distance above the lamp). 

Then I started to think about accelerations. I finally realized that acceleration is a vector, its number won’t be negative. Thus I changed it into an avoid function, trying to imitate that insects are avoiding the light because of its heat.

For the visual effect, I felt like pure yellow circles are too dull so I referred to the stars blinking effect, where the circle’s scale will change according to the time. I also apply this to the flashlight (mouse) later to achieve a better consistency. The reference is shown below.

Reference

https://editor.p5js.org/slow_izzm/sketches/AzyByxCgt

https://editor.p5js.org/wvnl/sketches/5wnuHAXKd

CGDD – W02 – FPS Game (Save Pet Home!)

For this week’s assignment, I made an FPS game based on the Unity template. The process without coding is pretty enjoyable according to my experience.

Game Link

Initial Proposal

“The player will mainly have an experience of shooting monsters and then will be able to save those little animals who were turned to the monster. Players will also be able to explore the area and reveal some secrets behind the manor.”

Based on my proposal, Professor Zhang gave me a suggestion on developing customized enemies/pickups/loot from the tutorial. He also suggested I simplify the second part due to the time limitation, so I didn’t elaborate on it in the game.

Progress

The first step is to replace the enemies and loot to the models I want. It is relatively easy in this part, just to make sure to place the model at the right place in the hierarchy. Following the tutorial, I created a few different dog/cat loot and pickups, including the mushroom in the park and the jetpack pick up later. 

Turret Enemy
Dog Health Pickup
Cat Health Loot
Chicken Jetpack Pickup

Along with the different models for picking-up, to better fit the theme, I also replaced the logo indicating the blood/jetpack capacity.

The second step is the scene design. Since it is a pet home and the movie 爱宠大机密 inspires me, I am trying to make the interior scene look soft. Thus, I added many pillows and clouds in the room and set the general color theme relatively positive. The big empty space out of the rooms is changed to an outdoor park for players to find jetpack/explore the story of the game (In the first version, there is a clue on the wall to make sure the player won’t miss the park).

The Park

Major Difficulties

The first difficulty is that since I was arranging new models for the loot, some of them are flying due to the length between the center and model. Recenter the axis center will be helpful.

Dog Flying

The second is that the turret monster model is not rotating like the original one, which makes it look fake. Professor Zhang helped me figure out that the model needs to be placed under Turrent_pivot_C_Jnt to make it rotate.

The third is about post-processing. It won’t work unless the layer selection under the camera and the layer category of the volume is the same.

Last but not least, about publishing. I spent nearly two hours on it, as it will show “internal server error” every time after I finished uploading. Later I figured out that once the file size is over 100M, it won’t enter the processing stage. You have to delete extra assets in the project. 

Improvement

Firstly I show the game to my friend who is not taking CGDD, and he thought that the monster’s 判定点 (I even asked him what does that mean) is too narrow. Limited by the original hover model, the hitting box is tiny, so many attacks do not count. He also thinks that the player’s view is too low, but when I changed it over 2 the player got stuck in the gate… which makes no sense 🙁

And after I published the first version, feedback from Yang Zhao inspired me so I added the road part till the final fighting ground, which makes the jetpack necessary, also motivates the player to explore the park area.

Road to the Final Ground

Resource

https://www.cgtrader.com/

https://sketchfab.com/feed

www.freesound.org