Skip to content

s70f/Root-Faction-Chooser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Root Faction Chooser

A simple web app designed to help players of the board game Root in selecting a four-player faction combination. This tool takes each player's top four factions and uses a custom algorithm to suggest the best possible combination based on prioritizing their top factions and balancing the game using Roots recommended "reach" values for a four player game.

Demo

Root-Faction-Chooser-Demo

Note: Players 2, 3, and 4 were prefilled to shorten demo.

Features

  • Allows four players to rank their top four factions.
  • Integrated algorithm generates an optimized list of faction combinations based of player preferences and recommended reach values from the game designer.
  • Displays the top three recommended combinations, including a "Satisfaction" score and "Reach Difference" metric.

Tech Stack

  • Backend: Python with the Flask framework.
  • Frontend: Standard HTML and CSS. The page is rendered using Jinja2 templating.
  • Algorithm: The core logic for choosing the best combinations is handled by a custom Python module.

User Guide

This guide will walk you through the steps to get the app running and ready for use.

Setup and Launch

  1. Download the project as a ZIP file and extract it.
  2. Open your terminal or command prompt, and navigate to the project folder.
  3. Install the necessary dependencies by running: pip install Flask.
  4. Launch the app by running: python app.py.
  5. Open your web browser and go to the address provided in your terminal (e.g., http://127.0.0.1:5000).

Usage

  1. On the app's homepage, enter your name and rank your top four preferred factions. Note: Factions must be entered by their animal name (e.g., "Cats," "Eyrie," "Vagabond").
  2. Once all preferences have been entered, click the Muster the Factions button.
  3. The page will instantly update with the top three recommended faction combinations.

Concepts Learned

Greedy Algorithm

This project taught me about greedy algorithms, which are a class of algorithms that make the locally optimal choice at each step in the hope that it will lead to a globally optimal solution. The faction-choosing algorithm in this project uses a greedy approach to find the best possible compromise between player satisfaction and game balance.

Flask

This project served as a foundational exercise in web development, providing extensive experience with Flask, a Python micro-framework. I learned how to handle HTTP requests (GET and POST), process form data, and render dynamic HTML pages using Flask's templating engine.

HTML & CSS

Through the development of this project, I gained a lot more experience with the core web technologies of HTML and CSS. I learned how to structure a complete web form with HTML and then use CSS to style it.

Improvements

Error handling

The current application assumes all user inputs are valid. Implementing error handling would make it more robust. This could include adding checks for invalid faction names, and displaying user-friendly error messages if issues are found.

User Features

Future improvements could include adding a button to dynamically add more players, implementing a feature to save and load preferences, and adding a simple visual chart to display a comparison of the top faction combinations.

About

Root Faction Chooser is a web app that helps four players optimize faction selections for the board game Root using a preference-based algorithm and game balance metrics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors