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

Parse cost section on infobox from API #39

Open
CornHusker89 opened this issue May 2, 2024 · 13 comments
Open

Parse cost section on infobox from API #39

CornHusker89 opened this issue May 2, 2024 · 13 comments
Assignees
Labels
type:enhancement New feature

Comments

@CornHusker89
Copy link
Contributor

CornHusker89 commented May 2, 2024

While the API currently doesn't return cost info, it's planned to be implemented so we should make sure ketch is ready to add the information to infoboxes

@CornHusker89 CornHusker89 added the type:enhancement New feature label May 2, 2024
@smallketchup82
Copy link
Member

@Wingysam i dont even know if you can view this but if you can, is this still planned.. or?

@Wingysam
Copy link

Wingysam commented Aug 9, 2024

It's planned to come from the game API rather than Galaxy Info. For now you can just hardcode the values for basic material prices since they're static.

@smallketchup82
Copy link
Member

For now you can just hardcode the values for basic material prices since they're static.
So is the economy static now? If my memory serves right, ship materials would fluctuate based on the economy or other factors. That, and material prices would also fluctuate based on supply and demand from, say, megabase.

If the economy is still static, I'll definitely hardcode it in the meantime. But if things still move around, I'd prefer to not provide values that can turn out to be faulty.

@Wingysam
Copy link

Wingysam commented Aug 9, 2024

Yeah the prices for ores at MB are static and haven't changed in months, with no current plans to change them.

@smallketchup82
Copy link
Member

Okay thanks!

@smallketchup82 smallketchup82 self-assigned this Aug 9, 2024
@smallketchup82
Copy link
Member

smallketchup82 commented Aug 9, 2024

okay. i'll try to give this a go. I still don't really know what the material values are, and since I don't play galaxy. i'm going to have a galaxypedia staff member fetch them for me. i'm going to self assign myself to this and probably create a new class ketchupbot-side to calculate the values.

@Wingysam from my knowledge, the galaxy info api doesn't seem to provide ship material info (i.e. the amount of silicate needed for a ship). is there a way to get this from the galaxy info api, for me to then hardcode the cost values?

this is the data for a ship returned from the galaxy info api's galaxypedia endpoint
image

@Wingysam
Copy link

Wingysam commented Aug 9, 2024

Yeah the material amounts are calculated at runtime so there's no way for Galaxy Info to know them without duplicating the complicated algorithm.

The algorithm is deterministic so the amounts never change if the ship and algorithm don't change.

Maybe I could refactor that to calculate the prices at build time?

@smallketchup82
Copy link
Member

That'd be useful.

Getting cost info to galaxypedia is pretty high priority for me, cause I've been nagged about it by users since the Galaxypedia's been conceived.

@Wingysam
Copy link

Wingysam commented Aug 9, 2024

If you want this done today you could give me an API endpoint to hit with cost data and I'll make the game post to it every time ships get reloaded.

@smallketchup82
Copy link
Member

smallketchup82 commented Aug 9, 2024

Hmm. If we wanted to move to "game contacting ketchupbot", I'd prefer using a websocket solution, which is what @SeaswimmerTheFsh was supposed to be working on, but doesn't appear to be happening anytime sooner.

It'd probably be better if you did that galaxy info sided, then send the data in the same galaxypedia endpoint. I'll write some logic in ketchupbot to treat it differently and to not parse it.

To be clear, all I'd really need is the material quantities for ships, not necessarily the prices, unless you'd prefer to manage it instead of ketchupbot.

All in all, probably just better to add the endpoint to galalxy info

@Wingysam
Copy link

Wingysam commented Aug 9, 2024

In that case I'd accept a PR for the endpoint. You could store it in the KeyValue table.

@smallketchup82
Copy link
Member

In that case I'd accept a PR for the endpoint. You could store it in the KeyValue table.

The issue is that I don't program in typescript anymore, and given I'm unfamiliar with the galaxy info codebase, I probably won't be able to get an endpoint out for you anytime sooner.

I plan on reading the galaxy info codebase and implementing some updates myself eventually, but that can be weeks if not months ahead. So either you can wait for me to eventually start working on galaxy info, or you can find another person you could offload the galaxy info sided work to.

@Wingysam
Copy link

I have other priorities than adding the data to Galaxy Info right now, so I'm not available to do it at the moment.

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

No branches or pull requests

3 participants