erosson / ch2plan

Clicker Heroes 2 skill tree planner
https://ch2.erosson.org
GNU General Public License v3.0
4 stars 3 forks source link

Compress build urls #10

Closed erosson closed 6 years ago

Judgy53 commented 6 years ago

I did a bit of research and experimenting on that issue and here's what I found :

Now the results. I selected 309 nodes randomly (thanks multiSelect feature 😄 ) and compared the output length :

It's still very long but that's much better than what we currently have.

erosson commented 6 years ago

Thank you!

More possiblities:

bitwise and alphabet-split both depend on ch2's node ids staying relatively small. If Fragsworth and friends decide to start using 5-digit nodeids for whatever reason, either approach gets much bigger, and would have to map to smaller ids to keep sizes reasonable - painful for future updates, especially if node ids change. ch2 devs sound like they're careful about updates that break save compatibility, which likely means node ids won't change - and they're not even using ids we have to map yet. tradeoff's probably worth it.

(maybe this isn't even worth the trouble. large build urls look obnoxious but still work fine, and it's kind of nice for humans to be able to understand a build url. I couldn't have done this with a fancy compressed format, for example: https://www.reddit.com/r/ClickerHeroes/comments/8zjsfk/clicker_heroes_2_skill_tree_planner/e2rpfmm/?context=3 )

Judgy53 commented 6 years ago

So many ways to encode a build, I guess it's time to chose, right ?

I personally prefer shorter urls, so would go for bitwise (with some optimizations like only encode up to highest selected id, and make special cases for long series of 1 or 0). That said, I like the current format for its readability (being able to tell if early or late game without clicking) and its easy manipulation. So I wouldn't mind keeping that way.

What about supporting both and giving the user the choice, with a "Share the build" button for example ? ( Would be a bit of a hassle to update if the node system change though. ) Or maybe ask the player base on Reddit/Discord what they would prefer, it's for them after all 😄

erosson commented 6 years ago

What about supporting both

The current format will be readable forever since urls for it already exist, but writing more than one format - absolutely not. Allowing an option confuses new users ("what does this do?"/"why does it matter?"), including anyone who sees the generated urls; it's more places bugs can appear; it's one more thing to test and support; have to find UI space for it somewhere; and there's not enough benefit for all that to be worth it.

I doubt many players have strong opinions here - don't think a poll's worth the trouble.

Thinking through this, I'm leaning toward keeping the current format for now. the bitwise thing would be fun to implement and the small urls are prettier, but I'm not feeling that prettier/smaller beat simple/human-readable/already-working, for now. Can always revisit this if the tradeoffs change later.