xanthics / gw2craft

Driving force behind gw2crafts
http://gw2crafts.net
MIT License
68 stars 16 forks source link

Add the Possibility to enter your Current Crafting Material #13

Open keksc0re opened 11 years ago

keksc0re commented 11 years ago

Just an easy list for creating cheaper guides for players who farmed alot, aka not wasting money for sales you dont need

Cheers KeKs

xanthics commented 11 years ago

Planned for an offline version(along with being able to level crafting "for profit" and specifying a start level in a craft). I've been busy with work and preparing for grad school though so haven't been able to spend much time on it.

[edit] My web host does not give enough processing resources to make guides as people visit the site.

nogweii commented 8 years ago

Old issue, but is this possible at all for someone who downloads the code?

For instance, one of my chars has Chef at level 169. What line(s) should I start looking at in order to edit the scripts to provide a streamlined guide for myself?

Powersource commented 8 years ago

You could just make it subtract your current stuff from the shopping list. That could even be done (theoretically) on the website now but it wouldn't be too useful. But if you want it to really optimize for the stuff you currently have, I'd imagine that would take a lot of changes and could end up being quite demanding on your machine (if not stepping into impossible territory for a perfect optimization, but I'm not the one to ask about this) depending on how many recipes there actually are in game.

nogweii commented 8 years ago

It's actually not even close to impossible. Setting it up on my own laptop, it takes all of about 10 minutes to do a complete run, generating every crafting level guide in every language. (And I think I could optimize it further since it's currently I/O bound on the number of requests to Guildwars' API.) Editing the source code, I was able to cut that down to 8 seconds (only generating the Chef karma guides since that's what I care about). I had to make a number of changes since the rest of the code (naturally) assumes the data structures are filled in starting from level 0, not in the middle. And because of that assumption, the generated chef guide was incomplete, referencing crafted or bought components that weren't mentioned (as I expect they would have been made over the course of the guide).

In terms of algorithmic complexity @Powersource, this python code is actually very dumb. Which is fine, since the problem domain isn't very complex. Remember that crafting in Guildwars is tiered, and once you reach a tier (every 25 levels in a crafting discipline) most items no longer grant you any XP. So you can easily bruteforce (which is what is done here) in a search space of maybe 250 recipes at each tier. Super easy, and super quick.

The only complexity is the assumptions the code makes (which are all natural, but if I were to do this for real would require some substantial changes) and the code's own complexity -- it mixes together the logic and presentation instead of using a template language like Jinja which makes it hard to follow some of the logic.