Details
-
AboutPh.D. in Information Science. Employed in game dev industry as a developer. Likes music games. Self-publishing games as Exploding Cable Productions.
-
SkillsUnity C#, Python, PHP. Recently started coding with Ruby and Raw C.
-
LocationJapan
-
Website
-
Github
Joined devRant on 7/3/2022
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
Learning C/C++ started to become fun, mainly because I've managed to do seemingly cursed stuff lately.
For example, today, I learned you could totally call a class member function using a type-matching nullptr variable. The 'this' variable is so null that it will crash as soon as the program hits 'this', though, but the control flow does go into the function.
It's not *that* cursed once you learn the behind-the-scene stuff, but that kind of weird s#!+ is funny, even amusing for me, who've mained languages other than C/C++.15 -
Favourite thing you worked on recently?
——
I’m working on server monitoring system. I found that I need to pay for most server monitor services, and ones that are free/open source didn’t sound like they fit my use case (b/c the server i need to monitor is shared,) so I basically said “f*<k it I’ll do it myself.” I find it fun to work on something that I feel the need to make.1 -
I just learned the hard way not to recklessly daemonize stuff; I ran into a case where my Python script crashes Python itself.
The issue was that one of the query that “requests” package makes for OS was not fork safe, thus causing a segfault. Since Python drops dead as soon as it receives SIGSEGV, all I had was macOS crash log (which is oftentimes hard to decipher). I spent like good one hour before I found “faulthandler” package which enabled me to log the stack trace to stderr and see what the f*<k was going on.
I mean, I’ve seen quite a lot of occurrences of thread safety issues, but now it’s fork safety!?
Maybe I should be sticking to Docker or something unless the situation *really* requires me to daemonize something lol2 -
Don’t you just hate the feeling when you think you have some module in your project that may make sense to be an open-source library, but as you document its features, you start to second-guess everything about the module’s worth? I mean I probably shouldn’t guess anything, but I can’t seem to help it.2
-
Unity's "quirk" messed me up again. This time, I wanted the time when the key was pressed as precisely as possible, independent of the framerate.
So I put the input reading routine into the thread pool, which causes the first few readings to throw null reference exceptions. No biggie; the system needs a few moments to warm up. So, I try-catch that part.
But when I build the game, as soon as I reach the part where the game tries to read the input value, it hard-crashes before try-catch can act 🤦8 -
Didn’t think I would run into issue because I was using Apple Silicon macs - something borked my ruby gems installation, and reinstalling made matter worse by Bundler installing gems that apparently linked to whatever arch they liked. Now if I run bundle exec there was that one f*<king gem that died of mismatching arch until I intervened.
-
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.
https://twitter.com/ChrisArter/...1 -
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.
🤦4 -
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.3