Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upHeat up bodyparts over adjacent fires #9974
Conversation
This comment has been minimized.
This comment has been minimized.
|
Nice catch re the coordinates. One thing I'd point out: any contained single-tile fire is going to be Small, and any fire larger than that is probably gonna get you Warm (if not Toasty) just fine on its own. |
This comment has been minimized.
This comment has been minimized.
|
It usually will, but especially badly-geared survivors still can use it. Also, winter lab dives without good equipment (just painkillers to stop frostbite pain) can benefit from it. Is there a good way of bypassing the convergent temperature thing when temperature is too low? It would be more useful if survivors with icicles for hands could heat up at full speed even if they only need a couple of degrees. |
This comment has been minimized.
This comment has been minimized.
|
Added rapid cooling and heating both to fires and sleeping. How it works from the realism perspective: This helps to make my idea useful: now you can set up a fire to quickly warm up frozen hands and go back to work, rather than just having a fire make your torso very warm while making hands cold (from freezing), because you spawned without winter gloves but with a winter coat. |
kevingranade
reviewed
Nov 11, 2014
| if (frostbite_timer[i] > 0) { | ||
| frostbite_timer[i] -= heat_intensity - fire_dist / 2; | ||
| } | ||
| temp_conv[i] += 300 * heat_intensity * heat_intensity / (fire_dist * fire_dist); | ||
| blister_count += heat_intensity / (fire_dist * fire_dist); | ||
| if( std::abs( j ) <= 1 && std::abs( k ) <= 1 ) { |
This comment has been minimized.
This comment has been minimized.
kevingranade
reviewed
Nov 11, 2014
| temp_cur[i] = temp_max; | ||
| } | ||
| // Don't alarm the player with this extra heat - it won't cause debuffs | ||
| if( temp_conv[i] > BODYTEMP_NORM ) { |
This comment has been minimized.
This comment has been minimized.
kevingranade
Nov 11, 2014
Member
I don't like playing games like this, it's either heating you up fast, or it's not. Whatever it's doing, display it.
kevingranade
reviewed
Nov 11, 2014
| @@ -1204,6 +1227,28 @@ void player::update_bodytemp() | |||
| if( temp_cur[i] != temp_conv[i] ) { | |||
| temp_cur[i] = temp_difference * exp(-0.002) + temp_conv[i] + rounding_error; | |||
| } | |||
| // Rapid heating with clothes on the ground or adjactent fire | |||
This comment has been minimized.
This comment has been minimized.
kevingranade
Nov 11, 2014
Member
This section is unnecessary and confusing, if you're introducing an additional heat source, bump up temp_conv and evaluate it as normal. If you're concerned about a spike in heat confusing the player, output some log messages letting them know what's happening.
This comment has been minimized.
This comment has been minimized.
|
I've tested a few ideas, but I'm not sure which one would be the most proper:
Anything better that I'm missing? |
This comment has been minimized.
This comment has been minimized.
|
Went with the inverted formula. I calculate desired temp_conv (+/- some), then try to get it by adding some or all of the bonus heat. I may have discovered a bug: fire temperature formula uses sees(int, int), which seems to use player::sees(int, int, int&) which respects clairvoyance and uses seen cache after that, possibly skipping fire obscured by smoke and fires not visible due to short-sightedness or blindness. |
This comment has been minimized.
This comment has been minimized.
|
My humble opinion: there is more furniture, as well as normal items, that can be used to "sit down by the fire", so 4 times difference for these 3 cases feels kind of odd. |
This comment has been minimized.
This comment has been minimized.
|
This is great work, fire code warming the player is something I've neglected for a long time. Looking at your work on lines 1218, I have a suggestion. You're trying to allow the player to warm up without letting him get too hot, right? So you're trying to calculate the buff needed to get you to comfortable. I would simply do "if (bonus_warmth > 0 && temp_cur[i] < BODYTEMP_WARM)". What would essentially happen is that the player would withdraw his hands when they are warm. But yeah, if you have any questions about the logic used, let me know! These are exciting changes. |
This comment has been minimized.
This comment has been minimized.
|
Very cool. The cleaned up code looks much better than the initial revision. I look forward to trying this out. |
kevingranade
reviewed
Nov 11, 2014
| break; | ||
| case bp_foot_l: | ||
| case bp_foot_r: | ||
| if( furn_at_pos == f_armchair || furn_at_pos == f_chair || furn_at_pos == f_bench ) { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Not sure if this does what you want, but have you considered maxxing the convergent temp at the lower bound of either warm or hot? That would basically model "You get as close as you can stand" (stand as in 'handle'). |
BevapDin
reviewed
Nov 11, 2014
| @@ -949,12 +950,16 @@ void player::update_bodytemp() | |||
| } | |||
| if (heat_intensity > 0 && sees(posx + j, posy + k)) { | |||
This comment has been minimized.
This comment has been minimized.
BevapDin
Nov 11, 2014
Contributor
map::sees might be useful here. It only checks the transparency of the squares via map::trans
This comment has been minimized.
This comment has been minimized.
|
Added cap Kevin mentioned. Makes sense and prevents scary big values in the UI. Now there's no outside way of seeing the fire heating, except for temperatures alone. Any good way of pointing out to player that this is the case? What about small "got comfy" morale bonus dependent on bonus heat when current temperature is below warm? This would trigger both during sleep (a bit better mood in the morning) and during crafting and skillbook reading sessions next to fire. |
This comment has been minimized.
This comment has been minimized.
|
A minor morale bonus (2-4 points) would be worthwhile. Unfortunately, you'd need to touch strings there. |
This comment has been minimized.
This comment has been minimized.
|
This is big enough to fall under the feature freeze anyway. |
This comment has been minimized.
This comment has been minimized.
|
Thaw'd. Finish this up and let's get it queued for testing. |
This comment has been minimized.
This comment has been minimized.
|
I tested the values on my side, found them a fair bit too small and buffed the entire thing. It's still nowhere near "a lot", but enough to make fireplaces actually matter, especially for bodyparts vulnerable to frostbite. Added the "comfy" morale bonus when the survivor is fully comfortable (no bodypart is warm or cold) and at least some bodyparts benefit from the bonus heat (ie. approach comfortable temp from below). Comfy bonus is applied for every bodypart, but has a global cap of 5. |
KA101
self-assigned this
Nov 17, 2014
This comment has been minimized.
This comment has been minimized.
|
May have to revisit comfy (and I'll add a translation note because it's slang USian: in future, you can do so by using |
Coolthulhu commentedNov 11, 2014
Makes the non-sleeping survivors heat up bodyparts when there's an adjacent fire. Torso, head and legs don't get much heat unless the fire is big. Arms get more and hands get a lot, because you can get them close to fire.
Feet get only a tiny bit, unless the survivor is on a chair and then they get a lot.
Only chairs, armchairs and benches are recognized as chairs. Beds would probably catch fire from the sparks, vehicle seats would probably be hard to get in a good position.
Any other good chair-type furniture? Something non-flammable would be nice, because currently comfy campfire isn't possible.
Only the best fire is used, because one cannot extend arm over two fires at once.
Additionally I fixed a moderately severe bug with fire heat: fire heat would use max(1,max(j, k)) as distance, despite j and k often having negative values. This would make fires to the north and to the west always as hot as if they were adjacent.