possible new bug - relto tree

Announcements and discussion regarding the Gehn CWE Shard.

Moderator: Gehn Shard

Re: possible new bug - relto tree

Postby dtierce » Mon Mar 26, 2012 10:35 pm

I can see how growth could be slowed by spacing cavern visits more than 15 days. The code clearly stores the last growth time to be the time of this calculation... not when the growth should have occurred. If your last visit was 29 days previous, you would get one bump to growth and would have to wait another 15 days for the next. To be accurate, the sdl variable for YP10LastTreeGrowth should be set to "lastGrowth + ( sizes * dayLength * 15 )". In the 29 day scenario I mentioned, this would set the new "last growth" to 14 days prior or 15 days after the last growth.

Code: Select all
dayLength = 86400  # number of seconds in a day
growth_Interval = 15 * dayLength # seconds between growth spurts for 15 day interval

 [... break in code ...]

    timeDelta = currentTime - lastGrowth
    sizes = timeDelta / growth_Interval

if sizes > 0:
    sdl["YP10LastTreeGrowth"] = (currentTime,)  # Should be = lastGrowth + ( sizes * growth_Interval )



Looking at the code, I don't see any obvious reason for accelerated growth unless it gets a bogus value from PtGetDniTime() or somehow misreads the sdl value for YP10LastTreeGrowth. Multiple simultaneous calls from multiple threads (if that's possible) might result in the size possibly being bumped multiple times in one visit. Someone familiar with the overall code architecture would have to determine if that is even possible. A more accurate calculation could be done by computing the absolute size based on the time since the first visit rather than by computing an incremental size. With an absolute calculation, spurious values retrieved once would be corrected on the next visit.

Code: Select all
currentTime = PtGetDniTime()

treeBaseline = sdl["YP10FirstTreeVisit"]
if treeBaseLine == 0;
        treeBaseLine = currentTime
        sdl["YP10FirstTreeVisit"] = treeBaseLine

dayLength = 86400  # number of seconds in a day
growth_Interval = 15 * dayLength  # seconds between growth spurts for 15 day interval

absoluteTreeSize = 1 + ( currentTime - treeBaseLine ) / growth_Interval

return absoluteTreeSize


Please pardon any syntax errors since I am not well-versed in Python. It has been a few years since I dabbled with it.

David Tierce

Edit: fixed incomplete line for sdl initialization on first visit
Last edited by dtierce on Wed Mar 28, 2012 12:10 am, edited 2 times in total.
MOULa-KI: 15763576
GEHN-KI: 00022090
DI-KI: 00145074
User avatar
dtierce
 
Posts: 66
Joined: Tue Apr 29, 2008 10:45 pm
Location: Oklahoma City, Ok.

Re: possible new bug - relto tree

Postby Deledrius » Mon Mar 26, 2012 10:42 pm

Oh, nice catch on the last visit bug, and good thinking in the fix. :D
User avatar
Deledrius
Gehn Shard Admin
 
Posts: 1377
Joined: Mon Oct 01, 2007 1:21 pm

Re: possible new bug - relto tree

Postby johnsojc » Tue Mar 27, 2012 4:04 am

Do you really want the tree to grow when you are not around? You could start an avatar and for some reason not go back to it for a few months. Then you return to discover your little tree towering in the sky good only for lumber.

I would rather see each stage. If the time since last growth is > a certain interval, then the tree would grow 1 and only 1 stage... no skipping stages. One of the major complaints during MOUL was that people would not or could not be in the cavern to witness events happening.
johnsojc
 
Posts: 246
Joined: Sun Dec 07, 2008 10:27 am

Re: possible new bug - relto tree

Postby dtierce » Wed Mar 28, 2012 12:13 am

johnsojc wrote:Do you really want the tree to grow when you are not around? You could start an avatar and for some reason not go back to it for a few months. Then you return to discover your little tree towering in the sky good only for lumber.


Yes, I think it should behave like a real tree. Real trees grow whether you watch them or not :-) .

David Tierce
MOULa-KI: 15763576
GEHN-KI: 00022090
DI-KI: 00145074
User avatar
dtierce
 
Posts: 66
Joined: Tue Apr 29, 2008 10:45 pm
Location: Oklahoma City, Ok.

Re: possible new bug - relto tree

Postby Deledrius » Wed Mar 28, 2012 1:17 am

dtierce wrote:Real trees grow whether you watch them or not

How can you be certain?

;)
User avatar
Deledrius
Gehn Shard Admin
 
Posts: 1377
Joined: Mon Oct 01, 2007 1:21 pm

Re: possible new bug - relto tree

Postby D'Lanor » Wed Mar 28, 2012 8:44 am

If it really has to behave like a real tree you should probably add some random functions. Trees don't grow absolutely regularly. Can we be sure that the observed "bug" was not added to provide some irregularity? :D
"It is in self-limitation that a master first shows himself." - Goethe
User avatar
D'Lanor
 
Posts: 1980
Joined: Sat Sep 29, 2007 4:24 am

Re: possible new bug - relto tree

Postby Acorn » Tue Apr 03, 2012 3:19 pm

yay - I've now caught my tree growing rapidly for my other avvie and I've found out what's happening.

It's not saving the new time of last growth, so it grows again when I go somewhere else and then navigate back again to relto. It just grew twice within a few minutes. I logged out, looked at the log and saw what was happening, so I then restarted and it grew another two stages. I've got the two logs but here are some extracts:

[previous visit]

(04/02 21:33:40) Growsizes: 0
(04/02 21:33:40) CurrentValue: 11, size: 1, state 1
(04/02 21:33:40) psnlYeeshaPageChanges: Attempting to disable drawing and collision on PonderosaBig_02...
(04/02 21:33:40) Dni time: 1333377219, last growth: 1332082470

[then the fun starts]

(04/03 22:45:56) Dni time: 1333467954, last growth: 1332082470
(04/03 22:45:56) Growsizes: 1
(04/03 22:45:56) CurrentValue: 11, size: 2, state 1
(04/03 22:45:56) psnlYeeshaPageChanges: Attempting to disable drawing and collision on PondorosaBig_09...
(04/03 22:45:56) Dni time: 1333467954, last growth: 1333467954
(04/03 22:45:56) Growsizes: 0
(04/03 22:45:56) CurrentValue: 21, size: 2, state 1
(04/03 22:45:56) psnlYeeshaPageChanges: Attempting to disable drawing and collision on PonderosaBig_01...
(04/03 22:45:56) Dni time: 1333467954, last growth: 1333467954
(04/03 22:45:56) Growsizes: 0

[navigate away to Eder Gira and link back in]

(04/03 22:49:06) Dni time: 1333468144, last growth: 1332082470
(04/03 22:49:06) Growsizes: 1
(04/03 22:49:06) CurrentValue: 21, size: 3, state 1
(04/03 22:49:06) psnlYeeshaPageChanges: Attempting to disable drawing and collision on PondorosaBig_09...
(04/03 22:49:06) Dni time: 1333468144, last growth: 1333468144
(04/03 22:49:06) Growsizes: 0
(04/03 22:49:06) CurrentValue: 31, size: 3, state 1

[log out and log back in]

(04/03 23:00:28) Dni time: 1333468826, last growth: 1332082470
(04/03 23:00:28) Growsizes: 1
(04/03 23:00:28) CurrentValue: 31, size: 4, state 1
(04/03 23:00:28) psnlYeeshaPageChanges: Attempting to disable drawing and collision on PondorosaBig_09...
(04/03 23:00:28) Dni time: 1333468826, last growth: 1333468826
(04/03 23:00:28) Growsizes: 0
(04/03 23:00:28) CurrentValue: 41, size: 4, state 1
(04/03 23:00:28) psnlYeeshaPageChanges: Attempting to disable drawing and collision on PonderosaBig_01...
(04/03 23:00:28) Dni time: 1333468826, last growth: 1333468826

[navigate away to Teledahn and back again]

(04/03 23:02:44) Dni time: 1333468962, last growth: 1332082470
(04/03 23:02:44) Growsizes: 1
(04/03 23:02:44) CurrentValue: 41, size: 5, state 1
(04/03 23:02:44) psnlYeeshaPageChanges: Attempting to disable drawing and collision on PondorosaBig_09...
(04/03 23:02:44) Dni time: 1333468962, last growth: 1333468962
(04/03 23:02:44) Growsizes: 0
(04/03 23:02:44) CurrentValue: 51, size: 5, state 1
(04/03 23:02:44) psnlYeeshaPageChanges: Attempting to disable drawing and collision on PonderosaBig_01...
(04/03 23:02:44) Dni time: 1333468962, last growth: 1333468962

Do you need the full logs? Anything else I can do to help test this while it's still growing?
Image
Acorn
 
Posts: 724
Joined: Sun Feb 26, 2012 9:56 am

Re: possible new bug - relto tree

Postby Acorn » Tue Apr 03, 2012 3:26 pm

(strong stuff, that Miracle-Gro!)
Image
Acorn
 
Posts: 724
Joined: Sun Feb 26, 2012 9:56 am

Re: possible new bug - relto tree

Postby johnsojc » Tue Apr 03, 2012 4:29 pm

Great work, Acorn. At least now we know we weren't just seeing things. I will try to duplicate your findings just to be thorough...

However, I can't seem to get it to fail for me... maybe it happens when the tree starts to grow (growsizes > 0)... it's only been 12 days since I started my tree... 3 days to go... problem must be a very subtle logic glitch or it's a failure to update the vault. I noticed on your link to Teledahn and back it jumped another stage at which point the time of last growth finally updated. Very odd...

Now that your time of last growth updated, I suspect it will be 15 days before it will do anything again. I will look to see if jumping back and forth when growsizes is 1 or more does something odd. Curious to know if you quit or logout/quit.

If you wish to view the log without logging out, you can copy the log file to your desktop and view the copy.

(query to the gurus... is the last time of growth stored in the server vault or kept locally on the PC?... )

This might be where it's failing for whatever reason:
Code: Select all
        if sizes > 0:
            sdl["YP10LastTreeGrowth"] = (currentTime,)
johnsojc
 
Posts: 246
Joined: Sun Dec 07, 2008 10:27 am

Re: possible new bug - relto tree

Postby Tsar Hoikas » Tue Apr 03, 2012 6:05 pm

Long story short: SDL is saved on the server

;)
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia

PreviousNext

Return to Gehn Shard

Who is online

Users browsing this forum: No registered users and 1 guest

cron