r/badcode • u/fshpsmgc • Mar 24 '21
c# I was digging through an old group chat back when I was in university, and found this absolute shitpost of a code
185
u/chadmill3r Mar 24 '21
One out of sixty times, FPS is zero, which might be fun.
39
u/Goontt Mar 25 '21
What would actually happen in this case..?
65
u/devhashtag Mar 25 '21
The screen will show the same frame forever
31
u/Goontt Mar 25 '21
Ah fair enough. And I assume the update loop wouldn’t be called again because of that, completely halting the game/app?
3
7
8
u/Inopmin Mar 25 '21
So give it an actual minute lol
6
u/cordev Mar 25 '21
Less, since this is called once per frame. It should only take a couple seconds on average.
2
75
Mar 24 '21
Image Transcription: Code
// Update is called once per frame
void Update () {
Application.targetFrameRate = Random.Range(0,60);I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
18
41
u/teabolaisacool Mar 25 '21
Nice way of making a release stating “Vastly improved stability and load times” once you remove it
20
u/db2 Mar 25 '21
Framerate has been increased 0-60x!
7
u/Ahajha1177 Mar 25 '21
Well, if we include the case that one out of ever 60 seconds has an FPS of 0, then that would increase it infinity-x. Even if we average it out, that's (infinity + something)/60, still infinity-x.
3
u/db2 Mar 25 '21
I saw that, but considered even a marketing critter wouldn't be able to sell infinity.
43
33
14
u/0xF013 Mar 25 '21 edited Mar 25 '21
Reminds me of my java adventures with parallel code. I used to randomize some parameters and see which is faster. I should have patented it as ML
9
11
u/t0shki Mar 25 '21
I thought moving targets in a videogame is a good thing. Would be boring otherwise.
6
u/DrSandwichMan Mar 25 '21
Why are people downvoting an obvious joke?
1
u/t0shki Mar 25 '21
Lol, didn't even check the numbers until now. Well.. it is seemingly 'controversial' for some reason when it was just a silly wordplay on my part.
2
2
u/jaysuchak33 ifelseifelseifelseifelseifelseifelseifelseifelseifelseifelse Mar 26 '21
I hope you used Time.deltaTime for physics and user input lol
1
2
1
1
u/ilikedankmemes3 Mar 25 '21
Ok that’s kinda funny. Although it should be from 1-60 otherwise it’ll either stop completely or roll off to the max FPS possible.
1
2
Mar 25 '21
[removed] — view removed comment
4
u/fshpsmgc Mar 25 '21
I think, it was a part of some joke game or something, and definitely not a part of any serious effort. This, even at the time of writing, didn't have any practical application and was meant as a shitpost
166
u/reddit-be-cool Mar 25 '21
... Why? I fail to conceive of any possible application for this. Unless your goal is to cause pain and suffering for the players?