Good evening boys and girls, it's time for...
Debugging Item Bonuses With Ethan! (Yaaaay!)In today's episode, Ethan tackles the mean 'ol Item Bonus Generation Problem gang and learns a lesson about friendship from a cute anthropomorphic woodland critter.
Hi kids! How are you all doing today? Boy have I got a story for you all! Do you all remember the nasty Item Bonus Generation Problem gang that had been skulking around here lately? Well, we won't be hearing from them anymore! And
all of this could have been prevented if it weren't for one tiny, itsy-bitsy bug. That's right! The IBGP gang-leader!
The mean 'ol IBGP gang would've gotten away with it if it weren't for its leader's calling card: the Non-Existant Bonus ID. Yup! I suspected this for a while, but in the end its existence was confirmed all thanks to our informer, Delfigamer! So I started doing some skulking about of my own, this time into the Dark and Evil lair known as The Game's Source Code. @_@
...Where it turned out I had not one but TWO fail-safe tests to ensure bonus IDs being generated DID, in fact, exist in the list of bonuses. Kids? I want you all to pay close attention to uncle Ethan now: put your hands over your ears and wait until I give a thumbs up before removing them.
![Smiley :)](/forum/Smileys/default/smiley.gif)
What the fucking hell? Seriously, what the fucking hell? There's literally no fucking way a non-existent bonus ID can be generated. Not with
two fail-safe tests that don't allow the one single place where bonuses are generated to return anything unless it's explicitly a valid ID. Complete. Fucking. Nonsense. OYA, and extensively testing the function to ensure it doesn't somehow generate the wrong ID never returned an invalid ID in ~1000 runs. Someone's fucking with me here... >_>
*Give thumbs up.
![Cheesy :D](/forum/Smileys/default/cheesy.gif)
*
Out of ideas, I went to visit the old sage, Item Data Serializer. He invited me into his little hut and offered me a cup of tea to clear my mind. As we sat around his table discussing the Item Bonus Generation Problem Gang, my head started feeling fuzzy and my vision swam about unsteadily. The tea! Item Data Serializer had drugged me! I confronted him...
"Hey old man, you put something in this tea! Just what are you up to?!"
"Hush, young programmer. You should have paid more attention to the server code..."
"I don't understand. You're the backend. You're supposed to be rock-solid or everything falls apart. How could-"
And then I knew. He was their leader. The leader of the IBGP gang! I felt myself growing weaker - the paralytic agent was working fast indeed - but I wasn't going to give up! I gritted my teeth, forced myself to stand, and ripped open the old fool's source code. The mountains shook with the fury of my debugging - it was such a simple bug, how could I have been so blind! - and soon the old man lay still. Moments later his eyes opened and he seemed oblivious to what had happened moments ago.
I smiled, thanked him for the tea, and left.
Do you remember the members of the IBGP gang? Item That Freezes Up The Game, Cursed Items That Almost Always Have The Same Curse, and even the cleverly-hidden Item Bonuses That Never Get Generated? I believe with the fall of their leader, they are now gone.
And that concludes today's adventures, kids! Remember, treat your friends right - a badger told me this, once. >_>
I'll be making an update in a few days - got a few other things I'm working on too - but once uploaded this should fix pretty much all bonus-related problems. The bonus ID was being improperly stored and IDs > 10 would overwrite the units with the tens (eg, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22 were the IDs the game could generated; 11 is "Frail" I believe, and 22 does not exist.). In the meantime, if you have a broken item and can't get rid of it, let me know your character name and I'll remove the bonus ID 22 on whichever items have it.