{"action":"created","issue":{"url":"https://api.github.com/repos/minetest-mods/time_regulation/issues/2","repository_url":"https://api.github.com/repos/minetest-mods/time_regulation","labels_url":"https://api.github.com/repos/minetest-mods/time_regulation/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/minetest-mods/time_regulation/issues/2/comments","events_url":"https://api.github.com/repos/minetest-mods/time_regulation/issues/2/events","html_url":"https://github.com/minetest-mods/time_regulation/issues/2","id":134380808,"number":2,"title":"Add seasonal day/night variation","user":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-02-17T19:44:33Z","updated_at":"2016-02-22T20:45:55Z","closed_at":null,"body":"With a bit of math, one could easily vary the day/night length according to a sine curve and create the effect of seasons, at least daylight wise.\r\n\r\nIt would require 2 parameters: ```length``` and ```offset``` (read like \"year length\" and \"latitude\")\r\n\r\nthe daily variation can be calculated by\r\n```\r\n    ratio = ((math.cos((day_of_year / length) * 2 * math.pi()) * offset) / 2.0) + 0.5\r\n    nightratio = ratio\r\n    dayratio = - ratio \r\n```\r\n\r\n```offset``` should be a number between 0.0 and 1.0. At 0.0, there is no seasonal variation. At 1.0, the longest day has no darkness, and the shortest day has no lightness. Reasonable values are likely between 0.0 and 0.5 or so. At 0.5, the longest day is 75% of day length. At 0.2, the longest day is 60% of day length.\r\n\r\nI'd cap ratio at 0.9 or so, at 0.8 the longest day would be 90% daytime, and the moon would have to scream across the sky 5x as fast as normal."},"comment":{"url":"https://api.github.com/repos/minetest-mods/time_regulation/issues/comments/187375812","html_url":"https://github.com/minetest-mods/time_regulation/issues/2#issuecomment-187375812","issue_url":"https://api.github.com/repos/minetest-mods/time_regulation/issues/2","id":187375812,"user":{"login":"sofar","id":1880041,"avatar_url":"https://avatars.githubusercontent.com/u/1880041?v=3","gravatar_id":"","url":"https://api.github.com/users/sofar","html_url":"https://github.com/sofar","followers_url":"https://api.github.com/users/sofar/followers","following_url":"https://api.github.com/users/sofar/following{/other_user}","gists_url":"https://api.github.com/users/sofar/gists{/gist_id}","starred_url":"https://api.github.com/users/sofar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sofar/subscriptions","organizations_url":"https://api.github.com/users/sofar/orgs","repos_url":"https://api.github.com/users/sofar/repos","events_url":"https://api.github.com/users/sofar/events{/privacy}","received_events_url":"https://api.github.com/users/sofar/received_events","type":"User","site_admin":false},"created_at":"2016-02-22T20:45:55Z","updated_at":"2016-02-22T20:45:55Z","body":"We'll have to overwrite ```core.set_timeofday```. I had previously written a concept 'calendar' mod that has some of this code, I can see if I can brush it up again."}}