Part 1
Ruiqi Zhuang: Light of Civilization–Create Your City and Light it up!
Elevator Pitch:
Light of civilization enables you to simply customize a city by drawing the main roads of it and light it up with a click on the key “L”. It aims at mimicking the light effect of a city at night and inform people how great and beautiful human civilization is.
Abstract:
The project is inspired by a trip on the plane at night, when I was sitting next to the window an look out of it, I was really impressed by the beautiful scenery of the big cities lighten up. At that time, I was totally amazed as how great human civilization is: we totally changed the planet, making night no longer dark, and I wanted to convey this kind of feeling of amazed and surprised to my audience, that’s why I created the project. The users can draw some lines on the canvas, which will act as the main roads of the city, which can also be interpreted as city planning and designing. After they finish designing and press the key, the city gradually light up, and finally create a great picture with the combination of lines and dots, just like a myriad twinkling lights of a city.Upon looking at these, the audience may feel surprised and “wow” at first, and then be amazed at the final picture they “created”. I hope people will know how much great it is to make simple villages into metropolitans, now it’s only some simple manipulation, but it’s actually the work of hundreds of generations of people, we should really appreciate and cherish the beauty nowadays.
Part 2
Design and Composition:
When I read the prompt for the first time, I had the idea of drawing the city at night, because that’s what can be presented with particles and lines while considered as beautiful and meaningful. My original idea is to randomly generate lines and dots, but that seems to be lack of interaction, so one way of improvement is to let users decide several dots, and I generate those lines around the dots, but the same, the interaction is not enough: the decision users made didn’t really pose a strong effect on the final work. With these concerns, I finally made the decision of using lines to demonstrate the main road of the city, and generate the rest of the road and the light. Under that circumstance, the users will feel like they are actually drawing, and what they have drawn will bring them a surprise by being converted into some beautiful light effects.
While making the project, at first, I generated horizontal and vertical straight lines like this, which does worked, but not satisfying.
I added some lines that are oblique and make them connect with the vertical or horizontal lines, so that there could be more changes to the lines while not being chaotic. Like this:
Now that the roads resembles the roads in a city, the only problem is the color and the density of light. I did a lot of research of color, including asking Chat GPT, and found the most appropriate value. For the density of light, I tried a lot of values and the range it will generate before make my decision. I tried to let the light somehow blink, but since they are all randomly generated, so its control single ones, meanwhile, letting every light blink will ruin the feeling of looking at a city, so I abandoned this.
Also, I was thinking adding a prototype function, by pressing “p”, one can see the extra generated road in black on the white canvas, but during user testing, Sam said it will ruin the feeling of surprise, which I agree, so I didn’t put this into effect in the final version, but the code was still there, I use “/*” and “*/” to ignore that.
Then the final version is clear, the users draw lines on the canvas, after drawing, they press the key “L” to generate the city, they can also use the key “A” to add more lights to the city.
Besides, when making this, I developed a follow up project with similar visual effects.They look beautiful and can be further developed. The code of this is: https://editor.p5js.org/zzrrqqq/sketches/B3iBGp891
Technical:
The whole coding process went smooth. I first wrote the code of drawing on the canvas and convert it into a different color gradually upon pressing a key, which is the most difficult and important part of my project. I encountered a lot of problems with this including being unable to store the line drawn, failed to change the color of each one. After studying, I found that I can store the value of mouseX, mouseY, pmouseX, pmouseY into one class of an array, so that it can show the line drawn by the user under one case, while changing the color and implementing other changes when it was in another case. For gradually lit up, I used the original function of Draw(){}, which can work repeatedly. I Created a universal variable, let it equals to itself plus one every time, and function the corresponding element in the array. Fortunately, these approaches all worked. After addressing this main problem, the rest of the work is more about polishing and decorate it, together with making it more interactive.
As was addressed before, I changed the mode of the additional lines were generated from generating horizontal and vertical ones to a more complex mode. For this part, I added a random value “this.r” in the class, different values of “this.r” indicates different ways of the generating lines. Working with the “if”code, I managed to let every point of the main road randomly choose a way of generating additional lines.
What I didn’t manage to achieve is to let some of the light to blink so that the whole picture look more like a city’s light. The reason for this is that the lights are totally generated in the class, so I can’t control individual ones, besides, the code of generating lights only function once at a time, so it’s impossible to change the color or the blend value from time to time.
Since now every move is actually in a single class in my code, If I have the chance to do the whole thing over again, I will try to create more objects, and put different modes of changing into different classes, so that I can get better control to every move. With that move, I can have the chance to change the colors of the roads and of course let the lights blink.Also, I can reduce the number of the lights, for now I am only able to generate more lights at random places.
Reflection and Future Developement
The whole process went quite well, it mostly presented what I wanted to present, what went well is the coding process and the interaction, I didn’t encounter any problem that is too hard to solve, which means I can stick to my idea and improve it. I solved most of the coding problems myself, and with professor Moon’s help, I managed to find a way of translating the color of the line the users have drawn. Also, the interaction did provided the feeling I want: a surprise change and the gradually lighten up city.
What still needs to be improved is how the final picture actually resembles the image of a city, although it can be considered as an abstract version of the city at night, it maybe still not that clear. When doing the peer review, Benson said he was quite confused, I think that’s maybe because the light are not blinking and they should be in different shape and color, also the road are more complex, there maybe overpass or other more complex structures. All in all, there should be more specific details to imply that it is a city.
Other suggestions I received during peer review includes change the color of the roads, add more red to it to make it more like the color of road light; add an instruction so that users know what they can do; let the light blink; add the function of editing again. I addressed the first two, failed to let the lights blink, and for the function of editing, my opinion is that its really hard to totally change the overview of the city, so it’s not suitable to enlarge the city after one had already generated one, that is against my initial purpose how great it is to create a big city like this.
For suggestion from professor Leon(hope I put down the right name), I really appreciate them, especially that instead of pressing the key “L”, the picture should generate automatically, for example, after there is no manipulation for five seconds, this will enhance the feeling of miracle and surprise. I’m with most of Sonny’s suggestions, for that of adding the instruction of “Press ‘A’ to add more light” on the completed canvas, I think that’s not the best way, because that will ruin the beauty of the picture. One way to do this is to follow Anya’s way of showing instruction: when pressing a key the instruction appears and with another press it will disappear.
Besides skills of coding with objects, I also learnt some other things during designing. One of the important one is always think in the user’s shoes, as I said before, I planned to add a prototype function to it, but actually that’s just a good way of adding interaction for me, who is more than familiar with the project, actually that will ruin user’s feeling of surprise. Another thing I learnt is always turn to others for feedback, since I made the project I will always think it’s a good one and may ignore those that are not perfect with it. So I actually ask my parents and my friends who don’t know anything about p5 and my project to judge it, which helped me find a lot of problems.
Overall, I think my project the civilization is a success, I did learnt a lot during designing and coding