But it works fine. The PM asked to show fps value at least 60. And the person is doing exactly that. With such supreme logic, the programmer is also trying a new indentation convention.
It hetz cuz you can't crack the logic and now you're envious.
All the great personalities weren't appreciated in their own time.
To be fair this comment was on completely the wrong sub. Had you not said anything I wouldn't have even noticed. Also, why do you think? These are elitist coders afterall.
Game devs who use unity write horrifying code. Source: I makes games in unity and write horrible code.
A lot of devs will create new objects every frame rather than caching and reusing them. Or finding a component every frame instead of finding it once when the game object is created. Or checking a value every frame for changes instead of using a setter.
I am not a game dev by any means, I do mostly firmware but I played with Unity in the past and those things never came up in my mind, finding a component every frame is atrocious, maybe because I work in a field where you are not allowed to do certain things or you run out of memory. Nevertheless, I still do not get the point of the class OP posted, why is he doing that?? I cannot sleep
The reason is cause unity holds your hand just enough that anyone thinks they can code. But not enough that you can actually do stuff without code. A mix of pure evil if you ask me.
Computers are powerful enough that a shitty Minecraft clone doesn't have to be efficient. A lot of people don't care if their code is slow as long as it works.
This reminds me of the PSX days when a publisher wanted to ensure the framerate was good. They asked us to show it on screen in Dev builds. But we were slightly below 25 PAL occasionally, so we just hard coded it.
558
u/R3D3-1 Sep 20 '21
If course the worst part is the asymmetric space around ==.
297
u/[deleted] Sep 20 '21
It hertz to look at this…
94
u/was-eine-dumme-frage Sep 20 '21
So that's leaked gsync code?
217
u/Valon_Inc Sep 20 '21
How to never get 60 fps
68
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Sep 20 '21
Image Transcription: Code
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!
29
u/SaucyParamecium Sep 20 '21
this can't be real, I refuse to believe it is
50
u/[deleted] Sep 20 '21
this one hurt too much
15
u/SuicideWind Sep 20 '21
When u need 500 lines of code by 2pm
14
u/shizzy0 Sep 20 '21
This is a person that looks at
x = aand thinks to themselves, I can prove this but it’ll take an infinite number of cases.39
u/nekokattt Sep 20 '21
namespace yanderesimulator { }
49
u/Spynder shameless stealing content to r/YandereTechnique Sep 20 '21
r/YandereTechnique
11
u/RealLethalChicken Sep 20 '21
How to convince people that your game runs well:
Step 1. Lie
Step 2. Refuse to elaborate
12
u/Equixels Sep 20 '21
Dude.. you didn't screenshot the whole thing! I wanna se how it follows! I need it for my personal project! 😭😭
5
u/tcpukl Sep 20 '21
This reminds me of the PSX days when a publisher wanted to ensure the framerate was good. They asked us to show it on screen in Dev builds. But we were slightly below 25 PAL occasionally, so we just hard coded it.
Milestone payment done.
12
u/sktr-guys Sep 20 '21
why not switch case ...
3
u/HeatBlastero6 Sep 20 '21
I've only just started learning c programming and I'm already hurt by this
2
u/nyaisagod Sep 20 '21
Also... what is this even supposed to do? You can't just "set" fps, only maybe max fps. The first case is the most nonsensical.
2
u/FDGKLRTC Sep 20 '21
I could do better than that and i'm fucking Bad at coding
2
u/tichion Sep 20 '21
But what happens in the (else if == 67) case, I have to know.
2
u/CSsharpGO evil Sep 21 '21
fps = 200
Performance issues: annihilated
2
u/FriddyNanz Sep 20 '21
Ah. Someone needs to learn switch statements, I see /s
1
u/zickige_zicke Sep 21 '21
I wouldnt be surprised if this was in unity's official tutorial
1
u/Lkj509 Sep 21 '21
Unity, where complete beginners jump into the deep end
1
u/shut_up_if_your_dumb Sep 20 '21
Lol what repo is that?
1
u/Imperial3agle Sep 20 '21
No….
1
u/deftware Sep 20 '21
Brilliant!
1
u/kabiskac Sep 20 '21
Should have used switch, right?
1
u/FreshRepresentative Sep 20 '21
If your FPS is under 60Hz, ignorance is bliss, apparently. lol
1
u/[deleted] Sep 20 '21
Yandere simulator source code leak
1
u/AtlasJan Sep 20 '21
BAN ALL WHO THINK OTHERWISE
1
u/CarterNotSteve Sep 20 '21
‘f p s = h e r t z’
1
u/accuracy_frosty Sep 21 '21
“If (FPS < 60)
{
}
Lol
1
u/[deleted] Sep 21 '21
hertz = (fps < 60 ? 60 : fps);
1
u/drazlone Sep 21 '21
It hertz to see this
1
u/account_552 Jan 16 '22
im not an expert but couldnt this just be shortened down to just
void Update()
fps = hertz
1
u/[deleted] Sep 20 '21
Looks like shit Yandre Simulator's code would look like.
0
u/[deleted] Sep 20 '21
void Update() {FPS = hertz;}
0
u/[deleted] Sep 20 '21
[deleted] — view deleted comment
4
u/[deleted] Sep 20 '21
[removed] — view removed comment