rubenwardy wrote:I was thinking about this as well. It would be possibly better and faster to do this per X/Z rather than per node (X/Y/Z), so it is the surface temperature.
This could be easy to do, but not easy to do in a way that is cpu efficient.
function get_temperature(pos)
local heat = heat_perlin(pos)
heat = heat+meta(pos):get_value("heat_add")
if pos.y >= 0 then
if night then
heat = heat -10
end
end
return heat
end
cornellius wrote:LOL i think Temperature system is too hard even minecraft don't have anything about temperature
mauvebic wrote:If youre using the default heatmap then yeah your job just got real easy. Start off by writing a thermometer (like the handheld compass mod or something using hud) and start coming up with cases for different sets of values.
Though, these (presumably large) lua tables, how would you keep them in sync with the world as other players/mods make changes, without using more resources than an abm?
MirceaKitsune wrote:But from what PilzAdam is saying about mapgen v7 having a perlin heat map, my idea might actually be pointless. Since that sounds accurate enough to do the bidding I wanted this idea to. This heat map should be possible to use for all my ideas (weather, water turning to ice, etc). Only use I believe my idea would still have then is to warm up houses in snow biomes. But at best, I will look into that when v7 is stable and I can take a closer look at its perlin heat.
--Snow biomes are found at 0.53 and greater perlin noise.
local perlin1 = env:get_perlin(112,3, 0.5, 150)
PilzAdam wrote:ABMs are definitely not good for calculating heat.
Mapgen v7 has a heat perlin noise. Grab this perlin noise and take it as a base for your heat calculation.
Add on_place() and on_dig() callbacks to nodes that emit heat (furnaces, torches, lava) where you set a "heat_add" value in metadata of nodes in a certain radius. When calling get_temperature(pos) add this value to the base perlin noise.
Additionally you can increase/decrease the value a bit based on daytime if you are above y=0.
Some pseudo code to explain my idea better:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
function get_temperature(pos)
local heat = heat_perlin(pos)
heat = heat+meta(pos):get_value("heat_add")
if pos.y >= 0 then
if night then
heat = heat -10
end
end
return heat
end
Snow could run an ABM that checks if the heat is too high, and remove itself.
Flowers and grass can turn into dry_shrub.
The player could get damage if its too cold and move slower if its too warm.
Users browsing this forum: No registered users and 10 guests