# Heat Formula?

1. Mar 4, 2012

### lxXTaCoXxl

I'm a game developer and I have an idea to make something heat up and cool off and I would like to use realistic style formulas to do the math. Instead of making it add dramatically over time. I basically need a formula for adding and removing heat from a 2 dimensional vector based on acceleration. The idea is that when the player is moving, heat will be added, and when the player is not moving heat will be reduced. So a formula and a brief explanation of the formula would be a big help.

Thanks,
Jamie

2. Mar 4, 2012

### Hobold

Hello!

Heat transfer is a though thing. This heat process you describe is very complex and if you want to make it realistic you must acknowledge you are going into a bunch of physics. Heat transfer is mainly governed by three physical phenomena: convection, radiation and conduction. It really depends on what you are considering to "shout a formula" (such a thing doesn't even exist, actually). Modelling a game this realistically would take a lot of effort and depends on many factors such as the environment, what is around your object and even the weather.

3. Mar 4, 2012

### lxXTaCoXxl

Okay well I'm not wanting it that realistic really, I mean I want the rate of change to be realistically based on movement (like say friction or extreme pressure) for a perfect example you can't start a fire under water, so in the level that is water based the player's temperature grows colder while they are submerged, and while they are above the surface the temperature of the player increases (if the player gets too cold they begin moving slower, and eventually turn into a block of ice (cartoon style game) and loses a life. The first level is in space so I do believe fire isn't possible there (from what I remember space is a vacuum meaning no air, and no air means no fire since it's the main contributing factor to a flame) so it isn't as realistic as I made it out to be but I still want some of the basic physics formulas to apply; for example I visited the library on this site and found the following formula for heat that should help to add and remove slowly from the temperature of the player.

Heat
Î”U = Q + W
Q = Initial Heat
W = Work Done

That's how I understand it anyways. Thank you for your swift reply, please note I don't have an awesome habit of asking the correct questions for some reason.

4. Mar 4, 2012

### Hobold

Still there is a lot to take in account.

For space, let's see: the player will lose heat to space mainly by radiation. We would have to simplify this a lot, such as: considering a human being is made of around 70% water, let's make it a round ball of water. Also, this ball of water is in thermodynamical equilibrium at every timestep, that is, the temperature is always equal in the whole body of the player at any given time. Also, the player exchanges heat only by radiation and emits it spherically as a point, obeying Planck's law for a blackbody (this is a "formula" developed by Planck for a blackbody, which is a body that emits the largest amount of energy than any other at the same temperature). Then we would have to make an energy balance, which is basically the formula you put in there.

Even though there is a lot of simplifications involved the analysis I just made and it is probably not hard to implement in your code, you must know some physics to understand everything and this is just for one level (and space is probably the easiest one to model). Even though I have no experience in game design, I don't think the analysis I just made would be much more accurate than an intuitive and simple formula, such as "I believe the player will lose about 10 degrees Celsius in 7 seconds" and adjusting as you wish.

However, if you want to model everything physically, I believe that you should either have someone who knows physics to work with you (if you don't know, of course) or start digging into physics textbooks, specially thermodynamics (which will probably take much longer, but you'll gain knowledge).

5. Mar 4, 2012

### jim hardy

Try search on "Newtons Law of Cooling"

it's good enough for everyday work.

Share this great discussion with others via Reddit, Google+, Twitter, or Facebook