Hey guys,
As some of you might remember, back at the beginning of December I released a small app to attempt to gather data to figure out the new algorithm used by the Abandoned Attic.
This post is going to explain how the data was collected, and the conclusions that @WaserLave and I came to after hours of analysis.
Aim
The aim of this was to determine if there was a reliable way to predict the restock times of the Abandoned Attic, and to see if an algorithm could be designed to determine when this would be.
Preconceptions (Things We Already Knew)
- Previously the attic ran on a 7 minute restock timer. This means that if you caught a restock at 00 minutes past the hour, you could rely on the next restock being a multiple of 7 minutes away from that initial restock time.
- JellyNeo used to have a really helpful page with the previous restock time possibilities here, but it's been replaced by a "we're working on it" sign (hehe )
Data Collection Method
A small test application was deployed to a few user's computers, which was left running for various periods throughout the days this test was run.
This app refreshed at a preconfigured interval to check for a restock in the Attic and provided the following features:
- Configured intervals for standard restock checking and post-restock ban restock checking
- Proxy configuration
- Restock ban detection
A successful restock was indicated by there being more items in stock than the previous attic refresh.
If a restock was detected, this was pushed out to a log file, which was then manually sent in to me and then all of this data was added manually to an Excel spreadsheet for analysis.
Overall, 806 restocks were detected from a total of 11 users over a 7-day period. There is no way to tell whether we caught every restock.
Analysis Of Collected Data & Theorems
After we collected data for 50 restocks we began to notice a very similar algorithm to the previous one - at least some noticable commonality between the previous '7 minute interval' and the data we were receiving.
A good example of this is in the sample below.
(NOTE: If you're following this in the spreadsheet, look at row 138 on the Offset Analysis sheet)
Here we're going to take a sample of 6 attic restocks, gathered on the afternoon of 03/12/2013:
21:43:58-21:44:18 Napiform 21:44:05-21:44:25 Futurama 22:05:05-22:05:25 Napiform 22:05:06-22:05:26 Futurama 22:26:06-22:26:26 Futurama 22:26:16-22:26:36 Napiform 22:40:20-22:40:40 Napiform 23:15:31-23:15:51 Napiform 23:22:33-23:22:53 Napiform
The pure restock times have been pulled out to the below (with the time between restocks also noted):
Date Restock Time Time since last restock 03/12/2013 21:44:05-21:44:18 n/a 03/12/2013 22:05:05-22:05:25 ~21 minutes 03/12/2013 22:26:16-22:26:26 ~21 minutes 03/12/2013 22:40:20-22:40:40 ~14 minutes 03/12/2013 23:15:31-23:15:51 ~35 minutes 03/12/2013 23:22:33-23:22:53 ~7 minutes
We saw this as very significant and decided to watch to see if this pattern continued - as we had also seen the same pattern emerge with some earlier values.
To see if we can actually predict the times, we can extrapolate multiples of 7 minutes (ignoring seconds values) from the initial restock we see in this sample (@ 21:44):
Restock Time Restock seen 21:44:00 [X] 21:51:00 [ ] 21:58:00 [ ] 22:05:00 [X] 22:12:00 [ ] 22:19:00 [ ] 22:26:00 [X] 22:33:00 [ ] 22:40:00 [X] 22:47:00 [ ] 22:54:00 [ ] 23:01:00 [ ] 23:08:00 [ ] 23:15:00 [X] 23:22:00 [X] ...
If restock times were indeed on a 7 minute interval as was the case before, we'd start to see the restocks through the day match up with our list of extrapolated times.
Unfortunately (for us, as if this was the case, it would make our lives exponentially easier), this was not the case.
The next reliable restock time we saw was at 01:15:xx AM on 04/12/2013.
If we try to match that with our extrapolated times, we see the following:
Restock Time Restock hit ... 23:22:00 [X] 23:29:00 [ ] 23:36:00 [ ] 23:43:00 [ ] 23:50:00 [ ] 23:57:00 [ ] 00:04:00 [ ] 00:11:00 [ ] 00:18:00 [ ] 00:25:00 [ ] 00:32:00 [ ] 00:39:00 [ ] 00:46:00 [ ] 00:53:00 [ ] 01:00:00 [ ] 01:07:00 [ ] ------------------------------ 01:14:00 [ ] ------------------------------ 01:21:00 [ ] ...
The closest value we have is the 01:14:00 restock time.
This means that our 7-minute extrapolation rule was broken, as it had now restocked at 01:15:00 AM, 1 minute after we had expected it to restock.
The next restocks were as follows:
Restock Time Expected Time Time since previous 01:22:12-01:22:26 01:21:00 n/a 01:57:28-01:57:48 01:56:00 ~35 minutes 02:25:49-02:26:09 02:24:00 ~28 minutes 02:32:50-02:33:10 02:31:00 ~7 minutes 02:46:50-02:47:10 02:45:00 ~14 minutes 03:14:51-03:15:11 03:13:00 ~28 minutes
We can see that the time between potential restocks still appears to be 7 minutes, but there seems to have been an "offset" of +1 minutes added onto our expected value.
This pattern repeats itself, and after a certain period of time another minute is added to the offset. This cycles all the way through from 0-6, with an average cycle taking around 18 hours.
RECAP
So, here's what we know
- Restock times are still based on some sort of a 7-minute timer.
- There are various 'windows' throughout the day indicating what times the attic *may* restock
- These 'windows' do not seem to repeat on a known week-by-week basis.
- An entire cycle from offset 0 to offset 6 appears to take ~18 hours.
- Before we attempt to tackle the idea of seconds past the minute, we should first get the minute correct.
Algorithm (untested, not guaranteed reliability)
Based on all of this, I've been able to come up with the following algorithm that should, in theory, work for all intents and purposes.
Consider the following pseudo-code:
> Find a restock time by refreshing at a specific interval until we see more items in stock (e.g. 30 seconds) > Wait until restock time + ~7 minutes, then check for restock >> If restocked then check items and buy if necessary, restart algorithm from this time >> If not restocked then check again in ~1 minutes time to see if a restock happens (offset may have incremented) >>> If a restock is found, check items and buy if necessary, restart algorithm from this time >>> If not restocked, continue + check again in ~6 minutes time from the last restock time
This should mean that most, if not all, restocks are detected, however, we'd be doing this pretty inefficiently.
Improvements
- If we scaled up to collect more data per restock then we could better tell at what seconds past the minute the attic is going to restock, and analyse any patterns to do with this.
- If this experiment was to be run again I'd definitely write some kind of log parser to get around the manual entry of each restock time brackets into the excel spreadsheet, as this was a real ballache.
We need you!
If you found all of this interesting and would like to help contribute, please PM me and I can get you a copy of the raw spreadsheet and we can continue to work together to figure out the new Attic algorithm.
Key Contributors
@Dan
@WaserLave
Volunteer Data Curators
@Napiform
@Scot
@Kat
@Nymh
@Nimby
@Adam
Feel free to discuss in this thread.
OK Dan, but how do we fix Ambrosia?
In order to actually achieve the aim we set out to get, we'd need a couple of things:
- More Data, and in turn,
- More Users
We essentially would need a guaranteed method to figure out the exact restock times so that we could have a completely reliable dataset to analyse.
How do we get that?
We essentially have two options:
- Brute force
We could essentially get every restock time by brute force - we could have clients refresh the attic at every second in a day. If we had enough users, we could definitely do this
- Smart
We could attempt to use the algorithm already developed and run multiple clients to attempt to grab the exact, correct restock times. This should, in theory, provide us with the same resultset but with a lower hitcount on neopets. We could utilise some kind of burst of clients for when we think a refresh minute might be.
Why did you do all of this?
Because I found it fun, and you should too. If you're interested in being part of the war effort, even if you can't math or program, just PM me and I'm sure I can fit you in somewhere..