-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Adjust headlamp to match flashlight #77461
Adjust headlamp to match flashlight #77461
Conversation
As I changed the headlight to use a medium battery like the flashlight instead of light battery, tests fail when a helper function tries to load headlamp with a light battery. Cataclysm-DDA/tests/map_helpers.cpp Lines 207 to 215 in a61a138
|
This should now be ready for merging. I limited the scope of this to just adjusting the headlamp, I made it accept a light battery specifically to pass the tests. Headlamp should really have the same battery slot as flashlight. A version with battery and the tests fixed should be previous commit at HEAD b0324d1 |
Did you not adjust the heavy-duty headlamp too? It uses light batteries too. |
My idea for the heavy headlamp includes some changes to the heavy flashlight too (which is part of the recipe of the heavy headlamp). I have that branch mostly ready and I'll make a separate PR if this one gets merged/accepted. The heavy-duty headlamp is made from a heavy flashlight, which has an internal 48 kJ battery that can't be changed. It's based on this item: https://www.amazon.com/dp/B00Y8AHZYC Which is kind of silly to strap to your head as it weighs 720 g and has a volume of 4267 ml. |
Remove battery light from the headlamp, fix the test. |
I can't figure out why the tests fail. I need help with fixing the tests. |
There's |
The failed test is unrelated to this PR. |
Summary
Balance "Adjust headlamp to match flashlight"
Purpose of change
As we can make a headlamp using a flashlight and patches/strings/tape and you can disassemble a headlamp to get a flashlight, we should expect the headlamp to function exactly as a flashlight strapped to your head.
Furthermore, the headlamp is borderline unusable and severely under-powered compared to a real life equivalent and only functions for 23 minutes with a light battery (or 1 second with a ultra-light battery). Fixes #77394.
I believe the current discrepancy between the current flashlight and headlamp is because the listed specs for the reference flashlight is either a) straight up lying or b) use some different and incompatible metric for its brightness and/or burn time.
Reference in-game flashlight: https://www.amazon.com/dp/B0CFLGMKQM?th=1
Reference headlamp: https://www.rei.com/product/202772/black-diamond-astro-300-headlamp
They both take 3xAAA batteries (corresponding to a medium battery), but the advertised performance is 1000 lm for 10 hours for the flashlight and 300 lm for 4-6 hours the headlamp.
https://phys.org/news/2010-08-white-super-high-luminous-efficacy.html
At the maximum theoretical efficiency of 300 lm/W, to shine at a brightness of 1000 lumen for 10 hours would take 120 kJ of energy, and the medium battery is only 56 kJ.
The in-game power draw is 1560 mW and a 150 lm/W luminous efficacy it would produce 234 lumen for the duration of 56 kJ / 1560 mW = 10 hours, which seems very close to the 300 lumen for 6 hours from the reference headlamp's spec.
Running a 56 kJ battery 6 hours at an efficiency of 150 lumen / W would produce 389 lumen.
I think they are close enough that we can consider a flashlight strapped to your head and a headlamp functionally the same item.
Describe the solution
Json edits to headlamp to match flashlight.
Describe alternatives you've considered
Make the recipes into a makeshift headlamp and create new a new item for a commercial headlamp. But as they would be so similar I don't think adding another item would achieve that much.
Testing
Additional context