Author Topic: Change Length of Year  (Read 2379 times)

Jeremy

  • Newbie
  • *
  • Posts: 3
    • View Profile
Change Length of Year
« on: April 28, 2017, 03:46:44 PM »
I'm working on game that is intended to span several in game years with years taking maybe 10 hours of playtime (I could see it at 4-6 hours per year). With a 365 day year this makes each day less than 2 minutes long - ideally each day could be 10-20 minutes long. 2 minute long days is not an option.

Is there a way to reduce the number of days in the year?

I've been digging in the code a bit. Looks like the length of each month is set in the RecalculateLeapYear function (line 3300 of Tenkuko Module) could these lengths be changed to get a shorter year? Will this have other effects? I'm mostly concerned with visual jumps in lighting, I don't really care about accuracy of the moon or stars - but want to maintain overall seasonal lighting changes. Could this cause problems? Is there a better way to shorten the year? Are there other values I would need to change?

Is there a way to set the time/date by script?

I have a climate simulation that has it's own clock/calendar and I would like to sync the Dynamic Sky clock/calendar to the simulation (rather than the other way around). It looks like there are "currentDay," "currentHour,"etc variables in the Tenkuko Module script. These are public so is setting these values the best way to change the Dynamic Sky clock/calendar? Or is there a better way to do it?




Chingwa

  • Administrator
  • Hero Member
  • *****
  • Posts: 1704
    • View Profile
    • Tanuki Digital
Re: Change Length of Year
« Reply #1 on: April 28, 2017, 08:24:25 PM »
Hi Jeremy,

Well I must say this is the first time anyone has ever asked me about this.  AS I was looking into this a bit in the code I noticed there is actually a bug in the time progression when the time multiplier is set to a very high amount.  I will need to fix and address this I think before I can fully answer your question.  I suspect that the best way to do this is to increase the day advance in the code, so instead of advancing one day at each interval it advances 2 or 4 or etc.  This is probably the most straight-forward way to go about this without interrupting other lighting calculations.  But again, I will look into this a bit more and get back to you with a more solid answer.

As for the timing by script, yes the currentDay, currentHour, currentMinute etc. variables are what I suggest when setting custom time from code.  You can see a list of most common variables starting on page 8 of the documentation here:
http://www.tanukidigital.com/tenkoku/documentation/tenkoku_documentation.pdf

There have been a number of improvements since this documentation PDF was updated, but the listed variables are still valid.  If you have any questions about this then just let me know.


mattis

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
    • Youtube
Re: Change Length of Year
« Reply #2 on: April 29, 2017, 06:00:54 AM »
hmm, just reading this gave me an idea´ to my game, would be cool to dislplay "Wich Day it is, time, and year" , i tried to look at the documentation at page 16, but I got error message saying that it´s the wrong reference...

This dosent work ; moduleObject = GameObject.Find(“SUIMONO_Module”).gameObject.GetComponent<Suimono.Core.SuimonoModule>();

I tried to make the blur on the camera when im underwater... but i didnt get so far..

// Mattis
Instagram: AstralStorm Games
Youtube: AstralStorm Games

Jeremy

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Change Length of Year
« Reply #3 on: April 29, 2017, 05:20:06 PM »
Chingwa,

Thanks for the feedback.

I've got my scripts controlling the time and date, but as expected (even with 10 day months) there is a jump in the light when changing months. This is an easier work around than the super short days. This will occur once every 2-3 hours of game play so I can work with that - might be 4th wall breaking, but it's doable.

I hope to hear more from you if you find a more complete solution.

Jeremy

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Change Length of Year
« Reply #4 on: August 04, 2017, 09:33:58 PM »
Don't suppose there's a solution to this one yet?