Skip to content
Max Arnold edited this page Sep 25, 2021 · 17 revisions

Welcome to the national-team-generator wiki!

Plan

  1. Create National Team Generator
    • Make it so only male first names are queried.

    Might be a good idea to remove all the female-only names from the Firestore database. It should cut the collection by at least a third.

  2. Allow for the saving of generated teams
    • Create a button that allows you to write the data to Firestore in a separate collection.
    • Player data can be written to the user's document in a subcollection
    • Player data then can be fetched with a load button with only one set of saved data at a time (for now)
    • Create a page or section that allows you to load the team data.
  3. Add attributes and elements from Football Manager to increase the details of the players.
  4. Create an interface that allows for drag-drop functionality so that allows for teams to be created. (Like Football Manager)
    • Create the pitch field and lineup names on the side.
    • Create the functionality to allow players to be moved from:
      • starters to bench position
      • bench to starters position
      • starter to starter / bench to bench position
    • When dragging, position compatibility should be highlighted.
    • UI/UX needs to be exceptional in order to be appealing.
  5. Create a scoring system and leaderboard to judge the quality of teams created.
  6. Create a tournament that can be entered with a generated team that will be simulated like Football Manager.

Task List (Small changes to be made)

  • Update getRating() to allow for greater variation in club reputation and player ratings that is more realistic.
  • Update getClub() to allow for greater variation and realism.
  • Add more teams to clubs.json and add a nationality property.
  • Add more nationalities to nations.json.
  • Adjust getAge() for better realism in age distribution along with ratings.
  • In firestore.service.ts -> getFirstName() add all the possible nationalities.

How Random Firestore Queries Work

Check out this Stack Overflow thread that explains different ways to grab random documents in Firestore.

In this section, I will explain which methods I use for grabbing random documents for the National Team Generator.

  1. For each First Name and Last Name document, there is a randomNum field. This field is a map, not an array. This is important. It includes 5 randomly generated numbers. We are using the random integer version from the stackoverflow thread.
  2. The next step is the bi-directional method.
  3. The next step is rinse and repeat method. Although, the keep it coming method should be looked into.
  4. As you could guess from the first step, we're using the multi-random method for ongoing randomness.
Clone this wiki locally