Web: Add boss logic calculator
Functionality is done, but styling and text descriptions could be improved.
When building the wasm with wasm-pack, it always adds a gitignore file that ignores the whole pkg folder. So when it is rebuilt, the ignore file will have to be manually removed.
Great stuff! A few things I noticed:
- It looks like the preset buttons are not working, i.e. the click event listeners aren't getting called. The selector
document.querySelectorAll("presets input[type='radio']")is turning up an empty list. Looks like it needs to be "#presets"? I noticed because it's not taking the patience into account for Ridley: with proficiency 1 the fight should be doable with just Charge + Varia. - The results for Botwoon are incorrect because it's checking the requirements for the two phases individually, rather than stacking the requirements. For example it's saying it can be done with 1 Super pack + 1 Missile pack.
- On Chrome, some of the item images get shifted wrong at certain zoom levels:
The main thing that I think is going to trip users up is setting the boss proficiency; most players aren't going to know how to do that correctly, and they will probably ignore it, assuming that selecting a preset will take care of the difficulty assumptions. I'm seeing two possible ways this could be solved:
- Instead of just one boss proficiency field, have all 5 of them. Then they can all get populated by the selected preset. The downside is the page starts to get a bit cluttered.
- Set up the page where the user first selects which boss they are interested in, and then the page can be tailored to that boss:
- The boss proficiency can then be populated automatically based on the preset (but still can be overridden if the user wants)
- The control "Supers do double damage to Mother Brain" would only need to be shown if Mother Brain is selected.
- It makes it easier to add more detail later, e.g. showing the exact amount of energy required, which can matter in case there is a heated room before the boss.
When I was first testing the page, I tried clicking on the boss images and was surprised when nothing happened. My guess is most users are going to assume that they're supposed to select the boss they're interested in. Selecting a loadout and seeing the results for all 5 bosses at once is probably going to be less intuitive. Not saying this has to be changed in order to be merged; it's just a suggestion. If you want to keep with the current design, it could probably help to move the boss icons to the bottom of the page, to help reflect that they show the output of the calculation, rather than an input step at the beginning.
Solution for misaligned sprites found here: https://stackoverflow.com/questions/34642434/when-zooming-on-chrome-image-sprite-becomes-misaligned
This is looking really nice! The one other thing I notice is that Mother Brain shows 0 energy requirements on Extreme and Insane settings. It looks like this is because it's because r_mode is getting set to true in those cases, and the energy requirements for the R-mode strats are not included in apply_mother_brain_2_requirement since they are handled directly in the sm-json-data (https://maprando.com/logic/room/MotherBrainRoom/4/4/MotherBrainRModeReducedTanks and https://maprando.com/logic/room/MotherBrainRoom/4/4/MotherBrainRModeLightPillar).
One thing to keep in mind is that the R-mode strats are situational; they depend on the room to the right having an enemy that can be used to set up R-mode. It might make sense to just leave the R-mode strats out-of-scope of the calculator, maybe just include a link to the logic pages for the two R-mode strats when Extreme/Insane is selected?
Also, since the calculator is only taking into account phase 2 it may make sense to rename Mother Brain to "Mother Brain 2" at the top of the page?
I updated the description on the main logic page to clarify that the calculator doesn't include special strats like backside Botwoon and Mother Brain with R-Mode.
Regarding Ridley with just Varia and Charge on Insane, that seems to also require Morph or Screw to do damageless? If so, then it looks like this calculator is correct.