[closed] Current tile temperature
Posted: Tue Aug 16, 2016 1:15 am
The tile temperature is set during map generation, and the API allows us to get that temperature. However...
It would be very desirable to have an additional API call to get current temperature based on time of day (map brightness).
For example, when the sun sets, I would expect temperatures to start dropping, eventually reaching a minimum based on tile elevation, etc. When sun rises, temperatures start to increase, reaching a peak around noon.
While I could code that sort of logic in to a mod, IMO it would be better for the game to provide it so that any mods wanting current tile temperature would get the same results without lots of code duplication. In addition, a mod trying to implement it has to access several values (elevation, brightness, etc) all of which need typecasting to Lua types.
Something like: TileProperties :: current_temperature
The default temperature would still be accessible via TileProperties :: temperature; it's useful to have that as it provides a rough average temperature for a tile.
It would be very desirable to have an additional API call to get current temperature based on time of day (map brightness).
For example, when the sun sets, I would expect temperatures to start dropping, eventually reaching a minimum based on tile elevation, etc. When sun rises, temperatures start to increase, reaching a peak around noon.
While I could code that sort of logic in to a mod, IMO it would be better for the game to provide it so that any mods wanting current tile temperature would get the same results without lots of code duplication. In addition, a mod trying to implement it has to access several values (elevation, brightness, etc) all of which need typecasting to Lua types.
Something like: TileProperties :: current_temperature
The default temperature would still be accessible via TileProperties :: temperature; it's useful to have that as it provides a rough average temperature for a tile.