Code center > Bug reports
2.42.7 bugs/questions
EricL:
if the sim nrg level triggers a threshold, the day/night cycle is paused. if it is daytime with 500 cycles to go with you exceed the sun down threshold, once the energy drops below that you will still have 500 cycles to go until normal sunset. If you pop back up again after only one cycle, then once you drop down again you will have 499 cycles of daylight to go, etc.
Griz:
well ...
perhaps that's how it happens ...
but I have yet to 'see it' do so.
mostly it just cycles and cycles and cycles ...
and I never do see the day/night cycle take control.
now why wouldn't one want to enforce nighttime ...
and actually begin the 500 [or whatever] cycles of night ....
once the upper energy level setpoint is reached?
and force sunrise in the same way at the lower setpoint?
that would avoid all that cycling around the setpoints.
or at least do so when one has the day/night cycling disabled ...
as it is always daytime with it disabled, is it not?
so as soon as the energy drops below the upper limit ...
we are back to full sunlight ...
which pushes the energy back up ...
and there we go with the blinkin' sun again.
with day/night cycle disabled ...
it would be nice to have the upper setpoint force the sun to set ...
and remain set until the lower setpoint forced it to rise again ...
and remain up until past the upper energy setpoint once more.
just like a sump pump works, ya know?
rather than all that cycling around either setpoint.
with day/night cycles enabled ....
well ... whatever ...
but it seems to me that even then ...
the correct status ...
sun up or down ...
and the cycle count ...
should be reset at that point as well.
can you steer me to the code/subroutines where this takes place?
or give me some variable names that I can search for?
I'd like to play with it a little bit ...
if for no other reason than to learn a little more about
how you have set it up, so it makes sense to me.
tanks
EricL:
From your description of what you are seeing, the feature is working as I intended though what I intended may of course, not be ideal or meet everyone's needs.
You suggest several new/different options:
1) triggerring actual night (or day) early (if using day/night cycles) when the sun set threshold is reached (and vice versa) in effect speeding up time instead of pausing it
2) single toggle sun up and sun down "sump pump" thresholds which set the sun when the sun set nrg threshold is reached (and vice versa) but don't revert back to the previous sun state until and unless the other threshold is crossed
Both of these are viable, interesting and easily implementable. I just didn't do it that way though adding the code to do so would be easy. My thinking was simply to override whatever the regular sun state is, day/night cycles or not, while the nrg is above or below the speciifc threshold. Then once the nrg comes back in line, resume whatever was happening (either perpetural daylight or carry on the sun rise/set cycles where we left off). That's all the code does today. If you want I could easily add the options you suggest in the next drop.
The interesting code to look at is in the feedvegs() routine in the Vegs module.
Griz:
yes ...
I understand your thinking with the overide ...
and yes, it does seem to function as intended ...
although a little difficult to 'see' as one never
knows for sure where the original rise/set sequence
is in it's timing when coming back out of 'overide' ...
and if in the 'wrong' phase ...
does result in this 'cycling' about the setpoint(s) ...
at either 'end', btw.
iow ... there are two systems attempting to control
whether the sun is up or down, and at times they
are in conflict. imo. ime.
to me, this results in 'interferring' or taking control
away from me as experimenter if I am trying to set
up a 'energy sim' in an effort to 'balance' forces
of energy in/out, with various bots, nrg/cycle,
costs, etc ... as my variables.
iow, I want control of all the variables.
I can't get consistant results, as my experimental
'system' keeps changing on it's own.
but that part is ok ...
the auto day/night cycle thing ...
I rarely use it anyway.
but the idea of using rise/set ...
and auto costs ...
to contol the sim as a whole is wonderful.
so here's where I have a problem ...
I had assumed when the day/night cycle is 'disabled' ...
(which is what I want to use) ...
that I could then simply use the energy setpoints to control
the low and high limits of energy in the sim ...
that they did then indeed 'override' any rise/set cycle.
the 'low' one works fine ....
ie ... when below the setpoint, the sun is 'on'.
as energy increases and we go above the setpoint ...
no problem, the sun is still 'up', as with the day/night
cycle disabled, it's default is ON, eh?
and when the energy reaches the upper limit setpoint ...
the sun is forced down. wonderful!
but ... as soon as the energy drops back below that high limit ...
on comes the sun again, as this is the 'default' ...
sun always up.
and there I am stuck ... cycling about that point.
that's fine if that's what one wishes to do ...
but that could also be accomplished by bringing the low
and high setpoints close together.
so, although I don't like how the day/night cycle, when enabled,
works, imo, against the energy setpoints at times ...
that's ok. I can live with it.
but ... with day/night cycles disabled ...
the high setpoint does not allow the energy to come back
down below that upper limit.
that's what I was looking to do ...
and how I expected it to work.
that ... I would like to see.
will take a look at that feedvegs() routine
hey ... the energy graph is great!
watching it over a period of time ...
one can see if the 'system' is gaining/losing as a whole ...
and use this to adjust nrg input via vegs to 'fine tune' the sim.
this is exactly what I had hoped to be able to do ...
and this feedback is a great tool.
now if I could actually control this sun up/down thing ...
and have it consistantly do the same thing as a function
of energy alone, not as a function of time of rise/set ...
and get a stable sim going as a benchmark ...
then I can begin to see how altering costs affects it.
this is what I am looking for ...
a way to have control ...
ie ... be able to alter one variable at a time and monitor
the results on the 'system' as a whole.
the sun rise/set thing as it is ...
tends to take that control away.
that's my take, anyway ...
where I'm coming from ...
if you get my meaning ...
catch my dritft.
hey ...
DB is evoloving wonderfully ...
and has regained my attention ...
and I am once again excited with playing ...
to the detriment of getting out and doing the
things I should be doing, I should add ...
like gardening and fishing and being outdoors
enjoying the summer!!!!
is DB a blessing or a curse?
a little of both, I imagine.
thanks again for all the work ...
great stuff.
Griz:
ok Eric ...
here's the routine.
I have a few questions ...
as I don't know what all these variables do ...
and what others one might also have to consider ...
~~~
--- Code: ---' gives vegs their energy meal
Public Sub feedvegs(totnrg As Long, totv As Integer)
Dim n As node
Dim t As Integer
Dim tok As Single
Dim depth As Long
Dim daymod As Single
Dim Energy As Single
Dim body As Single
Dim FeedThisCycle As Boolean
Dim OverrideDayNight As Boolean
Const Constant As Single = 0.00000005859375
Dim temp As Single
FeedThisCycle = True
OverrideDayNight = False
--- End code ---
ok. the following two portions of code are used to 'force' the sun up or down.
SimOpts.SunUp and SimOpts.SunDown are set to True (non-zero)
by checking the boxes for the upper and lower thresholds, yes?
--- Code: --- If SimOpts.SunUp Then
If TotalSimEnergyDisplayed < SimOpts.SunUpThreshold Then
FeedThisCycle = True ' Sim Energy has fallen below the threshold. Let the sun shine!
OverrideDayNight = True
End If
End If
If SimOpts.SunDown Then
If TotalSimEnergyDisplayed > SimOpts.SunDownThreshold Then
FeedThisCycle = False ' Sim energy has exceeded our threshold. Let the sun set!
OverrideDayNight = True
End If
End If
--- End code ---
now what variable,if any, does unchecking the box "Enable Day/Night" set?
SimOpts.DayNight ???
OverrideDayNight allows the SunUpSunDown to overide day/night cycles ...
and that you are setting from within the code.
what I am looking for is the variable that tells us the day/night cycle is checked
as disabled ... and would then allow the Thresholds to be the ONLY factor in
determining whether the sun is up/down ...
a switch that sets the sun if energy goes above the upper threshold ...
and KEEPs is set until the energy falls below the lower threshold ...
where it is reset to have the sun UP until energy once again rises
above the upper threshold ...
and bypasses the day/night cycles if they are disabled.
the routine below, it seems to me ...
is the day/night cycle is enabled ... ie SimOpts.DayNight true ...
and we are between the thresholds ... Not OverrideDayNight
and therefore it goes back to the day/night clock.
--- Code: ---
If SimOpts.DayNight And Not OverrideDayNight Then
' Well, we are neither above nor below the threshold 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 = 0
End If
If SimOpts.Daytime Then
FeedThisCycle = True
Else
FeedThisCycle = False
End If
End If
--- End code ---
so ... couldn't we then use a routine here ...
or perhaps before the day/night cycle one above ...
to allow the thresholds alone to control the sun,
when the day/night cycle is disabled?
and to then skip the above routine.
ie ... along the lines of:
(I'm sure I have this messed up but you get the idea ...
with day/night disabled ...
only the thresholds control the sun ....
each switching it on or off ...
until the other resets it.
--- Code: ---if Not SimOpts.DayNight Then
If SimOpts.SunUp Then
If TotalSimEnergyDisplayed < SimOpts.SunUpThreshold Then
FeedThisCycle = True ' Sim Energy has fallen below the threshold. Let the sun shine!
End If
End If
If SimOpts.SunDown Then
If TotalSimEnergyDisplayed > SimOpts.SunDownThreshold Then
FeedThisCycle = False ' Sim energy has exceeded our threshold. Let the sun set!
End If
End If
End If
--- End code ---
just blindly feelin my way along
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version