Brandon Roots
  • INTERACTIVE
  • FILM
  • ABOUT
  • CONTACT
July 1, 2021

Final Project Presentation

broots ITP, Live Web

Over the last couple of days I made significant progress adding features and polishing up my final project. You can try it here and also in an embed at the bottom of this page.

Sound

During previous feedback Shawn pointed out that some unwanted noise from the P5 oscillator was likely due to needing to stop sounds before removing the variables controlling them.

// stop tone from planet i
planets[i].osc.stop(2);

Using stop() was exactly what was needed as it allows a delay to the stop by a set number of seconds, permitting the sound to finish.

Visual Polish

Building out the environment further I added additional planets to the solar system that drift by; giving a better sense of scale and depth. Also the user’s cursor is replaced by a glowing light.

Game Rooms

The biggest update was made on the server side implementing rooms in Socket.io.

During testing in class I found the experience of several users in one space to be overwhelming, defeating the meditative intent of the app. Using rooms on the server side I organize users into pairs, allowing for a much calmer experience.

var users = [];
var rooms = [];

io.sockets.on('connection', 
	// We are given a websocket object in our function
	function (socket) {
                
                console.log("We have a new client: " + socket.id);

		users.push(socket);                

                // Room setup
		let roomId = 0;
		let roomNumber = 0;
		if(rooms.length > 0){
			// Check for available rooms
			for(let i = 0; i < rooms.length; i++){
				// Check for open room
				if(rooms[i][0] == 0){
					// You are now the controller in this room
					roomId = socket.id;
					rooms[i][0] = socket.id;
					roomNumber = i + 1;
				} else if(rooms[i].length == 1){
					// You are now the guest in this room
					roomId = rooms[i][0];
					rooms[i][1] = socket.id;
					roomNumber = i + 1;
				}
			}
		} 
		// If still no roomNumber
		if(roomNumber == 0){
			// No available rooms...
			if(users.length%2 == 1){
				// You are the room controller
				roomId = socket.id;
				let tempId = [];
				tempId[0] = roomId;
				rooms.push(tempId);
				roomNumber = rooms.length;
			} else if(users.length%2 == 0) {
				// You are a guest
				roomId = rooms[rooms.length - 1][0];
				roomNumber = rooms.length;
				rooms[roomNumber-1][1] = socket.id;
			}
		}
		
		socket.join(roomNumber);
		console.log("Joining room number: " + roomNumber);
		console.log("Room ID: " + roomId);

);

Final Project Update Response to “Performance practice as a site of opposition”

Related Posts

Fractal Plant – Foiled by  Registers

Homemade Hardware, ITP, Solar Plant

Fractal Plant – Foiled by Registers

Since receiving the PCBs and successfully soldering the board together I have been trying to rewrite code for the I2C port expander. This has been immensely difficult! The Inkplate Arduino Library makes considerable use of an “Mcp” class, which is written to work with the MCP23017 GPIO expander IC. These chips are quite difficult to […]

“Handling” Playtest Week

Handling, ITP

“Handling” Playtest Week

Last week we attended “Playtest Thursday” on the second floor of 370 Jay St with our games. I came away from the experience with some very specific feedback. Seeing a number of people play the game showed me things I didn’t anticipate. Some folks approached the cabinet and immediately treated it as a touch screen. […]

Fractal Plant – Beta Build

Homemade Hardware, ITP, Solar Plant

Fractal Plant – Beta Build

The boards arrived! Amazingly within an hour of one another. Based on the experience I think that JLCPCB is a better value. With shipping OSHPark was $55.50 for 3 boards. JLCPCB was $26.36 for 10 boards. Aside from a higher cost OSHPark also left sharp bits of tabs around the edges of the boards which […]

Recent Posts

  • Fractal Plant – Foiled by  RegistersFractal Plant – Foiled by Registers
    May 9, 2022
  • “Handling” Playtest Week“Handling” Playtest Week
    May 5, 2022
  • Fractal Plant – Beta BuildFractal Plant – Beta Build
    April 24, 2022
Brandon Roots