18 April 2021

Downwell Controller

 




https://store.steampowered.com/app/360740/Downwell/

    For the game Downwell, I made a controller setup that matches the player’s actions almost directly to what the character in the game does. I included a wearable accelerometer to measure the player’s tilt and a force resistor to detect if the player is on the ground or not. The container housing the accelerometer is attached to the back of a vest that the player wears. When the player tilts to either the left or the right by a certain amount, a left or right arrow key is pressed and held respectively until the player returns to a neutral position. Leaning forward is mapped to the escape key, which pauses the game and opens the menu. The force resistor is under a pad that the player stands on and is inert when the player is standing on it, but when the force on the sensor is less than a certain amount, meaning the player has jumped off of it, the space key is pressed to make the character jump.

    Feedback happens very quickly in the game because the player doesn’t have to move too much to have their input registered. The controls are also intuitive for the player because all they have to do is move in the same way they want the character to move. If they lean left and jump, the character will jump and move to the left as well. This also means that the response time of the character is limited by the user’s own physical ability and reaction time. In this regard, the game may become limiting for some people and have a higher barrier of entry. The input for the escape key is less obvious, and I missed the opportunity to create a good signifier for it. However, considering it isn’t as important as the other controls, it doesn’t limit the player’s affordances too much.

    The idea behind this controller was to make the player feel like they were a more active participant in the game. Now they have to struggle with the character. Downwell is a game where the player is constantly fighting against the force of gravity pulling them down. By making the player jump in real life, this struggle is made much more tangible.

Do you think there's a more intuitive way to access the escape key than leaning forward using the setup that I've created?


//Chris Tillis

//Game Controller
//libraries 

#include <Adafruit_CircuitPlayground.h>
#include <Adafruit_Circuit_Playground.h>
#include <math.h>
#include <Keyboard.h> 

//Global Variables
int sideThresh = 4;
int frontThresh = -3;
int jumpThresh = 600;
float sideTilt = 0;
float frontTilt = 0;
int fsrReading; 

//Timekeeping Variables
unsigned long currentTime;
unsigned long jumpTime;
unsigned long menuTime; 

void setup() {
    // put your setup code here, to run once:
    Serial.begin(9600);
    delay(10000);
    CircuitPlayground.begin();
    Keyboard.begin();
} 

//Main Loop
void loop() { 

  //Time variable updated
  currentTime = millis(); 

  //All sensor input gathered
  sideTilt = CircuitPlayground.motionX();
  frontTilt = CircuitPlayground.motionY();
  fsrReading = analogRead(A7); 

  //Space bar pressed when FSR has no weight
  if(fsrReading < jumpThresh && currentTime - jumpTime > 100){
    Keyboard.press(' ');
    jumpTime = currentTime;
    Serial.println("jump"); 

  } //If not currently jumping, press escape if player leans forward
  else if(frontTilt > frontThresh && currentTime - menuTime > 5000){
    Keyboard.write(177);
    menuTime = currentTime;                                                                                
    Serial.println("escape");
  } 

  //Press right when player leans right, release when not leaning
  if(sideTilt > sideThresh){
    Keyboard.press(215);
    Serial.println("right");
  }
  else
    Keyboard.release(215); 

  //Press left when player leans left, release when not leaning
  if(sideTilt < -(sideThresh)){
    Keyboard.press(216);
    Serial.println("left");
  }
  else
    Keyboard.release(216); 

  //Jump is released after .5 seconds
  if(currentTime - jumpTime > 500)
    Keyboard.release(' '); 
}



No comments:

Post a Comment

Note: Only a member of this blog may post a comment.