Code center > Bug reports

2.42.7 bugs/questions

<< < (3/4) > >>

EricL:
Griz,

I've implemented your suggestions for 2.42.8.  The new code is below.  It replaces the second code segment in your last post.  It's pretty well commented so you should be able to see what I did.  I've also attached the entire Vegs module so you can see the complete routine.  Note that simply using this and trying to compile won't work as the UI is in a different module.

In short, the new var SimOpts.SunThresholdMode is set via the UI and is used to determine what to do when the thresholds are exceeded.  The options in the UI set the var to one of the following three cases:

TEMPSUNSUSPEND - Does what it does today - only suspends the day/night cycles (if being used) whiel the thresholds are exceeded.

ADVANCESUN - advances the sun to dawn or dusk based on which threshold is crossed.

PERMSUNADVANCE - Bascially ignores the dayloght cycles and sump pumps between the thresholds.

To answer your specific question, the var SimOpts.DayNight indicates whether Day Cyles are being used.  It's True if they are and False if not and set via the UI checkbox.  The var SimOpts.Daytime indicates whether it is currently daytime or not.

Let me know if you have further questions.




--- Code: ---  FeedThisCycle = SimOpts.Daytime 'Default is to feed if it is daytime, not feed if night
  OverrideDayNight = False
  
  If TotalSimEnergyDisplayed < SimOpts.SunUpThreshold And SimOpts.SunUp Then
    'Sim Energy has fallen below the threshold.  Let the sun shine!
    Select Case SimOpts.SunThresholdMode
      Case TEMPSUNSUSPEND:
        ' We only suspend the sun cycles for this cycle.  We want to feed this cycle, but not
        ' advance the sun or disable day/night cycles
        FeedThisCycle = True
        OverrideDayNight = True
      Case ADVANCESUN:
        'Speed up time until Dawn.  No need to override the day night cycles as we want them to take over.
        'Note that the real dawn won't actually start until the nrg climbs above the threshold since
        'we will keep coming in here and zeroing the counter, but that's probably okay.
        SimOpts.DayNightCycleCounter = 0
        SimOpts.Daytime = True
        FeedThisCycle = True
      Case PERMSUNSUSPEND:
        'We don't care about cycles.  We are just councing back and forth between the thresholds.
        'We want to feed this cycle.
        'We also want to turn on the sun.  The test below should avoid trying to execute day/night cycles.
        FeedThisCycle = True
        SimOpts.Daytime = True
    End Select
  ElseIf TotalSimEnergyDisplayed > SimOpts.SunDownThreshold And SimOpts.SunDown Then
    Select Case SimOpts.SunThresholdMode
      Case TEMPSUNSUSPEND:
        ' We only suspend the sun cycles for this cycle.  We do not want to feed this cycle, nor do we
        ' advance the sun or disable day/night cycles
        FeedThisCycle = False
        OverrideDayNight = True
      Case ADVANCESUN:
        'Speed up time until Dusk.  No need to override the day night cycles as we want them to take over.
        'Note that the real night time won't actually start until the nrg falls below the threshold since
        'we will keep coming in here and zeroing the counter, but that's probably okay.
        SimOpts.DayNightCycleCounter = 0
        SimOpts.Daytime = False
        FeedThisCycle = False
      Case PERMSUNSUSPEND:
        'We don't care about cycles.  We are just councing back and forth between the thresholds.
        'We do not want to feed this cycle.
        'We also want to turn off the sun.  The test below should avoid trying to execute day/night cycles
        FeedThisCycle = False
        SimOpts.Daytime = False
    End Select
  End If
  
  'In this mode, we ignore sun cycles and just bounce between thresholds.  I don't really want to add another
  'feature enable checkbox, so we will just test to make sure the user is using both thresholds.  If not, we
  'don't override the cycles even if one of the thresholds is set.
  If SimOpts.SunThresholdMode = PERMSUNSUSPEND And SimOpts.SunDown And SimOpts.SunUp Then OverrideDayNight = True
--- End code ---

Elite:
It's been crashing on me quite a lot

I tried to run a South Pacific Sim but it has been giving me errors. An already errored sim is attached. I'll try to get one that will crash

Elite:
This sim has been 'caught in the act' of overflowing

EricL:
Whoops.  I had an operator switched in some overflow protection I added in a previous version in FrictionForces().  Now the overflow will actually be caught.

Link to 2.42.7a is here.  This drop also contains the new incoming energy modes as described previously in this topic.

Elite:
I'm getting an incredibly weird bug

Go to 'load simulation' and then exit the window. An error appears. After that all the bots get skewed horizontally in a funny way if you are zoomed in, and it only works for large sizes for some reason.

I've attached a picture of the phenomenon. The eye orbit and squiggle in the bot seems to have been compressed. They look 3D!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version