ArrayKnight Posted June 27, 2014 Share Posted June 27, 2014 I just burnt through a ton of food before I realized that somehow standing next to my fire I was burning 951 calories an hour. Link to comment Share on other sites More sharing options...
Hinterland Raphael van Lierop Posted June 30, 2014 Hinterland Share Posted June 30, 2014 This seems very wrong. We'll look into it. Link to comment Share on other sites More sharing options...
Guest Alan Lawrance Posted July 1, 2014 Share Posted July 1, 2014 For those that may be curious, here is the code that updates the calorie burn rate: public void UpdateCalorieBurnRate() { float burnRate = 0f; if (PlayerIsRunning()) { burnRate = m_HungerComponent.m_CalorieBurnPerHourRunning; } else if (PlayerIsWalking()) { burnRate = m_HungerComponent.m_CalorieBurnPerHourWalking; } else if (PlayerIsSleeping()) { burnRate = m_HungerComponent.m_CalorieBurnPerHourSleeping; } else if (PlayerIsForagingWood()) { burnRate = m_HungerComponent.m_CalorieBurnPerHourForagingWood; } else { burnRate = m_HungerComponent.m_CalorieBurnPerHourStanding; } // add to calorie burn based on inventory weight if (!PlayerIsSleeping()) { burnRate += GameManager.GetEncumberComponent().GetHourlyCalorieBurnFromWeight(); } // increase calorie burn rate due to player being cold burnRate += m_FreezingComponent.m_CurrentFreezing * m_FreezingComponent.m_CalorieBurnMultiplier;For inventory weight, we increase the burn rate by 5 for each KG of gear. For being cold, the maximum calorie burn addition is 150 (1.5 * freezing_level), since freezing is tracked as a number from 0 to 100.From the above screen you are warm, so the only way to get to 951 burn would be for the game to think you were still running, and then applying the gear penalty. The burn per hour while running is 800 (on flat ground), but it's only 100 while standing. So this gives me some good clues to work from. Link to comment Share on other sites More sharing options...
Guest Alan Lawrance Posted July 1, 2014 Share Posted July 1, 2014 It looks like the post removed the tabs used for formatting the code... sorry about that. My code is not that hard to read!Edit: Bug fixed for version v0.4. The problem was that you could invoke the survival panel while running, and the code that normally checks for the key-up event for running doesn't get called when the survival panel is active. So that key-up event got lost, and you were perpetually in a run state as far as the simulation was concerned (even when not moving).It would reset itself if you ran again (outside of the survival panel), so hopefully this didn't impact your playthrough too much. Link to comment Share on other sites More sharing options...
TattooedMac Posted July 1, 2014 Share Posted July 1, 2014 For those that may be curious, here is the code that updates the calorie burn rate: public void UpdateCalorieBurnRate() { float burnRate = 0f; if (PlayerIsRunning()) { burnRate = m_HungerComponent.m_CalorieBurnPerHourRunning; } else if (PlayerIsWalking()) { burnRate = m_HungerComponent.m_CalorieBurnPerHourWalking; } else if (PlayerIsSleeping()) { burnRate = m_HungerComponent.m_CalorieBurnPerHourSleeping; } else if (PlayerIsForagingWood()) { burnRate = m_HungerComponent.m_CalorieBurnPerHourForagingWood; } else { burnRate = m_HungerComponent.m_CalorieBurnPerHourStanding; } // add to calorie burn based on inventory weight if (!PlayerIsSleeping()) { burnRate += GameManager.GetEncumberComponent().GetHourlyCalorieBurnFromWeight(); } // increase calorie burn rate due to player being cold burnRate += m_FreezingComponent.m_CurrentFreezing * m_FreezingComponent.m_CalorieBurnMultiplier;For inventory weight, we increase the burn rate by 5 for each KG of gear. For being cold, the maximum calorie burn addition is 150 (1.5 * freezing_level), since freezing is tracked as a number from 0 to 100.From the above screen you are warm, so the only way to get to 951 burn would be for the game to think you were still running, and then applying the gear penalty. The burn per hour while running is 800 (on flat ground), but it's only 100 while standing. So this gives me some good clues to work from.Love it Alan. Thanks for giving us some insight to the code you are writing. . . . . This stuff is very interesting, and love seeing how you work out this and that. . . Would love to see more Link to comment Share on other sites More sharing options...
indianajonas Posted July 1, 2014 Share Posted July 1, 2014 Love it Alan. Thanks for giving us some insight to the code you are writing. . . . . This stuff is very interesting, and love seeing how you work out this and that. . . Would love to see more Same here. This look behind the curtain is much appreciated, Alan.Reading someones code is a lot of fun. (As a web developer I can read your code without any problems.) Link to comment Share on other sites More sharing options...
ArrayKnight Posted July 1, 2014 Author Share Posted July 1, 2014 Love it Alan. Thanks for giving us some insight to the code you are writing. . . . . This stuff is very interesting, and love seeing how you work out this and that. . . Would love to see more Same here. This look behind the curtain is much appreciated, Alan.Reading someones code is a lot of fun. (As a web developer I can read your code without any problems.)This makes me wish I was on the dev team. Link to comment Share on other sites More sharing options...
TattooedMac Posted July 2, 2014 Share Posted July 2, 2014 Reading someones code is a lot of fun. (As a web developer I can read your code without any problems.)Same here. Especially if it is nice and cleanly written. There is nothing worse when someone wants you to fix up their Website and the code is that unreadable you got no idea where to start, except from the scratch This is even better than looking at the in-house chat conversations :mrgreen: :mrgreen: Link to comment Share on other sites More sharing options...
Hinterland Raphael van Lierop Posted July 2, 2014 Hinterland Share Posted July 2, 2014 Alan is sharing our code in the forums? What madness is this! Link to comment Share on other sites More sharing options...
indianajonas Posted July 2, 2014 Share Posted July 2, 2014 Madness? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.