Inspiration

We wanted to try I multiplayer game, and we are also both interested in Risk. Therefore, we decided to create a game that's like Risk, but that is online, easier to learn, and faster.

What it does

You start in the matchmaking. You and up to four people can all enter the same join code (it can be anything) along with your name to enter the lobby. Once everyone is in the lobby, press Start Game to begin.

Play is turn-based, starting with the first person who joined.

On your turn, you may

  • Invade an empty territory (grey) for $100 that's adjacent to your color
  • Invade another players territory that's adjacent to your color. The cost is dependant on on how much contiguous territory that territory borders.
    • Change teams for $100, unless the team already has too many people.

Play continues until all teams but one are eliminated.

How we built it

We built the backend in Flask with socketio connections, and created a database in sqlite. For the frontend, we used Jinja HTML templates, which emit socketio events to the backend. The front end was made in HTML5 canvas for graphics, a bit of custom CSS styling and JavaScript/SocketIO.

Challenges we ran into

We ran into a lot of trouble styling the HTML. Also, making the database robust, by deleting people who disconnect, proved to be tricky.

Accomplishments that we're proud of

We're proud of creating a relativity polished game. Last madhacks, our project was not finished by the deadline. So we are proud of being able to have something that we can submit.

What we learned

This was our first time creating a major project in Flask. We learned A LOT about sockets, Flask, and we learned a method for creating a server. This was also our first time using SQL. Next time we need a server, it will be much easier to properly structure from the start.

What's next for Alliance Online

First, the database can still be improved. Also, the styling could be better, and the UI a little more usable friendly (although it's already come a long way). Most importantly, however, is deployment. We would like to deploy to heroku but that would require migrating our database from sqlite to postgresql, which would be a very time consuming endeavor.

How to Run

If you are accessing at the madhacks event, we have the server running on the local IP http://10.141.239.157:5000 . Otherwise, you can download our source folder from github, and running the server with the following commands:

pipenv install
pipenv run flask run

Then you can access your server at localhost:5000

Share this project:

Updates