# Invaders

Using MATLAB, we built out a game that looks fun and sounds cool!

Our main motivation is to make a somewhat polished game during the span of HackHarvard 2024 and also to have fun!

## How MATLAB helped us

While playing or watching the game, you may notice that the aliens have different strategic movements depending on how far into the stage you are, and also depending on how aggressive you are within the game (whether you you the type of person who likes to combo up a bunch of aliens and shoot them all at once, or you are the type of person who is just throwing ammos everywhere without care!) Because of this, the simulation logic of the aliens is very complicated, and with MATLAB, we are able to generate the curves for the aliens path as well as their attacking behaviours. This makes for a tremendously more organic random-generated game. We are quite happy with how the aliens behave. If you want to see it for yourself, I encourage you to play it!

## What we did

As of the time of writing this, we are proud to share that during this hackathon, we have successfully:

* Looted quite a lot of t-shirts.
* Ate all the free meals (although we are still bummed about no ramens as advertised like that on the calendar!)
* Solved some crossword puzzles!
* Made a working and quasi-playable game!!!!!!!!!

On the technical level, we:

* Interfaced with the native sound libraries for audio playback (example being PulseAudio for Linux!)
* Interfaced with FreeType for font rendering that supports UTF-8 and hopefully some Arabic.
* Created a custom immediate-mode UI library.
* Used OpenGL for the graphics backend.
* Made hot-reloading works for assets change, which is extremely useful during development.

As for the game, some of its features include:

* Particles system.
* Automatic saving and loading high scores to leader board.
* Procedurally generated aliens behaviour and attack strategies.
* Level transitions.
* Different power ups for the player (V shooting, double/triple shots, shields, piercing shots, ...)

## Plans

The game is quite good looking already, but we want to add some more features to it after the hackathon, which may not just be limited to:

* Bonus rounds where you can bounce the aliens around like in Gaplus.
* A mind-control vacuum pick up where it allows you to necro aliens into shooting with you.
* A one-up type of thing where you can get an extra health up by shooting somethiing funny.
* Boss fights, mini-boss fights.
* Port this to other platforms like Android, Raspberry PI, or iOS.

Right now, the environment we used to build the game is Ubuntu 24.04 LTS. Windows is supported but is un-tested.

Thank you everyone at HackHarvard this year for sharing positive energy all around!
## Overview

According to the WHO, at least 2.2 billion people worldwide have a vision impairment or blindness. Out of these, an estimated 1 billion cases could have been prevented or have yet to be addressed. This underscores the vast number of people who lack access to necessary eye care services. Even as developers, our screens have been both our canvas and our cage. We're intimately familiar with the strain they exert on our eyes, a plight shared by millions globally.

We need a **CHANGE**.

What if vision care could be democratized, made accessible, and seamlessly integrated with cutting-edge technology? Introducing OPTimism.

## Inspiration

The very genesis of OPTimism is rooted in empathy. Many in underserved communities lack access to quality eye care, a necessity that most of us take for granted. Coupled with the increasing screen time in today's digital age, the need for effective and accessible solutions becomes even more pressing. Our team has felt this on a personal level, providing the emotional catalyst for OPTimism. We didn't just want to create another app; we aspired to make a tangible difference.

## Core Highlights

**Vision Care Chatbot:** Using advanced AI algorithms, our vision chatbot assists users in answering vital eye care questions, offering guidance and support when professional help might not be immediately accessible.

**Analytics & Feedback:** Through innovative hardware integrations like posture warnings via a gyroscope and distance tracking with ultrasonic sensors, users get real-time feedback on their habits, empowering them to make healthier decisions.

**Scientifically-Backed Exercises:** Grounded in research, our platform suggests eye exercises designed to alleviate strain, offering a holistic approach to vision care.

**Gamified Redemption & Leaderboard System:** Users are not just passive recipients but active participants. They can earn optimism credits, leading to a gamified experience where they can redeem valuable eye care products. This not only incentivizes regular engagement but also underscores the importance of proactive vision care. The donation system using Circle allows users to make the vision care product possible.

## Technical Process

Bridging the gap between the technical and the tangible was our biggest challenge. We leaned on technologies such as React, Google Cloud, Flask, Taipy, and more to build a robust frontend and backend, containerized using Docker and Kubernetes and deployed on Netlify. Arduino's integration added a layer of real-world interaction, allowing users to receive physical feedback. The vision care chatbot was a product of countless hours spent on refining algorithms to ensure accuracy and reliability.

## Tech Stack

React, JavaScript, Vite, Tailwind CSS, Ant Design, Babel, NodeJS, Python, Flask, Taipy, GitHub, Docker, Kubernetes, Firebase, Google Cloud, Netlify, Circle, OpenAI

**Hardware List:** Arduino, Ultrasonic sensor, smart glasses, gyroscope, LEDs, breadboard

## Challenges we ran into

* Connecting the live data retrieved from the Arduino into the backend application for manipulating and converting into appropriate metrics
* Circle API key not authorized
* Lack of documentation for different hardwares and support for APIs.

## Summary

OPTimism isn't just about employing the latest technologies; it's about leveraging them for a genuine cause. We've seamlessly merged various features, from chatbots to hardware integrations, under one cohesive platform. Our aim? Clear, healthy vision for all, irrespective of their socio-economic background.

We believe OPTimism is more than just a project. It's a vision, a mission, and a commitment. We will convert the hope to light the path to a brighter, clearer future for everyone into reality.
## Inspiration

The US Energy Information Administration provides a large data set of over 12,000 different houses across the country spanning 900 different factors of a household (e.g number of rooms, size of the garage, average temperature) related to annual energy consumption. The data seemed very useful, but too expansive to use. So we wanted to see if we could make it easier to find which factors influence your energy consumption the most.

## What it does

We built a website where a user can submit some basic information about their household and living situation. From there, it sends that information to our backend where it is processed by our pre-trained deep neural network. The neural network then predicts their expected annual energy usage in Kilo-Watt Hours based on that array of input, which it compares to the over 12,000 other samples we analyzed from previous years.

## How we built it

The website was built using Vue.js, the backend written in Flask, and the machine learning was done using Keras, a high level Python library that runs on top of Tensorflow. Additional regression was conducted using R.

## Challenges we ran into

Training the neural network on a multi-dimensional vectorized input was difficult because it required normalizing each of the varying inputs to between 0 and 1, retrieving an output, and then returning it back to its original range. Additionally, we ran into some trouble actually converting the JSON format of the client's data from the post request to a Pandas Data Frame that we needed to feed into the DNN.

We needed to reduce the dimensionality of the dataset from 900 distinct variables to a sizeable number that a user could reliably input into a webapp. We tackled this problem using two approaches. The first was through a machine learning technique called Principle Component Analysis (PCA) that aims to find uncorrelated components within the dataset, and it helps to reduce the dimensionality along combinations of the dataset. The second method we used was to perform a series of regressions between each variable and the observation of energy usage, to find the variables with the highest correlation values. From these two lists we then picked a good list of variables that we thought would be the best fit for our project.

## Accomplishments that we're proud of

Incorporating machine learning and statistical analysis on a large dataset was both challenging and rewarding for all of us because we had never done it before and learned a lot on the way!

## What we learned

We learned how to use machine learning libraries in Python and what things to consider when training a Neural Network to perform linear regression.

## What's next for Uncover Your Usage

After improving our model's accuracy and front end UI, we can expand our product to take in a larger set of features and better help users determine the cause of their continually increasing energy bill.