Email Address:
Password:
Forgot Password?
Advanced Search
Active Players on Sylestia
Category Total Yesterday
Players 2,411 375
Sylestia Pet Data
Category Total Yesterday
Pets 8,241,199 1,270
Generated 656,170 19
Captured 1,190,409 63
Bred 6,394,525 1,188
Statistics updated daily at midnight
Forum Index > Bug Reporting > Stable Log - Lacked 0 Gold to Feed Pets
Page 3 1, 2, 3, 4, 5 Go to Page:
Author Thread Post
Krinadon
Level 75
Shadow of the Moon
Site Administrator
Joined: 12/17/2012
Threads: 1,119
Posts: 14,687
Posted: 5/5/2019 at 5:19 PM Post #21
I'm not 100% sure as this is coming from my memory, but I think each of the scripts run assuming everything went as planned above. Checks are skipped to save time and energy as, even cutting corners, the process probably still takes many many seconds of just pure database computation - which is an eternity in the database world.

So basically, it first runs a script to reduce hunger on all applicable pets. This probably takes 10-20+ seconds.

Then, it runs a script to find all stablehands and then figure out the cost. It has to know current hunger values because not every pet is going to be 9/10 after the first script runs. However, the first script is taking so long to run, it's grabbing hunger data from pets who haven't had their hunger reduced yet. Thus the weird gold charges. During this it also checks to make sure the player has enough gold. If enough gold, all pets set to max hunger. If not, do nothing for player's pets.

Final script then just simply maxes out the hunger to 10/10 for all players with enough gold.


All of this takes place just in one file though and runs at the same time. The PHP script doesn't care if a database query is finished or not. It just sends the info to the database and moves onto the next step. Since Script 1 and Script 3 are running to the same table, the database will run them sequentially even if Script 3 is pushed before Script 1 finishes. However, Script 2 is separate and would just be a select query, so it can get that info ASAP and do the gold calcs.


So... I think that is what is happening. If that helps to make it any more sensical lol.
Edited By Krinadon on 5/5/2019 at 5:19 PM.
Varyntha
Level 72
Maze Runner
Joined: 9/3/2014
Threads: 22
Posts: 1,571
Posted: 5/5/2019 at 8:27 PM Post #22
Oh, I understood that part -except that the scripts can skip checks to cut time corners; that sounds like fancy coding ^0^ - for the most part (though your detailed explanation is very informative on the inner workings of the code mind ^0^ ). I was wondering if the manual Stable activity I was doing, which seemed to have hunger happen the next day each time, might actually be having any effect on the hunger script, but I just finished some more studying of my Stable Log and it looks like that theory might not work out because there was no manual activity on my part (or in the Log) between the incident of 4/25 and the successful Stablehand feeding of 4/26. xD Maybe it was just coincidence the other times? <_< xD
Krinadon
Level 75
Shadow of the Moon
Site Administrator
Joined: 12/17/2012
Threads: 1,119
Posts: 14,687
Posted: 5/5/2019 at 11:24 PM Post #23
So you can verify if a database query was successful or not and then take action based on whether it was or wasn't.

So "cut corners" just means I am skipping that step.

And the reason I cut corners is b/c the script goes through thousands and thousands of pets and - as we're all realizing here - time is important. So corners are cut to save time to keep the script from taking an eternity to run.

Fortunately, this is a relatively minor issue. For important issues, I utilize such checks to make sure everything reacts appropriately. For example... if you are buying something from the Diamond Shop, the script 100% confirms that the Diamonds were removed from the account before creating the items to the player. Additionally, it checks to make sure the items were properly created to make sure the player received what they bought. However, these checks all take extra code and extra time. But in the grand scheme of the process of buying some items from the Shop from one player at a specific moment in time - the added calculations are mere tiny fractions of a second. So the benefit of the checks far outweighs the cost in time.

Another example would be like... say trying to force the Dungeon reward page at will. Without checks, the script would just simply say, "Oh? Request for dungeon reward? Here you go!" However, there are many checks involved in such a thing:

-Are you logged in and do you exist?
-Are you actually in this dungeon atm?
-Are you at this step and legitimately ready to receive a reward?
-Have you already received this reward?
Etc.
Varyntha
Level 72
Maze Runner
Joined: 9/3/2014
Threads: 22
Posts: 1,571
Posted: 5/6/2019 at 9:35 PM Post #24
That's cool that you can make scripts cut corners. :o Sounds like a lot of concentration would be needed to write up that code... @_@ Nothing but respect, Krin. :D

(Today's update, in case we still want updates: No Stablehand, no Log entry, all Sylestis fed. I went ahead and purchased a Stable Tab today to see if my Sylestis end up getting hungry tomorrow, just for experiment testing completeness. xD )
Varyntha
Level 72
Maze Runner
Joined: 9/3/2014
Threads: 22
Posts: 1,571
Posted: 5/7/2019 at 5:24 PM Post #25
Today's update, just to confirm the results of my experiment, if nothing else xD : even after purchasing a Stable Tab yesterday, I still had no hand, no Log entry, and all Sylestis fed. This confirms (I think <_< ) that the two are unrelated and that the other times just had to be coincidences. xD
Varyntha
Level 72
Maze Runner
Joined: 9/3/2014
Threads: 22
Posts: 1,571
Posted: 5/9/2019 at 11:09 AM Post #26
I ended up getting busy and then distracted yesterday before I could post yesterday's update so here is both yesterday's and todays:

Yesterday (the 8th), No hand, no Log entry, and my Sylestis were hungry! :o So I created a Contract and fed the Sylestis.

Today (the 9th), under Contract, no Log entry, Sylestis not hungry.


There has to be a pattern here somewhere, right? <_< If the tendency is for the hunger script to not finish before the feeding scripts, why would it sometimes go through? D_D Or is that the main question... Perhaps server load caused by various sources can affect it? Could site traffic at the time affect it... <_< I have another experiment to try now that will probably have no affect because they are completely unrelated. xD Because I cannot let a mystery go unsolved... XD -Unless it's supposed to be a mystery. ^u^

--*Krin, you do not have to read all of my ramblings; they are mostly there just in case you want to read them in your spare time or if you need a break from other things. ^w^ *--
Krinadon
Level 75
Shadow of the Moon
Site Administrator
Joined: 12/17/2012
Threads: 1,119
Posts: 14,687
Posted: 5/9/2019 at 5:30 PM Post #27
I read every post in this Forum regardless. =P

And yep, best guess would be just variances in server traffic at midnight.
Varyntha
Level 72
Maze Runner
Joined: 9/3/2014
Threads: 22
Posts: 1,571
Posted: 5/10/2019 at 9:10 PM Post #28
Fair enough! ^D^
I may try watching the online numbers around midnights and see what I can learn... <w<

(And today's update: Contracted, no Log entry, no Sylestis hungry.)
Orcastration
Level 73
Fishy
Joined: 11/1/2018
Threads: 316
Posts: 33,413
Posted: 5/10/2019 at 10:34 PM Post #29
Varyntha
Level 72
Maze Runner
Joined: 9/3/2014
Threads: 22
Posts: 1,571
Posted: 5/12/2019 at 8:26 AM Post #30
Apparently I got distracted yesterday and did not check my Stable Log >_(\ so here are yesterday's and today's updates. :D

05/11 - my Stablehand fed my Sylestis and spent the normal amount, my Contract expired, and I created a new Contract (usually I wait until the next day).

05/12 - my Stablehand fed my Sylestis and spent the normal amount.

Surely not checking my Stable Log could not affect anything.... >w> But, all things can be considered when attempting to solve a mystery. ^w^ I also continue being too sleepy at midnight to check how many people are online at that time. xD


(Edit: I forgot to put the second "not" in that first sentence of the last paragraph.)
Edited By Varyntha on 5/12/2019 at 8:28 AM.
Go to Page:
1, 2, 3, 4, 5
This Page loaded in 0.011 seconds.
Terms of Service | Privacy Policy | Contact Us | Credits | Job Opportunities
© Copyright 2011-2024 Sylestia Games LLC.
All names and logos associated with Sylestia are Trademarks of Sylestia Games LLC.
All other trademarks are the property of their respective owners.
For questions, comments, or concerns please email at Support@Sylestia.com.