/comp20-s2017-team16

COMP 20 Spring 2017 Semester Group Project Repository

Primary LanguageJavaScript

comp20-s2017-team16

Project title: Memelord

Problem statement: People need to compete among friends and weakling challengers to develop typing speed and accuracy and see who is the fastest, most ruthless typer. Give them a chance to compete in a biased, four-person arena under the influence of the Memelord.

How do you solve the problem?: The solution is to introduce the world to Memelord, which builds typing skills and meme recognition.

List of all the features that we tried to implement.

  • Geolocation - We wanted to determine player groups through geolocation (ie, find the four closest people who want to play). For prototype and testing purposes, though, we only have the project working for one person to type against themselves, and thus, are temporarily not using latitude and longitude.
  • Server-side persistence - We used a server to hold information about the game. There exists a game_Table which holds all the information about each user, what story they're competing on, which paragraph they're on, which line number they're on, and their wpm. We have another table called stories_Table on the server which holds the stories in paragraph chunks so they can be feeded to the front-end paragraph by paragraph. We used node.js and MongoDB to make this all happen.
  • Reporting with charts and graphs - Given a wpm from the round, the /score page appears between rounds and will give a comparison between the typing speeds of all players and their player standings on a chart.
  • Meme logic - if user is memelord, user has the power to spam all the other users with a meme to distract them from typing. We still need to incorprate full meme logic; however, as of now, a meme will show up for a single player every five seconds to distract the user. It will test your ability to deal with memes and typing ability!

Data our prototype uses and collects

  • Prewritten stories for players to type, split into paragraphs. One paragraph denotes one round. Each sentence will be automatically directed to the next when the user finishes each sentence correctly. Each insertion to the stories_Table includes story name, paragraph number, and sentence number
  • Geolocation info from users - When fully implemented, latitude and longitude will be used at the beginning of the game to match people.
  • GameID - if there is more than one game being played with the same story, the server needs to know so it doesn't mix up games and information
  • Scores between rounds - this includes wpm for user at each round
  • Time it takes for people to complete each paragraph (used for after-round wpm report).
  • Time it takes for people to complete the story (used for all-time scoreboard)
  • Usernames - use unique player ID to differentiate from the other users; shown on current and all-time scoreboards in /score
  • Memes and icons - used to distract the other players.

Algorithms or special techniques necessary

  • The position of memelord will be randomly generated by a server-side time calculator and will rotate players every 10 seconds. Position of memelord is randomly assigned.
  • If we don't find enough people, we will use an expanding radius search for players by geolocation. This wasn't implmented in our version, but we would want to extend this feature.
  • Random generator of memes - we can randomly generate them, but we are unable to have the memes show up on the screen during the game.
  • Using google charts API to make a graph (holding user scores) - the graph as of now is very blurry, and with a one-person prototype, can't show other players' scores, but the idea would be to display all the players' scores on the /score page comparing them in ranking order.

Tradeoffs

  • For our game_Table, we traded clarity for simplicity. We think this slowed down database retrieval because we will be updating the server everytime someone finishes the sentence (updating sentence num) which is a lot of post requests.
  • Modularity in this project proved to be difficult. We went back and forth a lot on how we should hold user, game, and story information. Should there be a totally separate user table, separate from the paragraphNum, etc? But then there was the difficulty of knowing what sentence each user was at.
  • We also had some tradeoffs between security and ease of implementation. We discussed a lot about security and realized, for a prototype, that it wasn't our biggest priority. Because of that, we sent information through a query in the URL which was easy to parse but not at all secure.
  • In the beginning of the project, we discussed using node.js vs. Flask. Flask seemed appealing because it made simpler get and post requests and it had built-in packages that would help security things. On the other hand, most of us were more familiar with node.js from the previous assignment and we thought building off of our knowledge and familiar domain would allow us to get more done with our time (instead of spending the time to teach ourselves something new).
  • We also discussed the tradeoffs between keeping time on the server-side or on the client side to calculate words per minute. In the end, we decided we should keep track of time in two ways: the server-side time-keeping kept memelogic consistent throughout different instances of the game, and the client-side time-keeping made it easy to compute each individual player's words per minute.

Lessons Learned

  • Increased familiarity with node.js. We felt immensely more comfortable with the platform even after assignments 2, 3, and 4.
  • Group messages are not optimal for group productivity, and in-person interaction increased productivity greatly. It gave us a sense of collective achievement when we worked through a problem together.
  • We learned the value of key-value pairs, especially when passing information from page to page.
  • Worked on collective design and consistency throughout the project. If you look in our wireframes folder, a big picture of our design is there.

Google doc of ideas to keep track of project progress

Instructions for Pushing

  • in order to push to github comp20-s2017-team16 repo - git push origin master

  • in order to push to heroku git push heroku master

#Comments by Ming

  • Total win of an idea. Enough said. Don't disappoint us.