Train to Dubai User Testing

We’ve basically finished creating most of the fundamental mechanics behind our game. The things that we still need to work on are: polishing up our level designs, fixing some minor calibration and precision issues, and create an ending story to enhance the entire gaming experience. Through a series of user testings, we’ve identified some issues (listed below):

1. One type of zombie can only be killed when shot on the bottom half;

2.  Our IR computer vision set up works most optimally when the distance between the IR emitter and the receiver is within 1 meter (+/- 20cm). In order to facilitate for a more consistent user experience, I think it would be best if we created some sort of label on the floor to make sure the sensors are not outside of the optimal range.

3.  Insert an instructions page before the game begins.

4. Make the game a bit more challenging by either modifying the number of zombies, the zombies’ movements, or the allotted time. (Or a combination of everything.)

5. When running the game on Ross’s computer, we’ve noticed significant amounts of lag. We will consider running the game on a more powerful computer or even two computers with one responsible for the game and the other responsible for computer vision.

Computer Vision Response

This reading highlights a very important thing in the world of computing: the rapid and sustained growth of computational power over the past several decades. It is all thanks to this growth (outlined by Moore’s law) that the average creator/artist/student can now have easy access to platforms that enable complicated implementations such as the interactive computer vision artwork “Videoplace”.

As modern day computational technology (software & hardware) continues to advance, I wouldn’t be surprised to see several highly optimized and lightweight computer vision/virtual reality based platforms take over the gaming and online collaboration model. Inshallah.

What Computing Means to Me

This may sound kind of sad, but my computers (iPhone and MacBook) are my best friends. Wherever I go, my computers are always by my side. They are with me 24/7, through the happiest and the most depressing days. No matter how much I abuse them, they will never forsake me. They’ve played a crucial role in enabling almost everything I’ve ever done. This is why I’ve always been willing to spend a little extra to purchase the best version of my “best friends”.

Many of us born in the late 1990s have never known what life was like without computers. We’ve taken for granted mankind’s most monumental invention and all the conveniences that come with it. Computers are the greatest enablers in the world, facilitating for the creation of almost everything ranging from art to war machines. Intro to IM is the first time that I’ve been able to interact with the secret world of basic physical computing. To say that it’s been eye-opening would be an understatement.

Arduino + Processing = Lit

For this week’s assignment, I added a physical controller in the form of a joystick to my Snake game. The joystick had 3 outputs (analog x-coordinate, analog y-coordinate, and digital click) so it was a bit difficult to get everything right in the beginning.

I ran into some more issues when trying to connect the controller output to the processing game code: the joystick values were just not being updated into the game. I tried printing out the values generated by the joystick and they were correct. Honestly had no clue why the snake just wouldn’t turn. Oh stubborn snake. Upon closer inspection, there seemed to be a 2-ish second delay between the commencement of the game and the updating of the value generated by the joystick into the game. I added a 2 second delay to the beginning of the game and everything seems to work now. Mashallah

Here is a video demonstration of my game:

Here is my code:

import processing.serial.*;

Serial myPort;
//int[] dataIn = new int[2]; // a list to hold data from the serial ports

ArrayList<Integer> positionsX = new ArrayList<Integer>();
ArrayList<Integer> positionsY = new ArrayList<Integer>();

int dimSquare = 40;
int xPos = 0;
int yPos = 0;
int poo = 0;
int internalInput = -1;
int dim = 800;
int positionX = 5;
int positionY = 5;
int foodX = 15;
int foodY = 15;
int [] dirX = {1,-1,0,0};
int [] dirY = {0,0,1,-1};
int direction = 0;
int speedOfGame = 10;
boolean gameover = false;

class gameBoard{
gameBoard(){}

void drawLines(){
noFill();
stroke(0);
strokeWeight(1);
for(int i = 0; i < dim; i++){
line(dimSquare*i, 0, dimSquare*i, dim);
line(0, dimSquare*i, dim, dimSquare*i);
}
}
}

class snake{
snake(){
positionX = positionX*dimSquare;
positionY = positionY*dimSquare;
}

void drawSnake(){
fill(0,255,0);
noStroke();
for(int i = 0; i < positionsX.size() ; i++){
rect(positionsX.get(i)*dimSquare, positionsY.get(i)*dimSquare, dimSquare, dimSquare);
}
if(frameCount % speedOfGame == 0){
positionsX.add(0, positionsX.get(0) + dirX[direction]);
positionsY.add(0, positionsY.get(0) + dirY[direction]);
//positionsX.add(0, dirX[direction]);
//positionsY.add(0, dirY[direction]);
positionsX.remove(positionsX.size() – 1);
positionsY.remove(positionsY.size() – 1);
}
}

void growSnake(){
positionsX.add(1, positionsX.get(0) + dirX[direction]);
positionsY.add(1, positionsY.get(0) + dirY[direction]);
}
}

class food{
food(){
}

void drawFood(){
fill(255, 0, 0);
rect(foodX*dimSquare, foodY*dimSquare, dimSquare, dimSquare);
}
}

gameBoard a;
snake b;
food c;

void setup(){
size(802, 802);
printArray(Serial.list());
String portname=Serial.list()[8];
println(portname);
myPort = new Serial(this,portname,9600);
myPort.clear();
myPort.bufferUntil(‘\n’);
a = new gameBoard();
b = new snake();
c = new food();
positionsX.add(5);
positionsY.add(5);
delay(2000);
}

void draw(){

if(gameover == false){
background(255);
//delay(30);
//a.drawLines();
b.drawSnake();
c.drawFood();
if(positionsX.get(0) == foodX && positionsY.get(0) == foodY){
foodX = (int)random(0,20);
foodY = (int)random(0,20);
b.growSnake();
}
if(positionsX.get(0) < 0 || positionsY.get(0) < 0 || positionsX.get(0) >= 20 || positionsY.get(0) >= 20){
gameover = true;
fill(0);
textSize(30);
textAlign(CENTER);
text(“GAME OVER.”,width/2,height/2);
}
if(positionsX.size() == 20){
gameover = true;
fill(0);
textSize(30);
textAlign(CENTER);
text(“YOU WINNNNN.”,width/2,height/2);
}
}

if(xPos == 1023){
internalInput = 0;
}
if(xPos == 0){
internalInput = 1;
}
if(yPos == 1023){
internalInput = 2;
}
if(yPos == 0){
internalInput = 3;
}
if(internalInput != -1){
direction = internalInput;
}

//println(xPos);
//println(yPos);

}

void serialEvent(Serial myPort){
String temp=myPort.readStringUntil(‘\n’);
temp=trim(s);
if (temp != null){
int values[]=int(split(temp,’,’));
if (values.length==2){
xPos=(int)(values[0]);
yPos=(int)(values[1]);
}
}
println(xPos);
}

Data Visualization

I interviewed some individuals from my computer science classes about the things that they actually do during class and consolidated the responses into 6 main categories: thinking about lunch, dozing off, texting, flirting, using the bathroom, and actually studying. I then visualized the data via a pie chart that I created using arcs.

I created the data by assigning values (minutes) to each category based on the responses. I then generated the start and stop markers for each slice of the pie by calculating the percentage of class time spent doing each task.

This is a screenshot of my chart:

This is my code:

float data[];
float total = 0;
float StempVar = 0;
float EtempVar = 0;

size(600,600);
String[] input = loadStrings(“input.txt”);
println(input.length);
data = float(split(input[0], ‘,’));
println(data.length);
noStroke();
for(int i = 0; i < data.length; i++){
total = total + data[i];
println(total);
}
//for(int a = 0; a < data.length; a++){
// println(data[a]);
//}

for(int i = 0; i < data.length; i++){
//int colour = int(random(0,255));
fill(i*30);
StempVar = StempVar + (2*(data[i]/total));
//println(StempVar);
EtempVar = (StempVar – 2*(data[i]/total));
println(EtempVar);
arc(300, 300, 400, 400, EtempVar*PI, StempVar*PI);
}

fill(255);
textSize(18);
text(“thinking about lunch”, 280, 400);
textSize(15);
text(“dozing off”, 150, 370);
text(“texting”, 140, 280);
text(“flirting”, 230, 200);
text(“bathroom”, 370, 230);
textSize(10);
text(“studying”, 420, 280);

The Digitalization of Just About Everything Response

If we told our ancestors from 100 years ago that many many products (especially those in the information/entertainment industry) would be made free, perfect, instantaneous, and easily accessible, they’d probably laugh and tell us to stop dreaming.

With the advancement of dynamic digital data storage solutions, it has become so much easier to record and share media. Take photography as an example. Before the invention of digital cameras, each and every photo had to be burned onto a physical piece of film. A roll of film that costs about the same as a standard 8 or 16GB SD card could only store less than 1% of the photos that that SD card could, not to mention that it can only be used once. Today, we literally just hold down the shutter and take 100 photos of the same thing just so we can choose the “best” looking one. Life must be hard before digitalization became a thing.

First OOP Assignment

I created the game “Snake” using three classes: the board class, the snake class, and the food class. The movement of the snake is controlled by the w, s, a, and d keys.

The win/game over functions were integrated directly into the draw function.

The following is a quick video demonstration of the game in action:

This is my code:

ArrayList<Integer> positionsX = new ArrayList<Integer>();
ArrayList<Integer> positionsY = new ArrayList<Integer>();

int dimSquare = 40;
int dim = 800;
int positionX = 5;
int positionY = 5;
int foodX = 15;
int foodY = 15;
int [] dirX = {1,-1,0,0};
int [] dirY = {0,0,1,-1};
int direction = 0;
int speedOfGame = 10;
boolean gameover = false;

class gameBoard{
gameBoard(){}

void drawLines(){
noFill();
stroke(0);
strokeWeight(1);
for(int i = 0; i < dim; i++){
line(dimSquare*i, 0, dimSquare*i, dim);
line(0, dimSquare*i, dim, dimSquare*i);
}
}
}

class snake{
snake(){
positionX = positionX*dimSquare;
positionY = positionY*dimSquare;
}

void drawSnake(){
fill(0,255,0);
noStroke();
for(int i = 0; i < positionsX.size() ; i++){
rect(positionsX.get(i)*dimSquare, positionsY.get(i)*dimSquare, dimSquare, dimSquare);
}
if(frameCount % speedOfGame == 0){
positionsX.add(0, positionsX.get(0) + dirX[direction]);
positionsY.add(0, positionsY.get(0) + dirY[direction]);
//positionsX.add(0, dirX[direction]);
//positionsY.add(0, dirY[direction]);
positionsX.remove(positionsX.size() – 1);
positionsY.remove(positionsY.size() – 1);
}
}

void growSnake(){
positionsX.add(1, positionsX.get(0) + dirX[direction]);
positionsY.add(1, positionsY.get(0) + dirY[direction]);
}
}

class food{
food(){
}

void drawFood(){
fill(255, 0, 0);
rect(foodX*dimSquare, foodY*dimSquare, dimSquare, dimSquare);
}
}

gameBoard a;
snake b;
food c;

void setup(){
size(802, 802);
a = new gameBoard();
b = new snake();
c = new food();
positionsX.add(5);
positionsY.add(5);
}

void draw(){
if(gameover == false){
background(255);
//a.drawLines();
b.drawSnake();
c.drawFood();
if(positionsX.get(0) == foodX && positionsY.get(0) == foodY){
foodX = (int)random(0,20);
foodY = (int)random(0,20);
b.growSnake();
}
if(positionsX.get(0) < 0 || positionsY.get(0) < 0 || positionsX.get(0) >= 20 || positionsY.get(0) >= 20){
gameover = true;
fill(0);
textSize(30);
textAlign(CENTER);
text(“GAME OVER.”,width/2,height/2);
}
if(positionsX.size() == 20){
gameover = true;
fill(0);
textSize(30);
textAlign(CENTER);
text(“YOU WINNNNN.”,width/2,height/2);
}
}
}

void keyPressed(){
int keyInput = 0;
if(key == ‘d’){
keyInput = 0;
}
if(key == ‘a’){
keyInput = 1;
}
if(key == ‘s’){
keyInput = 2;
}
if(key == ‘w’){
keyInput = 3;
}
if(keyInput != -1){
direction = keyInput;
}
}

Lev Manovich Response

The age of new media is finally taking over. Unprecedented computation power coupled with creativity (in both the good and the not so good context) means that the amount of media produced and accessible to us is at an all time high. This also means that we have all the opportunity in the world to absorb all sorts of different perspectives and ideas. It’s much easier for authors and artists to showcase their work to the world and gain recognition (before they die (which is what artists in the past often went through)). On the other hand, the “program-ibility” of media also means that we are more susceptible to fake news and fraud.

Casey Reas Eyeo2012 Talk Response

Despite Casey Reas’ semi-monotonous narration, I still enjoyed the presentation very much. I’ve always been an avid admirer of simple geometric shapes and repeating patterns in art so I did not think I would like some of the more “messy” projects displayed in the presentation. After looking at a few more, I started to think that they were actually very aesthetically pleasing. Many of them did not appear to resemble anything in particular. Nonetheless, the collection of lines and mixture of colors still had its own unique appeal. I’m beginning to understand how to create images that have patterns, but art that just… messily beautiful… that’s a different deal.

Recreation of a Computer Graphic

I scrolled through the recode project website and found this image that sort of resembled an oversized tic-tac-toe board. Thought it was pretty neat so I decided I to replicate it to the best of my abilities.

This is what the original image looked like:

This is what my program produces:

This is my code:

void setup(){
size(800,800);
background(255);
stroke(0);
strokeWeight(8);
noFill();

for(int i = 0; i<10; i++){
for(int x = 0; x<10; x++){
int deter = int(random(0,2));
//rect(80*j,80*i,80,80);
if(deter==0){
line(80*x+20,80*i+40,80*x+60,80*i+40);
}else{
line(80*x+25,80*i+30,80*x+61, 80*i+56);
line(80*x+25,80*i+56,80*x+61, 80*i+30);
}
}

}
}