News for hackers. Stuff that matters.
Re:Spaceplan by christiangenco on Saturday August 13, 2016 @05:06AM (#12280836)
I love it! Found myself doing mental calculations for the most effective thing to buy next, and the next thing I knew I'd written a script to automatically buy it:

    var clickBestThing = function(){
       var things = [...document.querySelectorAll("#manufacture__container > div")].map(function(e){
        var res = {e};
        [...e.getElementsByTagName("span")].map(function(s){
          res[s.id] = +s.innerText.replace(/[^0-9]/g, '')
        })
        if(e.id === "item__spudGun" || e.id === "item__potatoLauncher") res.powerGain *= 1000;
        res.score = res.cost / res.powerGain;
        // res.score = res.cost / res.spudGain;
        res.name = e.getElementsByClassName("manufacture__name")[0].innerText;
        return res
      }).sort(function(a,b){return a.score - b.score})

      window.things = things;

      var bestThing = things[0];
      if(!things[things.length-1].score) bestThing = things[things.length-1]
      console.info("clicking " + bestThing.name)
      things[0].e.click();
    }
    var timer = setInterval(clickBestThing, 5000)
Of course it's much easier to `power = 999...`, but this feels more like automation and less like cheating.
Re:Spaceplan by TusanHomichi on Saturday August 13, 2016 @10:08AM (#12281558)
You can actually improve this a little with a better scoring function. Suppose we currently produce p, and A costs cA, for a power gain of pA. Likewise for B. Under the assumption that we will buy at least one more of A and B, we can look at whether A then B or B then A is faster, which is:

cA/p + cB/(p+pA) < cB/p + cA/(p+pA)

Solving this, we get cA * (p+pA)/pA < cB * (p+pB)/pB Since the left side is all in A, if we pick the item minimizing that quantity, it is faster to buy it before any other item. So changing res.score to be res.cost * (cur_power + res.powerGain)/res.powerGain is going to be a bit faster

Re:Spaceplan by christiangenco on Sunday August 14, 2016 @01:53AM (#12284429)
Ahh of course! I had the thought to take this into account but couldn't wrap my head around the math last night.

cA/p is just the time it would take to earn the money to buy A at the current production level - seems much simpler now.

I think the last term should be `cA/(p+pB)`. When I solve from there[1] I get `cB * pB < cA * pA`, which means that the most optimal item A will have the largest product `cA * pA`.

This would translate to:

    res.score = res.cost*res.powerGain
    ...
    }).sort(function(a,b){return b.score - a.score})   
Does that check out? It seems too simple, and now that I'm thinking more about it I think this would be functionally equal to what I already have. Did I do my inequality[1] wrong?

1. http://i.imgur.com/pyMY3zr.jpg

Re:Spaceplan by thexa4 on Saturday August 13, 2016 @11:00AM (#12281725)
Slight modification so it doesn't automatically buys the item but just highlights the best one

https://gist.github.com/thexa4/2da63028a1d8007dedbd0ba9432c8...

Re:Spaceplan by smaddox on Saturday August 13, 2016 @05:54PM (#12283258)
Re:Spaceplan by niix on Saturday August 13, 2016 @08:52AM (#12281269)
Nice! After clicking the button a few times my first inclination was also to open the console and see how I could make my life easier.
Re:Spaceplan by drewamox on Saturday August 13, 2016 @07:13AM (#12281055)
Typical Noob idiot coming through, first of all i've got to praise you for doing that the amount of effort that took must be high, but being the typical noob idiot I am I have to also wonder how I actually use this? reply
Re:Spaceplan by christiangenco on Sunday August 14, 2016 @01:17AM (#12284359)
No need to be self deprecating - this isn't 4chan :)

Copy and paste the code in your browser's javascript console. In Chrome it's under View/Developer/JavaScript Console.

For a good intro on how this works: https://www.khanacademy.org/computing/computer-programming/h...

Re:Spaceplan by new299 on Saturday August 13, 2016 @05:50AM (#12280909)
I might just be tired and dense. But does watts per second make sense here? Shouldn't the accumulated power be in joules (or Watt hours?) and the per second value just be watts?
Re:Spaceplan by rzzzt on Saturday August 13, 2016 @06:20AM (#12280976)
In our universe, energy would be accumulated (measured in joules or watt-seconds), and each upgrade bought would produce more power (measured in watts or joules per second). But the game might be taking place in an alternate timeline where James Joule and James Watt were switched at birth (also born at the same time).
Re:Spaceplan by TaylorAlexander on Saturday August 13, 2016 @06:01PM (#12283286)
This is the best explanation.
Re:Spaceplan by david-given on Saturday August 13, 2016 @06:45AM (#12281008)
Yes. Yes it should.

...I'd complain but I'm too busy micromanaging space potatoes.

Re:Spaceplan by arnorhs on Saturday August 13, 2016 @04:22PM (#12282943)
A really well executed Incremental game[1] and the best part about it is that it has an ending. Even a retro end-game sequence. Well done. I really enjoyed it.

[1] https://en.wikipedia.org/wiki/Incremental_game

Re:Spaceplan by kristianp on Sunday August 14, 2016 @08:10PM (#12287909)
See Cookie Clicker for the original (or early) quirky game: http://orteil.dashnet.org/cookieclicker/
Re:Spaceplan by hijp on Saturday August 13, 2016 @07:26AM (#12281073)
Nicely done! I just finished with no cheats and thoroughly enjoyed myself.

The level of polish is what kept me clicking 285 times just to 'start' the game. Very cool.

Re:Spaceplan by leovander on Saturday August 13, 2016 @11:47AM (#12281872)
And here's the Stranger Things Soundtrack[1] to play in the background.

[1] https://youtu.be/5sy2qLtrQQQ

Re:Spaceplan by josscrowcroft on Saturday August 13, 2016 @08:27AM (#12281201)
There goes my Saturday morning! Time to go stick my wrists in a bucket of ice.

Kudos to the developers. Really lovely game, intuitive and entertaining, well-built.

Re:Spaceplan by taneq on Saturday August 13, 2016 @10:33AM (#12281640)
Why is everyone clicking so much? Once you get your first few 'taters the extra gain from clicking is so small as to be pointless.
Re:Spaceplan by tgibson on Saturday August 13, 2016 @12:20PM (#12281990)
Once I figured there would be lots of clicking, I went into the console and typed the following to automate the Kinetigen:

var ki = setInterval(function() { kinetigenClick(); kinetigenRelease(); }, 10);

Then later on at a certain point in the game, I had to stop it:

clearInterval(ki);

Re:Spaceplan by mrblackbull on Monday August 15, 2016 @06:55AM (#12289602)
Tried pasting your code into the console, but i'm getting the following error:

(program):1 Uncaught ReferenceError: kinetigenClick is not defined

What am I doing wrong?

Re:Spaceplan by DblPlusUngood on Saturday August 13, 2016 @02:23AM (#12280511)
Never before have I been so eager to shoot potatoes into the sun.
Re:Spaceplan by ORioN63 on Saturday August 13, 2016 @01:57AM (#12280461)
Why do you keep doing this? :(

You put a clicker in front of me and baam. Lost a hour.

Re:Spaceplan by monk_e_boy on Saturday August 13, 2016 @07:26AM (#12281072)
Loading 'Cookie' library -- haha, nice. Lost a lot of time to cookie clicker
Re:Spaceplan by erdevs on Friday August 12, 2016 @11:00PM (#12280039)
I think I like it more than No Man's Sky. But I'm suing you for carpel tunnel.

Good stuff, thanks for sharing!

Re:Spaceplan by karshan on Friday August 12, 2016 @11:09PM (#12280064)
If you wanna avoid carpel tunnel, window.setInterval(kinetigenClick, 1) :P
Re:Spaceplan by erdevs on Friday August 12, 2016 @11:17PM (#12280082)
I always feel cheat codes don't let me experience the game as its designer intended. But... always tempting. :)
Re:Spaceplan by falcolas on Saturday August 13, 2016 @10:55AM (#12281718)
Given how little obfuscation surrounds the click button, what if scripting it was what the developer intended?
Re:Spaceplan by jhollands on Monday August 15, 2016 @05:34AM (#12289420)
I have no idea how to prevent people from 'hacking' my game, but I don't think I'd try to stop them — it's so fun to see what people are coming up with. I'm learning from it!
Re:Spaceplan by verelo on Friday August 12, 2016 @11:33PM (#12280118)
or even less annoying:

var x = 0; while(x < 10000) { x++; kinetigenClick(); kinetigenRelease(); }

Re:Spaceplan by oscilloscope on Friday August 12, 2016 @11:55PM (#12280190)
Had to save+reset after bumping this up to 100000, but it only took a few seconds and now I have 6 million watts. Dropping my first Tater Tower. Beautiful, elegant cheat.
Re:Spaceplan by verelo on Saturday August 13, 2016 @01:21PM (#12282215)
"Beautiful, elegant cheat."

That is the nicest thing anyone has ever called me.

Re:Spaceplan by latch on Saturday August 13, 2016 @01:36AM (#12280415)
power += 100000000000
Re:Spaceplan by pmontra on Saturday August 13, 2016 @02:15AM (#12280491)
Or open with a tablet, I couldn't do anything.
Re:Spaceplan by wanda on Saturday August 13, 2016 @09:11AM (#12281326)
Reminds me of Larry Niven's Ringworld, or more specifically the Puppeteers and their planet-ships fleeing the galaxy.
Re:Spaceplan by twic on Saturday August 13, 2016 @08:36PM (#12283770)
For me, it was Liu Cixin's 'The Wandering Earth', with a heavy dose of Stephen Baxter hard-SF (ish) cosmic madness. And potatoes.
Re:Spaceplan by threepipeproblm on Saturday August 13, 2016 @05:02PM (#12283088)
I learned so much about myself. Time to cook some potatoes.
Re:Spaceplan by stepik777 on Saturday August 13, 2016 @04:44AM (#12280785)
Why do we accumulate watts? That's stupid.
Re:Spaceplan by rurban on Saturday August 13, 2016 @05:36AM (#12280884)
Check Tipler. We won't need them now, we would be even much better off to save more, but we would need them to save the world on the galactic scale.
Re:Spaceplan by terminado on Sunday August 14, 2016 @05:01PM (#12287312)
C'mon man, what's it take to post a link?

https://en.wikipedia.org/wiki/Frank_J._Tipler

Re:Spaceplan by rurban on Saturday August 13, 2016 @04:29AM (#12280754)
Love potatoes. And saved the world in 2 hours. (without cheating)
Re:Spaceplan by transfire on Saturday August 13, 2016 @01:39PM (#12282286)
Hmm... I seriously doubt that's possible. How?
Re:Spaceplan by wodenokoto on Saturday August 13, 2016 @08:41AM (#12281231)
Looks like Cookie clicker [1]

[1] http://orteil.dashnet.org/cookieclicker/

Re:Spaceplan by runevault on Saturday August 13, 2016 @08:59AM (#12281290)
It's basically cookie clicker with an actual plot and an ending.
Re:Spaceplan by mablap on Saturday August 13, 2016 @12:27AM (#12280270)
Here are some useful shortcuts:

power = n; (where n is whatever you need)

sol.mass = 3e7;

Cool game!

Re:Spaceplan by erdevs on Saturday August 13, 2016 @03:52AM (#12280678)
Okay, now that more people have played, what is everyone's fastest time getting to the end (without cheats)?

Fun game concept!

Re:Spaceplan by taneq on Monday August 15, 2016 @02:22AM (#12288995)
Took me about four hours, toward the end I was playing it more like a Tamagotchi (click the buttons every now and then and then leave it to rack up more power).

Also [[SPOILERS]] the ending sequence wedged after 'go be a hero', luckily when I refreshed the page it put me back to just before the black hole bit. Maybe it broke because I was on the solar system view and not the planet view or something? It worked the second time anyway.

Re:Spaceplan by rcarmo on Saturday August 13, 2016 @06:42AM (#12281004)
This is bloody amazing. Best way to spend a quiet Saturday morning :)
Re:Spaceplan by evantahler on Tuesday August 16, 2016 @08:44PM (#12301727)
Just came back to this... they've done a very good job of blocking "click" automation!
Re:Spaceplan by rotomatt on Saturday August 13, 2016 @12:39AM (#12280304)
хороший один товарищ
Re:Spaceplan by DblPlusUngood on Saturday August 13, 2016 @02:17AM (#12280497)
Obviously a direct translation from English to Russian -- I doubt a Russian would ever actually say this.

They should change it to: молодец.

Re:Spaceplan by terminado on Sunday August 14, 2016 @04:12PM (#12287134)
Неплохо, товарищ
Re:Spaceplan by makkesk8 on Saturday August 13, 2016 @08:44AM (#12281248)
Pomme de terra
Re:Spaceplan by omginternets on Saturday August 13, 2016 @11:18AM (#12281778)
Is this a Latvian game studio?
Re:Spaceplan by omginternets on Saturday August 13, 2016 @07:31AM (#12281085)
How do I obtain the planet boosters?

Also, thanks for ruining my dissertation...

Re:Spaceplan by lionyo on Saturday August 13, 2016 @09:45AM (#12281473)
Click "System Peeker" in the top middle of the screen, under "Planet Looker"
Re:Spaceplan by c3RlcGhlbnI_ on Saturday August 13, 2016 @02:41AM (#12280536)
Cool, but does a clicker game really need to use 4 cores?
Re:Spaceplan by arawde on Friday August 12, 2016 @11:27PM (#12280105)
Beautifully done :)
Re:Spaceplan by transfire on Saturday August 13, 2016 @01:38PM (#12282279)
POMME DE TERRE
Re:Spaceplan by buremba on Saturday August 13, 2016 @06:16AM (#12280967)
nice ending scene with pomme de terre.
Re:Spaceplan by itsjoesullivan on Saturday August 13, 2016 @09:27AM (#12281392)
Very fun! Only cheated a little.
Re:Spaceplan by nyxtom on Saturday August 13, 2016 @12:39AM (#12280305)
Great game! Thanks for sharing :D
Re:Spaceplan by oxplot on Saturday August 13, 2016 @02:51AM (#12280553)
so I did `for i in {1..10000}; do xdotool click 1; done` and ... the game crashed :(
Re:Spaceplan by christiangenco on Saturday August 13, 2016 @05:07AM (#12280842)
Do `setInterval(kinetigenClick, 1)` instead.
Re:Spaceplan by djhworld on Saturday August 13, 2016 @05:06AM (#12280838)
Frighteningly addictive.
Re:Spaceplan by gozur88 on Saturday August 13, 2016 @03:27AM (#12280628)
Surprisingly addictive.
Re:Spaceplan by tdburn on Saturday August 13, 2016 @12:50PM (#12282079)
Loved it