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

API documentation #141

Open
lynn2910 opened this issue Aug 20, 2024 · 1 comment
Open

API documentation #141

lynn2910 opened this issue Aug 20, 2024 · 1 comment

Comments

@lynn2910
Copy link

Greetings!

I'm developing a tool to generate different factory layouts in the game Satisfactory. Users would input their desired production goals, and the tool would automatically create layouts with machines, belts, and other necessary components.

To achieve this, I'd like to leverage the API provided by satisfactorytools instead of building a custom resolver.

Unfortunately, I haven't been able to locate any documentation for the API. Specifically, I'm unclear about:

  • Resolver Functionality: What data does the API resolver return, and how should it be interpreted?
  • API Usage: Are there any guidelines or examples available for using the Satisfactory Tools API?

I attempted to glean insights by analyzing the API requests, but without documentation, it proved challenging (as illustrated in the attached screenshot).

image

I can glimpse the basic logic behind but I don't know how I should use it

Does Satisfactory Tools offer any documentation for its API?

@greeny
Copy link
Owner

greeny commented Aug 20, 2024

Hi

first of all, the API is not really designed to be used by public, but I don't really care much if you use it, assuming you don't flood SFTools server with tons of requests :)

second, there's no guarantee that the API will work the same, there may be changes or the API may even stop working if I replace it (I'm working on new Tools, which will have different API, if at all).


That being said, from your message it seems you know what to send as request and just want to parse the response:

first of you want to split by # and take the second part. It can be one of these:

  • Mine - means mining of a raw resource (Tools can't do miners, so it won't tell you how many of what type or anything). The resource class is the first part, amount mined is the value
  • Product - means it's result of requested production, item class is first part, amount produced is the value
  • Byproduct - means it's excess production of something, same as above
  • Input - means input of an item into the production line (if added in the request), same as above

if it's not either of these, it's a classname of a machine making something. In that case, you have to split the first part by @, then the first part will be recipe class and second part will be clock speed (it's always 100 because tools don't do clock speeds yet). The value is "amount of buildings running that recipe"

it sometimes also includes weird things like special__power, which you can just ignore, basically if the classname doesn't match to any item/recipe, just skip that.


Once you have the "nodes" from the result above, connecting them to make the graph is up to you (Tools do it by just blindly connecting outputs to inputs).

That should be all. If you have questions, feel free to ask me (you can also write on Discord, e.g. in the Tools server.

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

2 participants