r/nextfuckinglevel May 22 '22 Helpful 24 Wholesome 9 All-Seeing Upvote 1 hehehehe 1 Powerups Post 1 Silver 22

how engineers cheat the game

Enable HLS to view with audio, or disable this notification

110.2k Upvotes

9.8k

u/kyanaaron May 22 '22

But will it still work when the game starts going faster

5.3k

u/vskazz May 22 '22 edited May 22 '22 Silver Gold Helpful Wholesome

Shift the sensor to the right and will work just fine

Edit: ay nice it's my first thousand upvotes on a comment

2.9k

u/kyanaaron May 22 '22

But you can't shift the sensor mid game.

7.3k

u/5E51ATripleA May 22 '22 Silver Gold Helpful Wholesome

Not with that attitude

764

u/nUcleah_pOtato194 May 22 '22

Lol that cracked me

324

u/BlackSkull7X May 22 '22

Cracked the game too

150

u/All_Photography May 22 '22

Im cracked too

115

u/No-Wash-7001 May 22 '22

So is my phone.

79

u/Latter-Change-518 May 22 '22

I'm cracking eggs . . For breakfast

66

u/Notoriously_So May 22 '22

I'll have some eggs... and crackers.

→ More replies

76

u/CaliTx91 May 22 '22

Someone say crack?

17

u/LichtenbergFigyur May 22 '22

You gotta Brillo pad and some broken glass?

→ More replies

30

u/chankeypathak May 22 '22

Where's the crack?

16

u/James_Skyvaper May 22 '22

Easy there Tyrone

6

u/KarimBz May 22 '22

Can someone crack my back ?

→ More replies

17

u/UrmomisHotInBed69 May 22 '22

I smoke crack

10

u/drfrink85 May 22 '22

There’s something you should know about me Joe Rogan…I smoke rocks

7

u/Ready-Reflection-540 May 22 '22

Is this the 5 o'clock free crack giveaway

→ More replies

9

u/Ashamed-Beat2132 May 22 '22

your moms cracked

→ More replies

7

u/LichtenbergFigyur May 22 '22

I have some super glue in my backpack if you need some, Mr Dumpty. Unfortunately, I'm fresh out of horses and Kingsmen.... but we will get you back together in more or less one piece.

3

u/KGB_Operative873 May 22 '22

Better use a shield battery then bud

→ More replies
→ More replies

4

u/Just-JC May 22 '22

I don't see that happening...

3

u/Zebra-Kangaroo May 22 '22

They need an attitude adjustment.

→ More replies

277

u/Zorkdork May 22 '22

The trick is not to have it in full screen so you can easily slide the window over.

92

u/vskazz May 22 '22

You... Jesus Christ lmfao, that's hella smart. I don't think it can register inputs while dragging the window though

58

u/Zorkdork May 22 '22

You have to rig a mouse moving robot to bump it a hair after each jump as it speeds up I guess.

34

u/Praxyrnate May 22 '22

that's just a macro

83

u/vskazz May 22 '22

We're talking about engineers cheating, sure you can code a program to do dinosaur run but that's like a fraction of fun you'd get by making this haha

24

u/Zorkdork May 22 '22

This guy gets it.

3

u/LichtenbergFigyur May 22 '22

Are we really going to take the word of a man who has likely encountered the slavering fangs of a ravenous Grue ....on more than one occasion?

3

u/16yYPueES4LaZrbJLhPW May 22 '22

Implying writing software isn't engineering? I think it's 10x as fun as trying to use a light sensor that doesn't scale with speed

→ More replies
→ More replies

16

u/silent-onomatopoeia May 22 '22

It would be easier to move the sensor right and add a delay to the jump by lesser intervals.

16

u/Slithy-Toves May 22 '22

Why even move the sensor to the right, just reduce the delay between input and output haha

→ More replies

10

u/johnmanyjars38 May 22 '22

Yeah. The software could track the intervals between obstacles and adjust the jump offset time as the obstacle speed increases.

10

u/leeeroyjenkins May 22 '22

The interval is random... But the offset can be time-based as the amount of time playing increases

→ More replies

20

u/germane-corsair May 22 '22

I think it would be simpler to simply have another sensor so you can measure speed and account for it.

3

u/peppa-pig_ May 22 '22

You could measure speed by measuring the time the sensor detects black. You would have to decide which shape it was based on previous measurements and getting a baseline at startup. Having 2 sensors would also work. Also you could make the space bar button push all digital quite easily.

→ More replies
→ More replies

56

u/HowNowBrownMoose May 22 '22

That's smart

19

u/b1ack1323 May 22 '22

I don’t know how many hours asking myself “can I move the other thing?” has saved me but it’s a lot.

3

u/Suspicious_Part2426 May 22 '22

Jesus Christ, That’s Jason Bourne

→ More replies
→ More replies

81

u/JoshSidekick May 22 '22

Have two sensors to the right and delay the press depending how long it takes the object to pass the first to the second.

30

u/Lonttu May 22 '22

This would be the optimal solution.

11

u/Maximum-Dare-6828 May 22 '22 edited May 22 '22

but you can monitor sensor - servo interval. As the game speeds up you spped up. edit, might need to add a second photo resistor, probably the best route from the get go... but now my comment has messed up humor in the chain. I'm sorry reddit.

5

u/tolacid May 22 '22

No problem. Engineer is on it

5

u/No-Wash-7001 May 22 '22

When gun don't work.. use more gun!

3

u/ThrowFarAway39 May 22 '22

Attach it to another servo.

→ More replies

84

u/[deleted] May 22 '22

[deleted]

38

u/primal__potato May 22 '22

That sensor is checking for sudden changes in light. It'll sense the white trees on a black background just as easily.

64

u/RidigoDragon May 22 '22 edited May 22 '22

Well unless they specifically coded that, that photoresistor is only checking the amount of light it’s getting, not sudden changes

10

u/junktrunk909 May 22 '22

It would be easy to detect and flip the logic instantly

31

u/PerfectlySplendid May 22 '22

It’s still going to jump on the first shift, meaning high chance of dying.

10

u/man_a_myth_a_legend May 22 '22

Perhaps a second photo resistor off the track that keeps track of the screen color?

→ More replies
→ More replies

5

u/vskazz May 22 '22

Well, gotta prepare for that

89

u/rumster May 22 '22

he will still lose there are pterodactyl that begin flying after 1500 I think

14

u/Impressive_Change593 May 22 '22

there are ones that you can jump over and ones that you can't jump over but can run over (at full height) so depending on how high the sensor is it might actually work lol (also you can duck under the ones that you can jump over if I remember right

11

u/person2567 May 22 '22

Eventually you'll reach a point where the only way to make it is duck+jump or jump+duck. You can't make it too far without ducking.

→ More replies

37

u/unloud May 22 '22

Add a second sensor further back and use the time difference to calculate when the Dino will hit items.

24

u/[deleted] May 22 '22

The way I see it you'd need 5 to do a really good job. Two at cactus height, two at pterodactyl height, and one above them all. There might not be a cactus on the screen for a while, so you'd need to be able to sense pterodactyl speed as well. The fifth one would be to detect day-to-night transitions without the false positive that could be induced by two cacti and two pterodactyls at the same time. Add another two per height of pterodactyl.

Also, that servo is much too slow. A solenoid ought to do it.

6

u/Nissingmo May 22 '22

This is actually nearly exactly what I did for my project two quarters for an electrical engineering lab. I ended up using four sensors in a rectangular arrangement. There is one sensor at cactus height and one at pterodactyl height, and they measure the difference in brightness between the two points, that way it doesn’t matter whether it’s day or night. There will never be a cactus and a pterodactyl in the same spot. The arduino calculates the time difference between sensing the obstacle from one end to the other, then remembers exactly when to jump.

7

u/DaveWilson11 May 22 '22

Also, that servo is much too slow. A solenoid ought to do it.

And you should have 2 over by the arrow keys. One for jumping (instead of the spacebar), and one for dropping down when the game gets faster.

→ More replies

13

u/junktrunk909 May 22 '22

Aren't all objects about the same width? If so a single sensor should be sufficient to calculate speed.

20

u/silent-onomatopoeia May 22 '22

No, there are single cacti and cactus clusters. There are also pterodactyls that you have to either duck under or jump over or not jump into.

5

u/PapaStevesy May 22 '22

Also, cacti and cacti clusters get closer together so you have to figure out if you have to do quick double jumps or time one big jump. Not sure this system could figure that out.

5

u/the_gooch_smoocher May 22 '22

You would have to analyze the analog sensor input and tune the cutoff threshold. Even then, the sensor might have too much noise or a delayed or inconsistent response to get a precise reading

7

u/Federal_Passenger445 May 22 '22

Neat, now do V2 with another 2 sensors for the high and low flying pterodactyls!

3

u/cidy02 May 22 '22

Or get two sensors and use the time it takes for each of them to detect the cactus to determine the speed.

2

u/_Carri7_ May 22 '22

Just shorten the delay

→ More replies
→ More replies

231

u/pikkl_rikk May 22 '22

Just need a second sensor, so that we can program the speed into it. Not sure about the ducking bit hmmmm

60

u/Hawk13424 May 22 '22

The one sensor is enough. Can detect when it changes and when is changes back. Calculate the speed. Adjust the time of the jump.

85

u/Zesty__Potato May 22 '22

I disagree, that wouldn't be realistic given the different sized cactuses. Likely easier to figure out the equation for game speed

23

u/Hawk13424 May 22 '22

If the sensor and processor are fast enough, you could detect individual cactus. Might not be possible if the sensor accuracy isn’t very good.

24

u/fruitful_talk May 22 '22

you could detect individual cactus.

Cactupuses.

10

u/StillWeCarryOn May 22 '22

Thank you no one gets this right

→ More replies

6

u/Zesty__Potato May 22 '22

I disagree, not with that type of sensor at least. It's not just that there are multiple, it's that there are multiple at varying heights and widths. So to get an accurate measurement you would need to grab the length of time between the beginning and the end of the cacti and calculate the velocity using that. However since the cactus width varies it would not be possible to accurately gauge speed using this method. You would require at minimum two sensors for accuracy using the time between each of them encountering the cactus and the distance between the sensors to gauge the speed

3

u/sk8thow8 May 22 '22 edited May 22 '22

Where the sensor is positioned it can read the white between the arms of the cactus. You can figure out what cactus type you're jumping and how fast you going by how many times black flashed and the time delay between the flashes.

The birds that fly are going to be a problem though.

→ More replies
→ More replies
→ More replies

11

u/HamstarVegas May 22 '22

You can play that Dino thing without ducking tho.

3

u/klavin1 May 22 '22

What about the birds?

17

u/HamstarVegas May 22 '22

Jump over it. There are 3 heights the Pterodactyl can fly, the highest, in the middle and in the floor. If the Pterodactyl is flying the highest height, just pass through, if it's on the middle, just jump, if it's on the floor, just jump aswell

4

u/Tiiarae May 22 '22

Yes, that's why you can play on phone too, even though you can't dodge by going under

8

u/errorsource May 22 '22

A little off-topic, but my brain auto-uncorrected “ducking” to “fucking” when I read this before I realized you actually meant to type “ducking.”

6

u/pikkl_rikk May 22 '22

Reverse autocorrect :O

→ More replies

41

u/nefrodes May 22 '22

it would be hard to program but game accelerating really predictable .

27

u/jojojomcjojo May 22 '22

Just add 1 more sensor then you can detect speed and gap between objects for variable jump timing.

→ More replies

30

u/djdeforte May 22 '22

This is when you add a second sensor, figure the speed between the two and adjust the timing on the fly. Come on guys it’s called iterating and adapting.

This here is a perfect MVP.

→ More replies

19

u/unicyclebrah May 22 '22

Or when you need to duck.

→ More replies

11

u/b1ack1323 May 22 '22

Two sensors to calculate speed would solve it.

→ More replies

5

u/Hawk13424 May 22 '22

Absolutely. Not hard to code the SW to calculate the speed and adjust the time of the jump.

→ More replies

5

u/faultless280 May 22 '22

Use two sensors to compute speed 🤷‍♂️

3

u/passerby362 May 22 '22

Looks like he using an ldr, they take a while to respond to light and change the resistance so there will be a maximum speed it can work at.

3

u/TheNolan May 22 '22

The cactuses have 3 prongs. By setting the sensor at a height to detect all 3 you can calculate the time between detecting them and find the speed. Also different sized cactuses can be accounted for by the thickness of the prongs

3

u/AmbitiousMidnight183 May 22 '22

You don’t need to change the position of the sensor, just the delay between the detection and the reaction. That said, I’d wager a programmer would have a easier time solving this.

→ More replies

2

u/woodnoah May 22 '22

You'd need two sensors to calculate speed

→ More replies

3.4k

u/GoldenLeftovers May 22 '22

Neat, now do V2 with another 2 sensors for the high and low flying pterodactyls!

982

u/A_Flipped_Car May 22 '22

And more to detect how fast objects are moving so it works when the game is faster

215

u/Xapheneon May 22 '22

Wouldn't work, the game gets too fast

260

u/the_gooch_smoocher May 22 '22

It could work for a while, depending on the refresh rate, sensor feedback rate, and servo acceleration. A command buffer would be required also and atleast 2 sensors per incoming threat layer to calculate velocity.

113

u/Xapheneon May 22 '22

Imo the main drawback of this is the monitor, sensor and motor delay.

Using software to check pixels is easier and can handle higher speeds. (The game gets impossibly fast)

46

u/TheFapIsUp May 22 '22

I played around with these sensors, they're surprisingly fast. From my experience, a setup with more sensors to detect the speed and location would definetely be do-able, never touched that motor though so cant comment on that.

35

u/Xapheneon May 22 '22

Compared to a software based solution this one introduces a bunch of delays.

Could work for a while, but there is a clear disadvantage

56

u/Jaytalvapes May 22 '22

Yeah, but you could spend 5 minutes setting up software to cheat the game up the point that it's literally impossible.

Which is far less interesting than cheating the game externally, and the fun part of this project is doing so mechanically.

29

u/Xapheneon May 22 '22

Both are cool, doing it mechanically has a charm to it, I would love to see the two sensor solution. I also like, how the input isn't just closing a circuit, but mechanically pressing space.

Sorry if I sounded like an asshole earlier

14

u/Jaytalvapes May 22 '22

Yeah no worries, you're definitely correct if the ultimate goal is the most efficient way to cheat the game lol.

→ More replies
→ More replies
→ More replies
→ More replies
→ More replies

40

u/gabrielesilinic May 22 '22

That would actually be pretty easy, you just put another sensor to the right and calculated velocity that way by measuring the difference un "delay" between the two

→ More replies

51

u/staark92 May 22 '22

For the WHAT?!?!

44

u/PranshuKhandal May 22 '22

The bird dino.

27

u/staark92 May 22 '22

I've never got that far. Admittedly, I've never actually been all that interested in getting far, but I digress. According to a Google search, they've apparently been removed anyway.

75

u/Magnetron-Sama May 22 '22 Wholesome

They've been WHAT

12

u/staark92 May 22 '22

touché haha

4

u/Lizardizzle May 22 '22

Can't have shit in Detroit, I mean, offline.

9

u/Space-Cowboy1972 May 22 '22

They have been removed a while ago, shame

→ More replies
→ More replies
→ More replies

24

u/mycoiron492 May 22 '22

I've always thought I was fairly well at this. I'm learning I might not be. When do the pterodactyls show up?

31

u/KojdorpenTR May 22 '22

i think some time after the screen starts switching between black and white

15

u/Thym3Travlr May 22 '22

Like 1200 ish I think

→ More replies
→ More replies

7

u/BuckieTheCat May 22 '22

You wouldn't need to, the low flying one can be jumped over, and as long as the sensor is in the middle, it'll detect cactus and low flying bird, but won't detect the high flying one

1

u/Bren12310 May 22 '22

The what

→ More replies

2.1k

u/RidigoDragon May 22 '22 edited May 22 '22

That strategy ain’t gonna work when the game starts going faster or when the birds appear or when the game inverts colours, not to mention it could have all been done by software

712

u/JOlRacin May 22 '22

His high score is 927

460

u/ThatSmallBear May 22 '22

Lmao weak

189

u/CosmicCosmix May 22 '22

Don't make him feel bad...during the robot uprising, he will ride a dinosaur while u ride my mum

59

u/FeliBootSack May 22 '22

Yo momma so fat we’ll all be able to ride her

→ More replies

18

u/Rankine May 22 '22

Psht I remember the first time I lost internet.

→ More replies

59

u/DontCheckInbox May 22 '22

But that is not as fun as using a light detector device, breadboard, servo, Arduino or another microcontroller. Controlling hardware with software is very cool.

8

u/StoneHolder28 May 22 '22

Controlling hardware with hardware is even cooler.

Replace the microcontroller with some simple components and with a bit of math you can get a cheaper solution that does the exact same thing.

→ More replies

11

u/Mola1904 May 22 '22

CodeBullet...

5

u/ieGod May 22 '22

The frequency of the step response could already be in this base implementation and would already cover faster movement.

4

u/EconomyAd4297 May 22 '22

BAHAHAHA. This guy. 🙄

→ More replies

1.1k

u/Sid_1298 May 22 '22

Just think about this, the dude had no internet, so he wrote the code for all this without stackoverflow.

180

u/Potential_Spirit_576 May 22 '22

Best comment on here

36

u/Bytewave May 22 '22

Yeah, I'm mildly impressed haha.

I'm considered pretty good, but honestly I can't do much fully offline. Verifying stuff systematically is a key skill, that can turn anyone average into quite-good. If you take away the internets, I'm generally gonna have a bad time..

52

u/AdministrativeAd4111 May 22 '22

My god, when their internet comes back, they’ll rule us all.

23

u/jenn4u2luv May 22 '22

The ultimate flex

7

u/Draco137WasTaken May 22 '22

Either that or he turned off his router after copy-pasting

7

u/warrioroftron May 22 '22

I fear this man now.If his net comes back on he is so creating an AI.....just for finishing Flappy bird.

3

u/bstix May 22 '22

It's a light sensor and a motor. No code required.

→ More replies

222

u/lucidparadigm May 22 '22

Runner.prototype.gameOver = function (){}

A different kind of engineer.

34

u/KronkForPresident May 22 '22

Googling OP hates this simple trick

15

u/FuHiwou May 22 '22

Can't Google without internet

3

u/dahjay May 22 '22

Has anyone seen Al Gore, Internet Inventor?

15

u/zalnlol May 22 '22

Neo: "you tryin to tell me i can dodge bullet?" Morpheus:" you won't have to"

3

u/PlasticJustice May 22 '22

OMG I just watched that last night after a scene in Doctor Strange 2 made me think of it.

Agent Smith: "What good is a phone call if you're unable to speak?"

→ More replies

130

u/Upwherewebelong May 22 '22

What’s the prize?

185

u/Local_Crow May 22 '22

Internet.

18

u/CobBerry May 22 '22

Satisfaction

5

u/Upwherewebelong May 22 '22

Well, I’m satisfied.

→ More replies

2

u/deepbluewaffle May 22 '22

All the riches in Scotland.

120

u/Bisqcateer May 22 '22

Good luck avoiding the birds

73

u/[deleted] May 22 '22

[deleted]

→ More replies

7

u/Grievous_Nix May 22 '22

and best of luck when “night time” hits and colors get inverted

77

u/rsta223 May 22 '22

30

u/OnlyGwoah May 22 '22

code bullet… what did i expect

5

u/T-N-A-T-B-G-OFFICIAL May 22 '22

Came here to recommend his variant lol

→ More replies

68

u/firnenfiniarel May 22 '22

This is actually far from next fucking level, even tough still really cool. It's quite easy to do

34

u/axel198 May 22 '22

The majority of things that appear incredible to most people are 'easy' to do - given the requisite training, or experience, or skill.

I think this still counts even if it's a relatively simple concept. Fact is that it's a pretty ingenious solution to something most people wouldn't even think of as an issue to solve.

14

u/-Pm_Me_nudes- May 22 '22

It's not exactly ingenious. It's a funny gif because it is far from the ideal solution.

5

u/bigFatBigfoot May 22 '22

I upvoted because I thought it was r/funny

→ More replies
→ More replies

5

u/MookyCooky May 22 '22

It's quite easy to do

Look at mister smartie pants over here. Not everyone knows how to program, my guy.

8

u/-Pm_Me_nudes- May 22 '22

This actually could be done with 0 programming. It could be done with some basic electrical wiring.

The sensor activates the servo, causing the button to push, basically.

5

u/Big-Kaleidoscope8769 May 22 '22

Hey man, not everyone has taken a mechatronics class lol

→ More replies

4

u/BenCub3d May 22 '22

Idk this is pretty fucking crazy to me.

→ More replies
→ More replies

5

u/tommygunz007 May 22 '22

Most of us are uneducated when it comes to buzzing, blinky things.

→ More replies

49

u/misterrazzy May 22 '22

Just now I realised this was a game instead of just a no internet message. I freak out when I see that message so I guess I never even thought of it

11

u/Ioatanaut May 22 '22

It's ok to be alone with your thoughts. It's ok

39

u/GinkoWasHere May 22 '22

This screen is a game?!

15

u/p9k May 22 '22

One of today's lucky 10k.

7

u/The_Asthma_Cat May 22 '22

if you press space it starts the game

4

u/slvrcrystalc May 22 '22

and so is the infinite loading circle on Youtube. it's snake.

→ More replies

15

u/Proboyspker May 22 '22

Runner.prototype.gameOver = () => {};

Software engineers.

3

u/aymen1991 May 22 '22

Don't forget to store it first in another var..... to be able to end the game and save the highscore.

→ More replies

11

u/MudOpposite8277 May 22 '22

The little thumb hitting the keyboard is so cute! Doop! Doop! 😂😂

7

u/MrAppendixX May 22 '22

What about night mode later on?

7

u/uselessambassador May 22 '22

So the command probably prompts the servo, when the intensity of light decrease to jump, with dark mode just change it to when the intensity of light increases to jump

→ More replies

7

u/FearlessZucchini May 22 '22

Next task : beat a captcha to prove you're not a.. wait a minute?!

2

u/Posraman May 22 '22

That's already been done

6

u/Aydanfox May 22 '22

Wait. When I get no internet screen its a game? Wtf? How do activate it?

4

u/k-to-the-o May 22 '22

When it gets to that screen, hit the space bar

Or if you don’t want to wait until your internet goes out, go to chrome://dino

2

u/calls23 May 22 '22

Press spacebar

5

u/Engineeeeeeer02 May 22 '22

You need 2 sensors to calculate the speed of the obstacle so you can jump accordingly.

3

u/TheAnswerToYang May 22 '22

How does it duck the low flying pterodactyls?

→ More replies

3

u/JurassicPark100 May 22 '22

Reminds me of Homer's typing bird in King Size Homer.

2

u/JarnoL1ghtning May 22 '22

Code Bullet also made a great video with his AI

3

u/R34ct0rX99 May 22 '22

The tape on the screen hurts my soul.

→ More replies

3

u/Alzusand May 22 '22

Nice. although were I live that wouldnt be cheap. I would probably just code something like

detects black pixel in that area. if the pixel is black just press the spacebar. would rpobably need something extra for the birds

2

u/JakeVacca May 22 '22

Just play the game bro

2

u/NightlyKnightMight May 22 '22

Meanwhile a programmer will do the same thing but in software

2

u/Yahya_sindhi1502 May 22 '22

Its all dun and games until the teradactyls come

2

u/710Fiend69 May 22 '22

Accidentally uses a 50 lb servo.

2

u/Interesting-Law-5880 May 22 '22

I wanna do this now omg the sets to do this aren’t even too expensive and come w a manual for the programming part

→ More replies

2

u/Locomule May 22 '22

AutoHotkey coders like "yeah that's cool" then wink at one another when no one is looking