Week1: Manifesto Draft-Hangkai Qian

Title: Life is for pleasure. 

  1. Life is limited,  but happiness is unlimited.
  2. Go for entertainment now.
  3. The reason why we bless suffering at some time is that suffering cannot be avoided.
  4. Your hardship towards something is just your fee to the pleasure.
  5. Pleasure can be constructed by physical things so that at some time a certain amount of money can give you pleasure.
  6. If you don’t have money or physical goods,you still can obtain happiness.
  7. Go for your inner world.
  8. Trying to learn things and explore yourself in your life, because you do not know if there exists pleasure in some fields you do not know.
  9. If you find something that cannot bring you happiness, then do not do that.
  10.  

Final Project:Chicken Little Is Afraid of Sky Falling Down-Hangkai Qian-Rudi

My Project on IMA Show
My Project on IMA Show!

Chicken Little is Afraid of Sky Falling Down-Hangkai Qian-Rudi

CONCEPTION AND DESIGN:

We have played so many games on our computers and phones and it seems normal for people to play games using multi-touch or keyboard and mouse. What I wanted to do is to change the way the players play this game (how the players interact with the game) from click or touch or something to move the whole body to act in order to control the object. The root of the games is the idea 3 in my proposal of getting the fruit on the top of the window. However, I find that If the fruit is only on the top of the window, then the whole gaming process time will be very slow, so I decided to make an infinite game with score system. Moreover, in my proposal, I said it will be two players ‘game. However, when I considered further, there are two bad things if it’s a two players game: firstly, lots of people who come to IMA show are alone, so that it will not be comfortable to compete with a stranger. Secondly, if I make a two-players game, the device will be extremely big. Also, with the score system, we are in fact already can compete with each other. So, in my final version, the game finally come up with a form of single player game. The game’s concept seems simple: the object flying up try to get rid of the obstacles falling from upward. I used a distance sensor, an accelerometer and a hair band to make this game. I want to make the game easy to play,so I chose these sensors. The player needs to wear a hair band with an accelerometer behind his/her head which will detect the angle of inclination and move the chicken Left, right and up and down.

FABRICATION AND PRODUCTION:

My final product is very different from what it is in user test. In my user test, the player cannot move on the y-axis and can only move through x-axis using a distance sensor. There are many feedbacks of my first version of product. Firstly, the height of different people is different, so that I have to adjust the height of the distance sensor to fit different users. Secondly, the velocity of the pillars is the same, so that it’s not like falling from up to down. Even more, they want to move on the y-axis and also, they do not know the story of the game. Luckily, Tristan gave me the story of chicken little and it fit very well in this game. So I changed my title from helicopter to “Chicken Little is Afraid of Sky Falling Down” (much cuter!) The biggest change is that I changed my sensor in the suggestion of Rudi. In fact, the biggest problem I got is that the distance sensor often lose track at some time, which tend to get choppy in the UI. So, I studied an afternoon trying to figure out how to use the 3-axis accelerometer to detect the movement of the user.

sketch

CONCLUSIONS:

My project’s goal is to create a gaming experience with the player’s body instead of interacting with mouse or keyboard or button. My inspiration comes from a game by Nintendo “RingFit Advanture”. In that game, player  need to move their body to continue the game. The project is align with my definition of interaction: the player receive the gaming animation and move their body in order to move the chicken on the screen, which is a continous loop. Moreover, a good interaction should create joy, and I think I had done it perfectly because all the players loved this game and want to try again when they finished.

Though it is a good interactive experience, there still exists something that need to be improved. Firstly, I used a hair band,which is unfriendly for the users with long hair because the hair band is hard for people with long hair to fit in… I didn’t expect it because both Rudi and me are short hair users… If I have more time I’ll change my design into a pair of glasses and put my sensors there so that it would be more easy for players to play.

Since I did my project alone, it is very hard for me to go over some difficulties, especially for coding (most of my project is on processing) at that time. But when I kept on working on it and ask fellows for help, I will finally get over those obstacles like class, OOP, boolean, switch,and the logic of checking position(quite hard to figure out! The chicken is moving through jumping, so that I shouldn’t write like if x=h but h-50<x<h+50),etc. I find it very interesting to work with my interactive project though it’s hard. When I finally accomplished my project, I felt true happiness that even bigger than when I play computer game! (Seriously!) And I’m really thrilled to see that my project runs perfectly and gain responses like “interesting!” that’s enough for me. That is my goal of my interactive final project.

ending

ring fit adventure

Recitation10 Object Oriented Programming by Hangkai Qian

To be honest,  I didn’t very understand OOP when I attended the lecture class though I have worked a long time on the example of Ball in the class, I still didn’t figure it out. So I attended the OOP class. In the class, I knew that the class has variables, constructor and functions. So I used them in my final processing game part: there is a helicopter flying up, and there are pillars worked as obstacles. I had very difficulties in building these blocks, because I couldn’t come up with a way to generate infinite blocks. Finally, referring to the example in the lecture class, I finally worked it out using ArrayList and add new  items every time and use for loop and i<p.size to generate different pillars.

Here is my code:

ArrayList<pillar> p= new ArrayList<pillar>();

void setup(){
size(350,800);

}

void draw(){

int m=millis();
stroke(40);

h.drawheli();
h.moveX();

for (int i = 0; i<p.size(); i++) {
p.get(i).drawPillar();
p.get(i).movePillar();

if (p.get(i).yPos==h.y) {
if (h.x>p.get(i).xPos && h.x<p.get(i).xPos+p.get(i).xh) {
end=true;
} else {
end=false;
}
}
}

if (m%1000<15) {
p.add(new pillar());
}
}

}

class pillar {
float xPos=0;
float yPos=0;
float xh;
pillar() {
xh=round(random(400));
yPos=0;
xPos=random(1400/3.7);
}
void drawPillar() {
stroke(252,0,0);
strokeWeight(15);
line(xPos, yPos, xPos+xh, yPos);

}
void movePillar(){
yPos=yPos+10;
}

}

Here is the video.

P.S. Above is only the code of the pillar. However in my video I included not only pillars

Recitation 9 by Hangkai Qian

In my recitation, I planned to use two potentiometers to control the image in the Processing. The first potentiometer is to control the size of the image, and the second potentiometer is to control the degree of the blur of the image.

At first, after I read the Powerpoint in the folder, I used the function “resize” to  change the size of the image and the grammar of “Resize” is photo.resize( , ).  However, a mistake happened. When I resize the picture for several times, the picture blur a little. So I know the resize function will change the function, which leads to the change of the picture. Therefore, later I chose another function which do not  change the image: 

image(photo,0,0,a);

Second, when I first use the code that can transfer data from Arduino to Processing, the error said the ArrayException. At first, I thought it was because of the number from Arduino exceed the range that Processing. However, when I asked Rudi, he said the number of the blur function couldn’t be so big. So I used 

float a=map(sensorValues[1],0,1024,0,40);

to make the number from Arduino smaller.

Here is my arduino code.

void setup() {
Serial.begin(9600);
}

void loop() {
int sensor1 = analogRead(A0);
int sensor2 = analogRead(A1);

// keep this format
Serial.print(sensor1);
Serial.print(“,”); // put comma between sensor values
Serial.print(sensor2);
Serial.println(); // add linefeed after sending the last sensor value

// too fast communication might cause some latency in Processing
// this delay resolves the issue.
delay(100);
}

Here is my processing code

import processing.serial.*;

String myString = null;
Serial myPort;
PImage photo;

int NUM_OF_VALUES = 2; /** YOU MUST CHANGE THIS ACCORDING TO YOUR PROJECT **/
int[] sensorValues; /** this array stores values from Arduino **/

void setup() {
size(500, 500);
background(0);
photo=loadImage(“12deeaa706628e537518aa533d6c8658.jpeg”);
setupSerial();
}

void draw() {
background(0);
updateSerial();
printArray(sensorValues);

image(photo, 0, 0,sensorValues[0],sensorValues[0]);//,width,height);
float a=map(sensorValues[1],0,1024,0,40);
println(“senmap!”,a);
filter(BLUR,a);

//
//filter(BLUR, sensorValues[1]);

// use the values like this!
// sensorValues[0]

// add your code

//
}

void setupSerial() {
printArray(Serial.list());
myPort = new Serial(this, Serial.list()[ 4 ], 9600);
// WARNING!
// You will definitely get an error here.
// Change the PORT_INDEX to 0 and try running it again.
// And then, check the list of the ports,
// find the port “/dev/cu.usbmodem—-” or “/dev/tty.usbmodem—-”
// and replace PORT_INDEX above with the index number of the port.

myPort.clear();
// Throw out the first reading,
// in case we started reading in the middle of a string from the sender.
myString = myPort.readStringUntil( 10 ); // 10 = ‘\n’ Linefeed in ASCII
myString = null;

sensorValues = new int[NUM_OF_VALUES];
}

void updateSerial() {
while (myPort.available() > 0) {
myString = myPort.readStringUntil( 10 ); // 10 = ‘\n’ Linefeed in ASCII
if (myString != null) {
String[] serialInArray = split(trim(myString), “,”);
if (serialInArray.length == NUM_OF_VALUES) {
for (int i=0; i<serialInArray.length; i++) {
sensorValues[i] = int(serialInArray[i]);
}
}
}
}
}

Here is my circuit:

circuit

Here is my video:

r9

Reading

In this week’s reading, the author talked about the development of Computer Image analysis. It showed that computer vision doesn’t only can be used in military and law-enforcement actions. One of the most impressive project based on the technology is called “Standards and Double Standards”, which can recognize the people in the room and make the belt rotate to face to the audience. The project used belts to represent people face to the audience using the tech.

What makes me think is that the game I want to make can use this technique to track the movement of the player in order to make them like moving the stick on the screen, but I’m not sure if I can manage to understand it.

   Source:Computer Vision for Artist and Designers

Essay of final project

Bouncing Ball Adventure

  • Project Statement

At first, I couldn’t figure out how to combine Arduino and Processing to make an interaction since if the Arduino is connected to the computer, then many characteristics like mobility will lose. Moreover, I think lots of interactions Arduino and Processing are the same and I don’t want to create something just to combine these two tools.

Then I considered the differences between the interaction that Arduino and Processing provided. Then I realize that Arduino can provide more physical interaction than the processing does, and processing can provide more visual interaction than Arduino does. For instance, on one hand, in Processing, the only physical interactions it can provide are just key pressed and mouse click, which is very boring and provide an unreal interaction compared to what Arduino provided. Also, Processing lack sensors to feel the environment. On the other hand, in Arduino, it can provide thousands of different sensors to feel the environment and make the interaction more interesting using different components. Nevertheless,Arduino can’t provide things like images and animations that can give the audience visual shock. (The very famous project “wooden mirror”(https://www.youtube.com/watch?v=Wb6eFGbwPeA))  Restricted by the reality physics rule, it can’t make things like a ball which can keep bouncing forever. However, the game with reality is more likely to be more interesting than the none-reality one. So, my idea comes here: to let the player play in reality, while they see their movement in the screen, and this is an interaction that forms a loop. This fits in the concept that I came up with in my last research. 

There are two differences after I heard the reflection from Rudi and other classmates.  The first difference is that I have changed the way to control this game. At the last time, I planned to used your hand to move in an area to control the block. However, I received some feedbacks of that this way is boring. I also received that it can be related to sports. So I rearranged the position of the distance sensor to detect the head instead of the moving hand to make sure the movement is bigger. The second difference is that I planned to set some barriers in the background and when the ball reach the barrier, the game lose. This set an uncertain factor in this game. 

game

The proposal is a game and the inspiration comes from the traditional bouncing ball example. I planned to divide the window into two parts: the left part is red, and the right part is blue and there is one ball of a different color bouncing in the space. There will be a block moving on the bottom of the window. Whoever managed to make the ball go to the other side will win. According to the reflection, I will also add some barriers like the black hole into the game

Here comes an interesting problem: how can we control the block? I planned to use a distance sensor to help you control the block. I will set an area where you can put the body in and the location of the block is decided by your position in the area. I think it will be an interesting game with a sports element and it is more practical to use.

2.1 Project Plan Step1 Processing

As stated above, the project is designed for two players to compete with each other, so the first step is to design a game for one player. The first thing to do in this step is to make the ball bounce in the space and make sure when the ball reaches a certain position, the ball will disappear and looks like it has bounced in a new space. In this part, I can use the code from our class about bouncing ball. The second thing I need to do is to make a moveable board that can rotate and when the ball touches the board. I haven’t come up with how can I make the code, but I think I can do it with the help of IMA fellows.

2.2 Project Plan Step2 Arduino

Compared to the code problem in Processing, the issue in Arduino seems easier to solve. What I need is just to use my experience during the mid-term and use a distance sensor to upload the data to Processing. Since my project is A to P, so the code in the Arduino Part is easier. To give the player response on that he/she has on the area, I plan to install a Green LED. When the distance sensor’s value is not the distance to the other side, the LED will be lightened up.

2.3 Project Plan Step3 Combined effort

This part is to combine Arduino and Processing, and moreover, double the work. The previous work is all about one-player issue, then in this step, I will consider the two-player game, which means I need to reduplicate the work if the previous steps doesn’t go wrong…

3.

First, my idea comes from traditional bouncing ball games but different from them in terms of the way of operating(the game is different, too!) And I was also inspired by the recent popular Nintendo’s Game: “Ring Fit Adventure”. This game used a ring to make the player interact and rank different games. I also want to make a similar game that combines computer world and reality.

ring fit adventure

Second, I also thought about the user interface. Since the other side and the ball are painted the same color and there is a hole in the “wall” of the two sides, it would be easy to know what the goal of the game is without much description. The idea of User Interface is in line with what I researched in the preparation for “Drone Collision Avoid System”(https://www.youtube.com/watch?v=L3l-zJafOncNo.4).

The meaning of my game is “achieving perfection”. The game wasn’t designed perfect when you play it, and the final goal of the game is to achieve perfection. This is the meaning I injected into the game. I also mentioned it in my group preparation.