Galaxypedia-Wiki / ketchupbot-updater

epic galxy pedia updator
MIT License
1 stars 0 forks source link

Parse cost section on infobox from API #39

Open CornHusker89 opened 5 months ago

CornHusker89 commented 5 months ago

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

smallketchup82 commented 4 months ago

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

Wingysam commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

smallketchup82 commented 1 month ago

Okay thanks!

smallketchup82 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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

smallketchup82 commented 1 month ago

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 commented 1 month ago

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