Blogs

Our community blogs

  1. Yesterday, I managed to extract models and animations from pokemon_graphic.bin, so they can be viewed with standard 3DS model viewers. Today, I did the next logical step, and wrote code to change these animations. Observe:

    I don't have special builds ready just yet, but if you're a developer who's anxious to make changes, I have some sample code here. (That link might be dead if you're reading this a week or so after this post was published.)

  2. Author's Note: This is just a fun opinion piece, with very little facts substantiating my claims. More of a 'speaking from my experience' type of thing.

    Back when Neo Destiny was first up for purchase on my sunny little island, I was excited. Finally, the return of the Dark Pokémon, and also the introduction of Light Pokémon!
    Unbeknownst to me at that time, Shining Pokémon was also a secret part of the expansion. When I pulled my first Shining Celebi from a booster pack, I was thrilled to bits!
    But something felt pretty off to me: why does this card even exist?

    shining celebi card.PNG
    Image source. Chose this image, cause it shows the glittering effect.

    Shining Gyarados was in Neo Revelation possibly due to it's prominent role in the story of Gold, Silver & Crystal at the Lake of Rage. Heck, Neo Revelation's expansion symbol, booster artwork, and also card artworks heavily features the Legendary Beasts roaming throughout Johto (which potentially shows that the TCG was following the games or anime lore closely).
    All the other shinies in Neo Destiny can be encountered in-game (plus Shining Noctowl was also possibly referencing Ash's Shiny Noctowl in the anime), so why does the Shining Celebi card even exist, given it couldn't be encountered in-game?

    Of course, since I was then only exposed to the English/International versions of both the TCG and Pokémon Crystal, it was natural that this question weighed on my mind, as the card's existence was lacking context. Context that could have been much more clearer to me if I was living in Japan.


    Pokémon Crystal in Japan has connectivity to the now defunct Mobile System GB service, which updates an in-game message board every month.
    Between the months of April and May of 2001, the message on the news machine will be updated to show something that translates to "The present which exceeds time" 1.
    It was only for that period, that players will receive the GS Ball, and that can only occur after you beat some mini-game and quiz, which was only possible with a game save that has all 16 badges.
    Now, Neo Destiny was released in Japan in March 2001 2. In this timeline underlined, this card could have easily been foreshadowing the fact that players have a chance to get Shining Celebi in Ilex Forest via the event.

    And before anyone points out to that "Hey, the expansion before it, Neo Revelations, already had Celebi in it", I will like to in turn point out other key date's along our timeline:
    1. Players in Japan could first receive Celebi on their copies of Gold and Silver at a real life event in August of 2000 3.
    2. Neo Revelation in Japan was released in November 2000 4.

    Given how these events typically goes, the DVs are likely fixed, hence said previous event would have yielded only non-shiny Celebi.
    Hence based on the timeline above, players likely already knew of the existence of Celebi, but probably never seen a Shining Celebi (without hacking), not until that Shining card was first released.

    At this point, some of you may be thinking "So what?". To answer that, here is a currently unavailable Shining Pokémon that was showcased officially by the TCG before it was released to the games.

    shining volcanion.PNG
    Image source. Once again, I chose this image, cause it shows the glittering effect.

    The expansion Shining Legends was released July 2017 in Japan 5, and it was the first time in years they brought back the "Shining" prefix to the TCG series.
    Curious enough, Shining Volcanion was given a card when a distribution for it's equivalent in the core series games have yet to be done.
    And as of the date January 2018, players have yet to receive a Shining Volcanion in-game, to go with the card.

    In recent years, it is not uncommon to have a "Shiny lock" broken for the game, and be commemorated by a close release of the TCG equivalent:
    1. Shining Tapu Koko event was first released to Japan in March 2017, with the card equivalent (GX and standard) available concurrently
    2. Shining Xerneas and Shining Yveltal common serial code event ran unceremoniously in October 2016, and the cards was obtainable in July 2016
    (international versions got the Shiny Kalos Tins and the game variants pretty much concurrently, I may add.)
    3. Shining Genesect event released in Japan July 2013 to promote the movie, and the promo cards was released concurrently.

    Additionally, such types of TCG and event gift tie-ins have been occurring for other shinies as well:
    1. Shiny Silvally Event being Sep 2017 in Japan, and it's card released in the same month (GX and standard)
    2. Shiny Rayquaza Corocoro Event and the TCG campaign running concurrently in March 2015.

    It is possible for me to list non-shiny examples, to show other tied releases between TCG and events (Zoroark for EX Breakpoint, Lycanroc for Guardians Rising, Salazzle for Burning Shadows), but a bulk of these are non-Japanese, so I am not sure how relevant it would be to refer to it, when typically Japanese events breaks the shiny lock first.

    But of course, with any opinion piece, lies examples that tears through the flawed logic.
    For example, TCG alternate colored cards that did not get a game gift mirroring it's release in close proximity (random shinies like Blastoise from BW era, or Shining Arceus from the same Shining Legends expansion mentioned above, or even the limited edition Corocoro Shining Mew card from Neo Destiny era, Red Gyarados in EX Breakpoint).
    Or perhaps core series Shiny events that did not get a corresponding card mirroring it (Shiny Arceus's first release in Japan, Shiny Diancie in Japan, Shiny Jirachi event in Japan etc)

    In any case, as flawed as my logic may be, it still seems rather odd that in this era that games and cards are intimately mixing, that a card would break the shiny lock,
    but not have a corresponding event following it closely. I certainly do hope that an event for it is coming soon, as unlikely as that may be.
    So what do you think? Do leave your comments below!

    In any case, it may not be possible to get a Shining Volcanion any time soon, but if you want to obtain your very own Shining Celebi, it may be possible to get one with the upcoming Virtual Console release of Pokémon Crystal! Grab a copy on January 26, 2018!
     

    Text Sources:
    1. Regarding Celebi GS Ball Event dates. (
    link)
    2. Regarding Neo Destiny's Japanese name and launch dates. (link)
    3. First known Celebi event in Japan (link)
    4. Neo Revelation launch date (link)
    5. Shining Legends launch date (link)

  3. At the company at which I work, we have this legacy application written in C#. (It's different from the one written in Classic ASP.) Let's call this the dragon. It's old, it's previously defeated many brave knights, and its name is an acronym that shares a letter or two with the word "dragon". The dragon is responsible for breathing fire to defend the village from intruders. (It uses coding and algorithms to do Things to Products because of business logic. While the details aren't important, I doubt I could say what it does beyond giving a brief overview of what it looks like to an outside observer.) However, the dragon also has this habit of attacking the knights who control it, so we need a new village gaurdian (the dragon is composed mostly of spaghetti code, and if we are ever to replace it, we need to understand how the spaghetti works). And so, a week or two ago I undertook a challenging task: to shrink the dragon so it'll fear the knights again (to refactor things to make it more readable). Armed with a mouse, keyboard, and the support of a fellow knight (a coworker who's dealt with this application before), I got to work so I could deal a mighty blow to the dragon. (Disclaimer: this post contains a lot of technical C# stuff that can't all be hidden behind dragon metaphores. Hopefully anyone who's not a programmer can still follow.)

    On my journey of code cleanup, the dragon presented many obstacles. A lot of it was superfluous spacing, redundant comments, and generally painful code, like so:

    ////
    //// Configure processing
    ///
    
    this.ConfigureProcessing();
    
    ////
    //// Do the thing
    ////
    
    try
    {
    
        this.DoTheThing();
    }
    catch
    {
    	// eat it 
    }
    
    if (this.SomeProperty == SomeValue) {
    
        // throw new SomeKindOfException();
    
        // this was commented out
        // to-do: figure out why this was commented out
    }

    To make it even better, this.ConfigureProcessing does nothing and is referenced nowhere else, meaning we can easily remove most of the above. Also you should never ever ever ever ever catch an exception without handling it somehow. It will cause pain further down the line (but not in this blog post). If nothing else, log it somehow.

    Taking all of that into consideration, I reduced that code to this:

    try
    {
        this.DoTheThing();
    }
    catch (Exception ex)
    {
        Trace.WriteLine($"Got an exception in TheType.TheFunction: {ex.ToString()}");
    }

    There were also some things outside of general cleanup that I did. Imagine a class like this:

    public abstract class Magic : IAlgorithm
    {
        private string spellName = "Alakazam";
        public string SpellName
        {
            get
            {
                return spellName;
            }
            set
            {
                if (value == null)
                {
                    throw new ArgumentException("SpellName can't be null");
                }
                spellName = value;
            }
        }
    
        private IWizard wizard = null;
        public IWizard Wizard
        {
            get
            {
                return wizard;
            }
            private set
            {
                if (value == null)
                {
                    throw new ArgumentException("Wizard can't be null");
                }
                wizard = value;
            }
        }
    
        #region IAlgorithm Methods
        public void SetWizard(string wizard)
        {
            this.Wizard = wizard;
        }
    
        public void Cast()
        {
            if (this.Wizard == null)
            {
                throw new Exception("Cannot call Execute before SetWizard");
            }
    
            this.PerformMagic();
        }
    
        #endregion
    
        protected abstract void PerformMagic();
    }

    Not shown: 20 or more classes that inherit from this

    My fellow adventurer made the observation that the only times SetWizard was called was right after constructors of child classes, kinda like this:

    public Magic GetMagicInstance(string magicType, string spell, IWizard wizard)
    {
        Magic magic = null;
        switch (magicType)
        {
            case "white":
                magic = new WhiteMagic()
                {
                    Spell = spell
                };
                magic.SetWizard(wizard);
            case "black":
                magic = new BlackMagic()
                {
                    Spell = spell
                };
                magic.SetWizard(wizard);
            case "lost":
                LostMagic magic = new LostMagic()
                {
                    Spell = spell
                };
                magic.SetWizard(wizard);
        }
        return magic;
    }
    
    // Somewhere else calls magic.Cast after all instances of Magic have been created

    So using this knowledge and the knowledge of new C# features, we made the appropriate changes everywhere to make the class (and related classes) look like this:

    public abstract class Magic : IAlgorithm
    {
        public Magic(string spellName, string wizard)
        {
            SpellName = SpellName ?? "Alakazam";
            Wizard = wizard ?? throw new ArgumentNullException(nameof(wizard));
        }
    
        public string SpellName { get; }
    
        public IWizard Wizard { get; }
    
        #region IAlgorithm Methods
    
        public abstract void Cast();
    
        #endregion
    }

    They say that if it bleeds, you can kill it. The dragon was certainly bleeding, if the code review tool was anything to go by: there were red lines (removals) all over the place in the pull request (Git terminology basically meaning we're publishing our changes). Two other knights in our party came to inspect our triumph (they reviewed the code to make sure it was done right). When it was all over, a total of 4 people (2 of us were involved in the refactoring) thoroughly reviewed everything and approved. Then we released the changes to be applied to the dragon down in the village (along with some other minor quality-of-life changes).

    About a week later*, one of the villagers called for help because the dragon that's supposed to defend the village was unable to breathe as much fire (a user opened a support ticket because the Things being done to Products weren't being done correctly). I was skeptical that any of my changes would have that effect. After all, when I shrunk the dragon, I made sure to quintuple-check my changes before releasing it to make sure its fire breath was as unchanged. So I investigated for a few hours to find out why. I ruled out places that could have been affected and was thoroughly stumped. That's when my fellow party member used his influence with the king to learn the secrets known only to the villagers (he used his higher permissions to debug the application, reading data from the production database). That's when I spotted the issue. Remember that constructor in the Magic class that was created? Take another look at the SpellName assignment:

    SpellName = SpellName ?? "Alakazam";

    That should be:

    SpellName = spellName ?? "Alakazam";

    In C#, variables are case-sensitive, so the property was being assigned to itself, and all Magic classes (WhiteMagic, BlackMagic, LostMagic, etc.) all only used the Alakazam spell. No wonder the flames were weak!

    We fixed the issue, and gave the villagers a dragon capable of properly defending them, and spent the rest of the day identifying how many intruders snuck into the village while the dragon was powerless to stop them (we had to find out which Products didn't have the Thing done properly).

    Conclusion

    Case sensitivity can potentially lead to a lot of pain and suffering. In this case with the constructor, that's standard practice in C#, and it's perfectly understandable that no one caught that one mistake, especially since it's just one letter in commit full of thousands of other changes. The tooling didn't catch it, because it checks for useless assignments. This wasn't useless, it says "make SpellName be Alakazam if it's null". Always be careful of casing when variable names are similar.

    * I massively simplified a lot of things. While a week is probably a bit long to go without noticing anything wrong, there's reasons. Also it didn't affect everything, because it just broke some hacks that are there because business logic.

  4. evandixon
    Latest Entry

    By evandixon,

    Today I learned about a feature in our new Gallery app: notes. The feature is best described using pictures.

    Capture.PNG

    One of the old Project Pokémon banners I had lying around, uploaded to a private album

    When your mouse is in the giant dark-gray area, there's some buttons. One of them is the Add Note button.

    Capture4.PNG

    The Add Note Button

    Clicking the Add Note button adds a transparent, resizable, and movable rectangle to the image, which comes with a text box that lets you add text.

    Capture3.PNG

    Once notes are added, they can be read by mousing over the image.

    Capture2.PNG

    • 0
      entries
    • 0
      comments
    • 126
      views

    No blog entries yet

    • 0
      entries
    • 0
      comments
    • 87
      views

    No blog entries yet