Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
So I'm making a music game, and I've been struggling to fend off this large sound latency issue. There is like a ~80ms of latency, which is a total deal-breaker for music games.
So I've been polling everything using a profiler, but nothing came up... Until just now, I realized:
IS IT MY F*<KING KEYBOARD THAT IS LAGGING?
I pulled my iPhone out, opened the Notes app, and recorded the screen as I smacked the keyboard.
Whaddaya know, exactly after 5 frames (in 60fps) of the sound of me punching the keyboard, the letter shows up.
Now I need to take *this* lag into account :facepalm:3
I just had this field with certain class type that acted so $h!++y on me that I almost believed I had finally gotten insane from all those coding.
I’m talking about Unity C#. When the code runs after a domain reload, I find that this specific field always comes prefilled with “an instance of that class whose properties were the default values.” So every time when I change something in my code (which causes a domain reload,) this field becomes an instance of the class with default properties **without any outside interaction.** All my null guard code fails and what follow are thousands of null reference exceptions because my scripts tries to access the properties of that instance, which are null.
Turns out, it was maybe because the class in question was marked with [Serializable]. When I remove it, the behavior completely stops.
This behavior was so unexplainable in clear words that googling for such behavior was pure impossible. Like WAT. I don’t even know which of C# or Unity caused this weird $h!+ to happen.2
I just found another "npm install" meme in my Twitter feed. They don't seem to get old, ever.
And then I remember that Unity Package Manager is npm under the hood. I hope this is not the future of Unity packages.
I'm troubled by the stuff I made back when I did not know how I should use Unity's Animator. I have these animators that open and close a dialog with transition effects, but I used Triggers to accomplish it. With Triggers, no matter how I construct it, it seems that there is always this weird edge case that can only happen if Triggers are spammed.
Why I did not use Bools for open/close state is beyond me. And I have tons of those Animators to fix. FML.
"Longest you worked without rest + why?" (2)
Oh, I am an idiot 🙂! 7 hours isn't nearly the longest I've worked without rest (see my previous rant.) I just remembered working non-stop almost for a day in the past.
It was for an annual 48-hour hackathon where people gathered to make games.
It made me promise myself not to work excessively long hours non-stop. My creativity level was way below the ground, and during the after-party, my body sort of kernel-panicked, and I started to become incoherent. I had to call a taxi to find my way home that day.
For the following years, I made sure to get some rest (e.g., go home at night to sleep, spend the lunch break time actually having 'lunch break' and not coding while you're at it, etc.) because I did not want to wreck myself any further.
"Longest you worked without rest + why?"
Maybe around 7hrs or so? It may not be much, but the thing is that I had to work almost the whole night through.
I was about to show off a game at the school festival, and I had to finish multiple playable stages while not having a dedicated stage editor application; I was using Notepad as the stage builder. I had to work through the night before the event.
Ended up catching the flu after the event, but I don't regret it.1
They call Python, C, Java, Ruby, and stuff like that programming 'LANGUAGES' for a reason. I just wrote a Python dictionary literal in my C# code and was clueless as to why it was failing to compile for five minutes straight. Maybe that was because I was working with Python like 30 minutes ago.
It's like I have to have one 'brain' per one language and need to switch between such 'brains' to write code in another language. And such switches take time.5
I've got a report that one of our machine-learning purpose computers broke down suddenly. I took a look and saw that the thing was stuck at the BIOS screen. The thing that was off was that it did not prompt for any keystrokes. Like, if there were a BIOS problem, there would usually be a prompt to press <F1> to ignore or something, right? But, nope! Even BIOS did not do jack s#!+.
I tinkered around the peripherals for an hour before finally finding something odd - why the f*<k does this computer have a screen hooked up via f*<king D-Sub????????
Yup, somebody hooked up a screen to the base motherboard via D-Sub when they rearranged other computers, even though that machine needed to have a screen hooked up to a GPU via HDMI.
Rarely do I find well-organized code written by researchers. Well, it runs, so reproduction is possible, but when it comes to actually change something in the code, it's as messy as it can get.
And THEN, I look into the paper so that, hopefully, I can make sense of what is going on. Turns out, the documentation on the paper is also poor.
F*<k. My. Life.
"Most memorable bug you fixed?"
A recent instance happened in one of my Scratch projects, and the bug involved "Infinities."
I had an opportunity to teach kids programming, and it involved Scratch. So, to have something to show those kids at least, I decided to make a small game.
In that game, I had an object that takes some time before appearing after being cloned (i.e., instantiated.) The duration was calculated by dividing a constant with a variable:
[Wait for ((3) / (variable)) seconds]
The bug is that I forgot about the case where 'variable' can be 0, which is classic and insignificant.
Well, the thing is that I learned two things the hard way:
1: Scratch is very flexible about integers and floats (e.g., at one second, it looks like an integer, but one operation later, it's a float.)
2: Scratch does not provide any 'runtime errors' that can crash the project.
In other languages, similar "wait" methods take "milliseconds" in an integer, so it would have barfed out a "DivideByZeroException" or something. But Scratch was so robust against project-crashing behavior that it literally waited for f*<king "infinity seconds," effectively hanging that clone without warning or runtime errors. This masked my bug. It took way too long to debug that s#!+.
Don't blanket-mask any errors.
TIL RVM and I are on different assumptions. I'm talking about RVM allowing unbound variables in its scripts.
I don't because I literally have run "rm -rf /" on my Mac because of an unbound variable in the past. So, when I write a shell script, the second line is always "set -eu."
And because RVM allows unbound variables, this line crashes RVM.
Then for some stupidity on my part, I looked into GitHub for its codebase first to get even more clueless about the issue before finally googling to see if anyone had experienced the same problem 🤦1
"Worst drunk coding experience?"
My alcohol tolerance is very low. So, every stupid attempt of my coding in such a state is the worst experience.
There's this pulsing feeling in my skull every 10 seconds blocking my attention.
And there's an increased chance of mistyping commands.
One time, for some reason, I kept "pulling" the git commits when I actually wanted to "push" them. I spent a lot of time finding out why the f*<k GitLab is not showing my new commits in my PR before realizing my sheer stupidity.
And it takes me only one 3.5dl can of low alcohol content (like 3% abv) drink to relive these experiences. WTF.
When I found out that the server I use weirdly implements SSH login.
For some very odd reason (probably a historical one,) you have to access the web-app console and press a button TO GRANT SSH ACCESS TO THE F*<KING IP ADDRESS FROM WHICH I PRESSED THE BUTTON. The server blocks the wrong IP addresses outright. And only one active allowed IP at a time. This totally obliterates my plan to perform CD on this server. Why can't I just register public keys?
Then I learned several months later that they introduced a new server plan that *does* support the public-key registration. :facepalm:
I'm divided on whether to change my plan in exchange for a rather significant increase in the monthly cost.3
Ahh, Unity’s “Wheel Joint.” Who knew it had “polarity.” I spent good several f*<king hours debugging this $h!+ just to find out I just placed them backwards on a 2-D car. Instead of the joint turning the wheels, they were trying to “turn the chassis.”
This meant the chassis received an impossible force which would rip it in half in real life. Of course, this was a unity game, so what happened instead was the physics engine flipping out which sent the car into the air!
I guess it was good for some lulz, but it took way too long to debug. I guess it’s time to take a little time off of that project.4