I don’t know why I’m posting this… It’s embarrassing… but still…
So, working on some new code, just posting scores to an online leaderboard, nothing special at all. Write the code, test it. Doesn’t work properly, so I think I’ll give it a minute or 2 and go make myself a cup of coffee. Then I realise my error.
function Update()…
Every frakking frame…
For about 5 minutes, at about 50 frames a second, I’ve been spamming my own DB with useless information. It’s like my own DOS attack on my own server. My server shuts me down for 24 hours and I get an e-mail saying I’m being investigated for malicious practices…
If it makes you feel any better I spent about 6 hours going through code trying tof figure out why iTween wasn’t doing what I wanted it to do.
Went line by line through my whole project, spent hours searching the internet. Lots of trial and error.
What I finally realized at around 5 or 6 AM was that my freaking copy of iTween was out of date. The code was right, but it was calling a method that didn’t exist in my version of itween! One quick download and my game worked perfectly…
I once done something similar as well. When I was working on this 3D map editor, I accidentally put some piece of code in update function which created a gui text, and everytime I ran it I was going mad, why the hell is it lagging so much?! Yeh, it was creating new gui texts on same spot each frame or second or how ever that update function operates
I was going through all the scripts trying to find out what the hell is causing that horrible lagg and everytime I was skipping through the update function. Felt quite dumb when I found out what was causing the lag after all
I was converting the javascript code to C#. I didnt quite know how yield worked (mainly that you had to wrap it in a StarCorotuine()), so I rewrote a bunch of code that I didnt have to.
I kept working on my golf game. There are 18 scenes, and if you change one little value without updating the prefab you will end up with different results on all the scenes. I was manually going through each scene and changing the values, setting up the scenes, even going as far as to manually sit there doing the lightmaps. Well this can all be automated, if you write a little editor script, so just alot of wasted time.
+50 points! Congratulations, you’ve just upgraded your programming skills! We’ve all made mistakes like that, and they are absolutely the best way to hone your skills.
One of my favorite things to do is code while half asleep. Then spend hours looking to see why something doesn’t work the way it is supposed to, wake up the next day and immediately find that I can’t spell to save my life.
I’ve worked late into the night on code, trying to hunt down a particularly evil bug, only to wake up the following morning and discover that I’d somehow fixed it, without having any idea how the hell I did it. (What’s worse is that I tend to comment everything as I know my memory sucks, but comments tend not to be individually time-stamped.)
The moral, if there is one, is probably something like “Use version control!”