Can I somehow see the math behind a web game in the page source?
August 29, 2018 7:29 PM Subscribe
I play the shark game (previously). After you get 1000 octillion of something, it stops telling you how much you have and just says "lots." I've had "lots" in many columns for over two years now, but I would like to know how much that actually is. It's obviously keeping track. Can i see these numbers somehow by viewing page source or some tool that lets me see the code or...?
As a sort of pregnancy project (i.e. something to do that would take months and mark the time until my baby was finally born), I decided to get lots of everything. That happened pretty quickly so then I decided to make everything go up by lots per second.
My baby is 16 months old now, so I underestimated how long this would take, obviously. So the fish/crystals etc. all go up by lots per second, and I have lots of each animal (sharks, rays, etc.) but I'm working on first getting the animals to reproduce at lots per second and then having lots of each of the animal producers (e.g. nurse sharks). Right now the animals (sharks, rays etc.) reproduce in the low octillians per second and I have sextillions or septillions of the producers (e.g. nurse sharks dolphin biologists).
But it's frustrating as I'm moving "lots" of stuff through the recycler and using it to train dolphin biologists etc., to not know how much stuff I'm actually moving. Since the program knows if I can afford 5 sextillion nurse sharks or 23 quintillion ray makers or whatever, it obviously knows exactly how much stuff I have. Somewhere back there there's a number more precise than "lots."
Is there a way for me to access those numbers?
As a sort of pregnancy project (i.e. something to do that would take months and mark the time until my baby was finally born), I decided to get lots of everything. That happened pretty quickly so then I decided to make everything go up by lots per second.
My baby is 16 months old now, so I underestimated how long this would take, obviously. So the fish/crystals etc. all go up by lots per second, and I have lots of each animal (sharks, rays, etc.) but I'm working on first getting the animals to reproduce at lots per second and then having lots of each of the animal producers (e.g. nurse sharks). Right now the animals (sharks, rays etc.) reproduce in the low octillians per second and I have sextillions or septillions of the producers (e.g. nurse sharks dolphin biologists).
But it's frustrating as I'm moving "lots" of stuff through the recycler and using it to train dolphin biologists etc., to not know how much stuff I'm actually moving. Since the program knows if I can afford 5 sextillion nurse sharks or 23 quintillion ray makers or whatever, it obviously knows exactly how much stuff I have. Somewhere back there there's a number more precise than "lots."
Is there a way for me to access those numbers?
Best answer: Try this:
In your shark game, hit Ctrl + Shift + I to bring up the firefox developer tools. This will probably appear as a box at the bottom of your browser. I find this annoying, and you can get it in a (much larger) separate window by clicking the icon with the tooltip "Show in Separate Window" next to the X button. At any rate, click on "Console" at the top of this box. You'll probably see nothing, but at the bottom there's a box to type in. Put this:
posted by axiom at 8:09 PM on August 29, 2018 [3 favorites]
In your shark game, hit Ctrl + Shift + I to bring up the firefox developer tools. This will probably appear as a box at the bottom of your browser. I find this annoying, and you can get it in a (much larger) separate window by clicking the icon with the tooltip "Show in Separate Window" next to the X button. At any rate, click on "Console" at the top of this box. You'll probably see nothing, but at the bottom there's a box to type in. Put this:
console.log(SharkGame.PlayerResources);This will dump the JavaScript object that keeps track of all your stuff into the console log (the tab you're looking at). It will have a little arrow next to it indicating it can be expanded. Do so and you'll see a sub-listing for each type of thing (fish, numen, etc.). I think this is what you're asking for.
posted by axiom at 8:09 PM on August 29, 2018 [3 favorites]
Response by poster: Great! Thank you! But this tells me how many I have but now how many I'm adding per second. Is there a way to get that, too?
posted by If only I had a penguin... at 8:29 PM on August 29, 2018
posted by If only I had a penguin... at 8:29 PM on August 29, 2018
Response by poster: And any idea what amount vs. totalamount is? Sometimes they're the same number and sometimes different.
posted by If only I had a penguin... at 8:35 PM on August 29, 2018
posted by If only I had a penguin... at 8:35 PM on August 29, 2018
Best answer: It looks like
posted by demiurge at 8:42 PM on August 29, 2018
SharkGame.PlayerIncomeTable
has the production data. I think amount is your current amount while total amount is number produced - number used
. Not positive on that though.posted by demiurge at 8:42 PM on August 29, 2018
Best answer: You can also just do
I think
posted by axiom at 8:55 PM on August 29, 2018
console.log(SharkGame)
which will dump a snapshot of the entire state of the game. You can explore that but most of it is probably going to be unintelligible to you unless you speak JavaScript. Don't be afraid, though, it's a copy of the game state at the time you ran the command, you can't break anything.I think
totalAmount
tracks how many of an item you've ever produced (note I don't know anything about the game so maybe I'm mistaken). When I click "Catch fish" 10 times then buy my first shark for 5 fish, totalAmount
is still 10 while amount
becomes 5.posted by axiom at 8:55 PM on August 29, 2018
Response by poster: Thanks so much! After posting this I thought "surely a question about hacking a specific not-at-all-famous game is way to niche and now I've just wasted one of my questions. Mefites' expertise never fails to astound.
posted by If only I had a penguin... at 6:18 AM on August 30, 2018 [2 favorites]
posted by If only I had a penguin... at 6:18 AM on August 30, 2018 [2 favorites]
There should be some sort of warning when you post a link to a cookie clicker type game. I'm at work dammit, I don't need this temptation.
posted by GoblinHoney at 11:55 AM on August 30, 2018 [1 favorite]
posted by GoblinHoney at 11:55 AM on August 30, 2018 [1 favorite]
Response by poster: Goblin (or others), if you're just getting started, I recommend this article on essence farming which would have saved me a lot of build-up. In fact, I've been essence farming on my work computer for a couple of weeks and am now at double the climate level I have on my home laptop after running the game there since the FPP was first made.
posted by If only I had a penguin... at 12:33 PM on August 30, 2018
posted by If only I had a penguin... at 12:33 PM on August 30, 2018
« Older "Nikki Minaj Won't Get Out of My Head" or... | Is there a name for this software principle? Newer »
This thread is closed to new comments.
posted by If only I had a penguin... at 7:42 PM on August 29, 2018