Author Topic: Weather  (Read 2790 times)

Offline spork22

  • Bot Destroyer
  • ***
  • Posts: 328
    • View Profile
Weather
« on: July 12, 2014, 02:55:55 PM »
Perhaps there could be an option that when activated makes the sun turn on and off randomly in no predetermined order. Because of the random times of darkness, plants wouldn't get their energy as much. This would discourage zerobots to evolve chloroplasts, as they aren't a constant source of energy anymore.
Hubba Jubba Lollywash!

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Weather
« Reply #1 on: July 12, 2014, 07:13:30 PM »
I will add an option to randomize the 'sun on' time.
« Last Edit: July 12, 2014, 07:35:13 PM by Botsareus »

Offline Panda

  • Global Moderator
  • Bot Destroyer
  • *****
  • Posts: 476
  • Computer Science Undergraduate (nerd)
    • View Profile
Re: Weather
« Reply #2 on: July 13, 2014, 12:47:39 PM »
That's a good idea. Rather than just on or off, do you think an intensity modifier would be good?

Offline Botsareus

  • Society makes it all backwards - there is a good reason for that
  • Bot God
  • *****
  • Posts: 4483
    • View Profile
Re: Weather
« Reply #3 on: July 13, 2014, 12:52:00 PM »
Here is what I was thinking.
Put a very simple boolean in, call it "sunonrnd"
The code mod is as follows:

If SimOpts.DayNight And Not OverrideDayNight Then
      'Well, we are neither above nor below the thresholds or we arn't using thresholds so lets see if it's time to rise and shine
      SimOpts.DayNightCycleCounter = SimOpts.DayNightCycleCounter + 1
      If SimOpts.DayNightCycleCounter > SimOpts.CycleLength Then
        SimOpts.Daytime = Not SimOpts.Daytime
        SimOpts.DayNightCycleCounter = IIF(sunonrnd, SimOpts.CycleLength * rnd, 0)
      End If
      If SimOpts.Daytime Then
        FeedThisCycle = True
      Else
        FeedThisCycle = False
      End If
  End If

And that is the least pain in the a** way to implement this thing.
edit: I am thinking just mod it further to randomize only the 'on' cycles while leaving the 'off' cycles at 0.
« Last Edit: July 13, 2014, 12:54:06 PM by Botsareus »

Offline spork22

  • Bot Destroyer
  • ***
  • Posts: 328
    • View Profile
Re: Weather
« Reply #4 on: July 13, 2014, 04:10:11 PM »
I'm glad you guys like my idea.  :D
Hubba Jubba Lollywash!