Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V3 Roadmap #30

Open
14 of 16 tasks
gadhagod opened this issue May 23, 2022 · 16 comments
Open
14 of 16 tasks

V3 Roadmap #30

gadhagod opened this issue May 23, 2022 · 16 comments

Comments

@gadhagod
Copy link
Owner

gadhagod commented May 23, 2022

The new version of the Hyrule Compendium API will serve data on more than just the compendium entries. It will contain the following categories of data:

The goal is to make this API more than just the compendium; it should be able to give data on all (or many) aspects of the game, not just the in-game items.

Recipes

Recipes will be divided based on their base ingredient (e.g seafood). Multi-dimensional arrays will be used to represent possible ingredients to tackle the problem of substitutable ingredients.

Possible example recipe response:

{
  "name": "meat and rice bowl",
  "image": "https://botw-compendium.herokuapp.com/api/v3/recipes/recipe/meat-and-rice-bowl",
  "category": "meat",
  "hearts_recovered": 4.0, // hearts recovered from consumption
  "ingredients": [["raw meat", "raw bird drumstick"], ["rock salt"], ["hylian rice"]] // array of arrays, each inner array represents possible ingredients
  "effect": "attack", // enhancing effect of dish (empty if none)
  "duration": 60, // duration of effect in seconds (0 if no effect)
}

Map

Data on each region, including encompassed shrines and settlements, will be provided.

  • Breath of the Wild regions
  • Tears of the Kingdom regions

Compendium

  • The compendium entries will have a field dlc that specifies if it is a master-mode exclusive. The /master_mode endpoint will remain to avoid ID conflicts.
  • The food and non_food keys in the creatures category response will be removed. Each creature entry will have a boolean property edible instead.
  • /all(endpoint to get all entries) will not have keys for each category.
  • attack and defense keys of items of the equipment category will be nested in the properties key like so:
{
  // ...
  "properties": {
    "attack": 14,
     "defense": 0
  }

Code Changes

These changes will not affect the usage of the API. It will improve performance and clean up code.

  • Separate branches for API versions
  • Use Flask blueprints instead of Flask().add_url_rule
  • Improve queries to reduce API latency
    • Instead of executing multiple queries, using UNION is a better solution
  • Create staging app to test changes

Additional Tasks

  • Documentation

Feel free to chime in on this thread.

@gadhagod gadhagod pinned this issue May 23, 2022
@jeff-stienstra
Copy link

jeff-stienstra commented May 23, 2022

Great solution for ingredients, I'm glad you'll be including recipes!
I noticed the '?' on Towns and Regions. Perhaps 'Places' or 'Areas' would be a better category heading?

edit: I see, 'Towns and Regions' is the heading of the existing issue 🙄.

@gadhagod
Copy link
Owner Author

Thanks @jeff-stienstra. You brought up a great point. I don't think /map is the best route for this endpoint. I'm thinking /regions to make it more specific. I'm updating this issue to make this change now.

@gadhagod gadhagod changed the title Hyrule Compendium API v3 v3 May 29, 2022
@gadhagod
Copy link
Owner Author

gadhagod commented Aug 11, 2022

Experimental region endpoints are available at:

  • https://botw-compendium.herokuapp.com/api/v3/regions.
  • https://botw-compendium.herokuapp.com/api/v3/regions/<region> (<region> refers to a tower region, for example, "eldin")

@jeff-stienstra
Copy link

jeff-stienstra commented Aug 16, 2022

  • https://botw-compendium.herokuapp.com/api/v3/regions/eldin/<region>.

Very nice!! I get loads of data when testing the API. There are so many shrines in this game!

But I'm unsure what would go where <region> is in your second endpoint. Will there eventually be a 'regions' array within the object where "name" === "eldin"?

Also, not to be picky, but is 'region' the correct terminology considering 'Eldin' is itself a region? I didn't see any specific terms used when researching other than these sub-regions being called 'areas'. ie Eldin Canyon is a large area within the Eldin region. 🤷‍♂️

Looks like Eldin has these main sub-regions/areas:
Eldin Canyon
Death Mountain
Eldin Mountains
Goron City

Great update!

@gadhagod
Copy link
Owner Author

Thanks for your feedback @jeff-stienstra.

Looks like Eldin has these main sub-regions/areas

I do plan on adding more information about regions. As of now only shrines, DLC shrines, and settlements are given, but I will add some sub-regions and important areas in the future. Thanks for your suggestion!

<region> would be the value of name of one of the regions from https://botw-compendium.herokuapp.com/api/v3/regions. For example, you could make a request to https://botw-compendium.herokuapp.com/api/v3/regions/central.

@gadhagod gadhagod changed the title v3 v3 roadmap Jun 28, 2023
@gadhagod gadhagod changed the title v3 roadmap v3 Roadmap Jun 28, 2023
@gadhagod gadhagod changed the title v3 Roadmap V3 Roadmap Jun 28, 2023
@YanceMcFinn
Copy link
Contributor

Just want to show my appreciation for such an awesome project! I've started my own project based on this, and I hope to include an ability for users to login and save recipes, and keep track of what ingredients you have/need for recipes. Right now it's just showing cards for the ingredients, but I'm looking forward to the recipes being a part of it! Here's a link if you want to look -->

I'm relative newbie to development, but I'd be happy to help in any way I can! Cheers and thanks again for your hard work on such a useful API.

@gadhagod
Copy link
Owner Author

Hi @YanceMcFinn. Thanks for your appreciation! Your project is very cool, and I'm excited to see the new features. Seeing people building projects with this API is what makes the development worth it.

After the release of TOTK features, development on the Hyrule Compendium API has slowed down, as I have not had enough time to add new features. Because of this, I'm not sure when recipes will be ready. If you are willing to contribute to this effort, please let me know; it would greatly help.

@jeff-stienstra
Copy link

I'm relative newbie to development...

Great job on the recipe cards page! That's a fun project and a great way to practice front end design and API usage as a newer developer. Maybe you could create a landing page that will link to the different API resources gadhagod has available (recipes, regions, shrines, etc)?

Keep it up!

@yanader
Copy link

yanader commented Oct 22, 2023

Hi, I'm really enjoying playing around with the API as someone who is learning web programming att he moment. I was wondering if there's anything that can be done to assist with progress you're looking to make on the roadmap. The one piece I'm specifically interested in having access to in the API is ToTK images but I'd be happy to lend a hand in any area.

Thanks!

@XavierLora
Copy link

Hey not sure if this is still being updated or needs some work. I've been playing around with it to make a tracker, willing to assist with getting TOTK images up if still an option!

@BustyBee
Copy link

BustyBee commented Nov 7, 2024

Hey, I saw that the images for totk haven't been added yet

If you want to use them, I got all the images of totk here:
https://github.com/BustyBee/TotK-Compendium-DATA/tree/main/images

If you want to connect the image filenames to the entries, check out this file:
https://github.com/BustyBee/TotK-Compendium-API/blob/main/data/COMPENDIUM.json

@yanader @XavierLora Maybe one of you wants to go through the work of mapping the images to the IDs that this api uses? Should be relatively straight forward, just handle the cases where a match can't be found manually I'd say. I might just do it myself if no one else does.

@freshefisch
Copy link
Contributor

Okay I just went ahead and did such a mapping. Every entry matches an image filename.
EntryToImage.json | Images

To compare it to the entries of the api, all you have to do is replace each space " " with a underscore "_", then you can simply do EntryToImage.entryname (EntryToImage[entryname] in python) and you'll get the file name of the matching image.

Now all that's left to do is make the images

  • square
  • slighty zoomed in
  • 280x280
  • slight compression to match the filesize of the botw images
  • rename them all to match the naming scheme of the botw images (seems to be around 80-150 kB)

I'm not sure what changes to the code are necessary otherwise.

@gadhagod
Copy link
Owner Author

Thank you @BustyBee and @freshefisch for your help! It is deeply appreciated.

As for your questions on #46 (comment) on self-hosting, the current guide is out of date since migrating to MongoDB. I'm currently working on a new self-hosting guide but the process is a bit complicated so it's taking time.

I would greatly appreciate your contribution to this project. Fortunately, adding images is pretty much a no-code change and won't require you to run the server on your own to add them. Would you be able to make the changes you mentioned in your comment, specifically adjusting the image sizes? If you are able to make them 280x280 and add them to the images/TOTK folder in a PR, I can handle the small code change (to endpoints/db.pyL225) to make the API use the new images.

If you are down to contribute, the image names should be lowercase and spaces replaced by underscores. Take a look here to see how I named the PNGs for BOTW.

Thank you for using this API! Have a great day.

@freshefisch
Copy link
Contributor

I will get to it as soon as I can! Just a heads up, I've never done a PR before so I apologize if I do something wrong. But I watched a couple tutorials so should be fine.

I'll also make sure to write a python script that checks if there is an image for every compendium entry, to make sure I have all the images and the names are correct. If you want to I can also share this script.

@freshefisch
Copy link
Contributor

freshefisch commented Nov 11, 2024

I have created a pull request regarding the totk images (files only) #47

Edit: Please see the issue I have described before pulling in #47 (comment)

@gadhagod
Copy link
Owner Author

gadhagod commented Dec 4, 2024

Thanks to @freshefisch, TOTK images are now up! Here's an example.

TODO: add docs for TOTK images

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants