Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Temperature Conversion Utility  (Read 13744 times)

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Temperature Conversion Utility
« on: March 25, 2011, 04:52:13 am »

I've been investigating material properties lately and found that there was no convenient way to easily convert DF's temperature to normal scales, so I made one.  It's just a simple HTML file with a bit of JavaScript, but hopefully it will make things easier for anyone trying to do a lot of conversions.

As such, feel free to host it, copy it, improve it or whatever.  If an admin can somehow integrate it into the wiki article on temperature, so much the better.

Download from DFFD

EDIT:  Added link to DFFD.
« Last Edit: March 25, 2011, 04:54:02 am by Uristocrat »
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.

narhiril

  • Bay Watcher
  • [DUTY_BOUND]
    • View Profile
Re: Temperature Conversion Utility
« Reply #1 on: March 25, 2011, 05:03:27 am »

Useful for me when making new materials with known real-world melting and boiling points.

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Re: Temperature Conversion Utility
« Reply #2 on: March 25, 2011, 05:12:48 am »

Useful for me when making new materials with known real-world melting and boiling points.

Yeah, after looking up all those density values, I was thinking about trying to dig up temperature values, too.
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.

Aramco

  • Bay Watcher
    • View Profile
Re: Temperature Conversion Utility
« Reply #3 on: March 25, 2011, 02:01:05 pm »

Convert to normal temperature?! Heresy! I have already converted my thermometer to measure in urists, so I'm set now.



Just kidding, Imma use it.
Logged
Or maybe there's a god who's just completely insane and sends you to Detroit, Michigan in a new body if you ever utter the name "Pat Sajak".

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Re: Temperature Conversion Utility
« Reply #4 on: March 25, 2011, 03:32:56 pm »

BTW, I noticed that Obsidian uses an extra high melting temperature, but the raws note that this is deliberate.  Does anyone know if there are any other temperature values that have to be wrong for in-game reasons?
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Re: Temperature Conversion Utility
« Reply #5 on: March 26, 2011, 03:32:50 pm »

Useful for me when making new materials with known real-world melting and boiling points.

You may also note that it gives you warnings about temperatures below absolute zero as well as temperatures higher than 65535 Urist (which is the maximum the game can handle).  And that it rounds everything to an integer (because the game doesn't really handle fractional temperatures, either).

In that vein, the point for absolute zero is a bit off, but close enough I guess.  Though I admit to wondering why Toady didn't just use Kelvin, which seems like a natural choice to fit into an unsigned integer.  Oh well :)
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Temperature Conversion Utility
« Reply #6 on: March 26, 2011, 03:36:47 pm »

I think it's deliberate for the upcoming magical arc, so we could have stuff like temperatures below absolute zero, but for magical purposes only.

P.S. The utility is nice, but you could make it to round properly (.5+ as +1).
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Re: Temperature Conversion Utility
« Reply #7 on: March 26, 2011, 05:02:48 pm »

I think it's deliberate for the upcoming magical arc, so we could have stuff like temperatures below absolute zero, but for magical purposes only.

P.S. The utility is nice, but you could make it to round properly (.5+ as +1).

It just uses Math.round() on the final temperature just before display.  Maybe your Math.round() uses the "round half to even" strategy?  That's often used in statistics and such because it does unbiased rounding.

Can you give me a test case / expected output / browser info?
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.

Trekkin

  • Bay Watcher
    • View Profile
Re: Temperature Conversion Utility
« Reply #8 on: March 26, 2011, 09:35:40 pm »

Is there a known expression for relating degrees Urist to embark temperature settings? If I set the world to have a uniform temperature of 0, what temperature will the world be in Urist?
Logged

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: Temperature Conversion Utility
« Reply #9 on: March 26, 2011, 09:46:13 pm »

For that matter, does anyone know why we can choose to have temperatures from -1000 to 1000 in Worldgen? The default is 0-100, but 1000??!?! I set them to their max ranges and I got a world with an ice sheet going from pole to pole, and an ocean I'm almost positive would evaporate on embark.
Logged
I like fortresses because they are still underground.

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Re: Temperature Conversion Utility
« Reply #10 on: March 26, 2011, 09:57:52 pm »

For that matter, does anyone know why we can choose to have temperatures from -1000 to 1000 in Worldgen? The default is 0-100, but 1000??!?! I set them to their max ranges and I got a world with an ice sheet going from pole to pole, and an ocean I'm almost positive would evaporate on embark.

10000 Urist is the freezing point of water.  One would assume that the temperature ranges were based around that, but I honestly don't know what base temperature it's using.

There shouldn't be any such thing as negative degrees Urist, but it could be adding/subtracting from a base temperature.  If it's doing that, my guess would be that it's using 10,000 Urist as the base, just because it's a nice, round number that's physically meaningful.
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: Temperature Conversion Utility
« Reply #11 on: March 26, 2011, 10:16:51 pm »

re-read.

-1000 to 1000 is the range

This does not overlap with the melting/boiling point type calculations at all.

I am confuse.
Logged
I like fortresses because they are still underground.

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Re: Temperature Conversion Utility
« Reply #12 on: March 26, 2011, 10:27:51 pm »

re-read.

-1000 to 1000 is the range

This does not overlap with the melting/boiling point type calculations at all.

I am confuse.

My guess was that it's actually 10000 +/- 1000.  Of course, 9000 Urist is actually below absolute zero and 11000 Urist is 1032 degrees F, so who knows?  If anyone has something that can read temperature values from the game, that might be of more help to you, but I don't know of any such thing.  Other modders might, though.
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.

Trekkin

  • Bay Watcher
    • View Profile
Re: Temperature Conversion Utility
« Reply #13 on: March 26, 2011, 10:40:54 pm »

If you modify the world gen init file directly, you can get values of up to -30000 degrees and beyond to be processed by the game, and if my tests with adventurers are of any indication the world actually is colder. That would seem to conflict with the straight addition theory.
Logged

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Re: Temperature Conversion Utility
« Reply #14 on: March 26, 2011, 10:46:54 pm »

If you modify the world gen init file directly, you can get values of up to -30000 degrees and beyond to be processed by the game, and if my tests with adventurers are of any indication the world actually is colder. That would seem to conflict with the straight addition theory.

It's also possible that the game converts the unsigned 16-bit integer into a signed 16-bit (or even signed 32-bit) integer internally, but that would tend to make the temperature scale even weirder, so I really don't know.  To be honest, I just used the wiki to make my utility, so I'm not too sure how one would go about figuring out all of that.
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.