Tuesday, September 24, 2024

Forethoughts: Video Game Patents and Why You Should Care About Them (Pokemon vs Palworld)

 So normally I don't do this sort of thing. I normally like to talk about subjects well after the subject has cooled off and everyone has more room to think rationally rather than acting on emotion. However, today's subject will have side wide reaching ramifications on the game industry that I feel compelled to speak on it.

For those who aren't in the know, there was a game released in early 2024 called Palworld. It's an Open World Action game with a monster catching mechanic developed by Pocket Pair, an independent game studio in Tokyo, Japan. Palworld has gone through a number of controversies since it first came to light, many of which were just drama bait. One of them, however, is somewhat related to this topic: that being the idea that Palworld infringes on the copyright of Nintendo's flagship monster catching franchise Pokemon.

Nintendo had announced earlier this year that they were going to investigate Palworld to see what claims were true and false about whether or not the game actually did infringe copyright. In case anyone's wondering, no it didn't. While it did take some inspiration from the perspective of artstyle and setting, Pokemon and Palworld are two distinct franchises that don't have too much overlap in the way of designs, nothing that can be copyrighted anyway, and the series are also completely different from each other mechanically. As some have said in the past, if Palworld really did infringe on Pokemon's copyright, Nintendo probably would've found it by now.

And it turns out Nintendo agree because rather than sue Pocket Pair for copyright infringement, they decided to sue for patent infringement. For those who aren't super well versed on the laws of copyright, trademark, and patent, allow me to explain.

All of these are forms of protections for your non-physical property but the way in which copyright and patent are distinct, to summarize, is that copyright protects the expression of your ideas but not the ideas themselves, whereas patents protect the ideas rather than said idea's expression.

To give you a concrete example, let's take a look at Street Fighter 2 and the original King of Fighters. These games mechanically shared quite a bit of overlap. They were both 2D fighting games with emphasis on martial arts and even used a lot of similar fighting styles for their characters. However, neither of these games infringes on the other's copyright. If you were to ask if Terry Bogard infringed on the copyright of Street Fighter by having a design similar to Ken Masters, you'd be very wrong. Although the characters share some design similarity in terms of color palette and personality, those two things are building blocks that cannot be copyrighted. If Terry Bogard looked exactly like Ken but was only a different color, that might actually be copyright infringement. But they're both simply blonde haired, red themed, martial artists that are also major characters in their settings.

With copyright, if you create a 2D fighting game, even if it has some similarities to Street Fighter 2, as long as nothing's overtly identical, your game is allowed to compete at the market. This changes with Patents.

According to Patent Law, the idea you have for your product that's expressed within the patent is something that you own the rights to temporarily. If Capcom, for example, Copyright Ryu in their Street Fighter series, you're not allowed to use Ryu himself but you are allowed to use characters with similar mechanics. If a Patent, however, is filed for a Shoto Archetype Characters in which their moves include an Invincible Reversal, a Projectile Attack, a Light-Medium-Heavy input system, and a decent movement speed, then even if your character was distinct from Ryu in most ways, making a character that has any or all of those traits would be completely illegal unless your game was also in some way published by Capcom.

Capcom themselves have not filed any patents that aware of but think of this as the starting point for understanding the Nintendo vs Pocket Pair lawsuit that is impending. Nintendo had been filing patents for a while but the ones that I had heard of initially were for The Legend of Zelda: Tears of the Kingdom. Things like "Loading Screen Text" and "Elevators" were among some of the things included in the patent list. Now, to my knowledge, none of Tears of the Kingdom's patents actually went through. However, one particular set of patents for Pokemon did.

The patents listed sort of go together but they're two separate ones. The first is to use Third Person Aiming to throw an item into the world in order to spawn an Actor from said item. The other is to use Third Person Aiming to throw an item into the world to then place an Actor into said item and place it in your inventory. If that sounds super technical, basically it refers to the act of catching monsters and summoning them later.

Now, this is all fine and dandy but the problem with this is that the way this patent is worded it may refer to a lot of things besides monster catching. It could refer to catching an enemy and then summoning them later like in many Western RPGs. It could refer to some sort of possession mechanic like in a Vampire or Sword and Sorcery game. It could refer to a Dating Sim's harem mechanics. Possibilities are abound but the Patent doesn't care about the context of the idea, only the idea itself.

Now for the specific Palworld case, there is something that could be a saving grace for Pocket Pair. That is that if the patent was not in effect when Palworld began development or at least began posting about development, it might be grandfathered in. For those who don't know, a Grandfather clause refers specifically to a situation where if an old precedent is replaced with a new one and your institution is built specifically with the old one in mind, you can abide by the old one instead but every new institution has to abide by the new one. In the context of video game patents, video games that existed before the patent went into effect will not be taken off the market but any new games looking to use a similar mechanic will be stymied. 

Now then, I'm not particularly interested in this little caveat for one simple reason: even if Palworld is free and is allowed to run free, it doesn't change the fact that Nintendo have effectively taken ownership of an entire mechanic that affects an entire genre of games. Monster catching is in no way specific to Pokemon, and in fact high profile franchises like Digimon, Yokai Watch, and Shin Megami Tensei all have a similar set of systems. What this effectively means is that Nintendo and Pokemon can run around unimpeded but if any of those aforementioned franchises want to make a new game, the only way to do so would be to get into a business partnership with Nintendo.

This doesn't sound too bad yet but let's put this in perspective: Nintendo had previously attempted to force 3rd Party Developers to only make games for the Switch if it would ever get a Switch version, which basically prevents other systems, be it Playstation, XBox, or PC from getting a version of those games. At that time, those developers had to choose between releasing a Switch version and releasing versions of the game that don't include the Switch. Given the Switch's relative popularity, it doesn't seem like too much of a loss to just make your game for everything else and the Switch just misses out. However, with this patent in place, if you want to include anything resembling a monster catching/summoning mechanic, your only option is to work with Nintendo. This effectively means that if you want to include the mechanic and Nintendo say no to working with you, your game will either not get made at all or will have to be drastically revised to not include the patented mechanic.

This in turn gives Nintendo an extreme amount of bartering power by basically saying "If you don't like our terms, go work with someone else. Oh, wait, right, you can't!!" Which will have drastic knock-on effects for either removing competition or redistributing it such that it's all under Nintendo's umbrella.

I've been presented with the argument before that a bunch of companies that make competitor franchises will likely not stand for this. I have two arguments against this: number 1, is what I just said that these companies could just work with Nintendo and receive a slightly smaller but still potential cut, even if that cut also benefits Nintendo themselves. The other problem is that Nintendo is not the only one doing this.

Another party I'm aware of is Warner Bros. henceforth known as WB, filed a patent for the Nemesis system that exists within the Middle Earth games, specifically Shadow of Mordor and Shadow of War. I think the reason they got away with this initially is because there really isn't anything like The Nemesis System in other games, which meant the patent wasn't violating any form of competition by patenting something a lot of people were already making. However, the patent itself was filed in 2020 and does not expire until 2035. This means the patent will last for 15 years effectively and in so doing anyone who wants to make something like the Nemesis System will have to either wait until the patent expires or work directly under WB.

The fact that the trend is showing up in two different companies, one of which resides in North America, leads me to believe that what will actually happen is that patents on genre-defining mechanics will be taken on a first come first served basis and whoever patents the largest number of total genres wins the lion's share of the profits. Then any other big company that wants to make a competitor will need to work with the patent owner, effectively turning the competition into a partnership, only sort of worse because if Capcom were to copyright 2D Fighting game mechanics like I suggested earlier and Namco Bandai wanted to use some of those mechanics in Tekken or Soul Calibur, they would have to work with Capcom specifically to use the ideas filed under the patent which may come with a stipulation that Namco Bandai will be responsible for all their own funding but the patent owner still receives a cut of the profits.

This means that technically Tekken is still allowed to exist. But under this hypothetical scenario choosing to buy another product instead of the patent owner's won't really solve anything because that game will still need to offer some benefit to the patent owner in order to get made. So if you purchase Tekken 9 specifically as a middle finger to Capcom instead of purchasing Street Fighter 7 let's say, the patent dictates that Tekken 9 requires the business deal and if it is the listed above, Street Fighter 7 could receive absolutely no notable sales figures beyond the basic Street Fighter fandom but everyone who went on to purchase Tekken 9 will be helping Capcom indirectly via this business deal.

Under this dystopia where you can only use patented mechanics under the umbrella of the patent owner, it'll create a situation where there's no real competition and the rich will continue to get richer while everyone outside the industry will barely be able to get their foot in the door if they could. This has huge ramifications for the destruction of competition and competition is essentially what the free market thrives on.

The only remaining saving grace I can think of is that once a patent has been approved, it cannot be filed a second time, cannot be renewed, and cannot have its expiration date extended. This may result in a potential future where, after enough time passes, every idea has been successfully patented, the patents expire, and now everyone can use those ideas freely again. If the extent of the time waiting for any given patent is 20 years at most, and the vast majority of those patents are filed more or less within the same year, that means 20 years out all those mechanics will be freely usable by then.

The problem with this is that 20 years is a long time and the damage to the industry will be completely done by that point. The industry will either be fully taken over by a small set of mega-corporations or it'll just have dissolved entirely before then. Considering a lot of other stuff going on right now, I can't imagine the industry will last that long but who can even really say. This is also dependent on the idea that everything I said is true, and even if it is, the people who have all the buying power could just lobby to change the laws such that patents can be renewed, extended, and refiled a potentially infinite number of times, effectively meaning there will be no solution.

So what can be done? Well, first I think it's important to educate everyone you can on Patent Law. This is absolutely serious and while I'm mainly talking about video games, this could go on to affect other industries too. So the more everyone knows the better.

Secondly, we need to figure out a way to do something about Patent Law itself. The reason Patent Law initially existed was to allow small independents who had not a lot of connections but a lot of big ideas the opportunity to exist within a competition-free zone for about 6 months to 2 years normally. That way, when the patent expired, they'd be ready to take on the competition, almost like they spent that time training to put it into anime and game terms. Because of this, companies like WB and Nintendo, who are at the top of their respective industries, and in some cases more, shouldn't be allowed to file patents at all, and a patent that lasts for 15 years is just excessive. Even the smallest creator doesn't need that much time, certainly not a group that's already as profitable as these two.

I am 100% in favor of preventing Patents from being used by bigger corporations and the only way to stop that would be to make it so that Patents cannot be filed by entities that make beyond a certain amount of income per year or who work as part of a company that has too many employees. Keep in mind, I'm not looking at abolishing copyright or neutering it. I'm fine with big companies owning their intellectual properties so long as competition is allowed to thrive. Copyright gives you ownership of your work but still allows competition, Patent specifically eliminates competition which makes it much more severe.

If we can't find a way to revise Patent law to remove big businesses from its eligibility I'd be happy just removing patents entirely from protections on intellectual property. It'll make breaking into certain industries tougher for independents. However, having independents have a harder time competing is infinitely better than not allowing them to compete at all.

Finally, I would find a way to discourage people from purchasing games and playing them on Nintendo's platforms for the foreseeable future. It may take a hot minute but if working with Nintendo is stopped long enough for either the patents to expire or to get Nintendo liquidated, then that might be enough. The problem here is that Nintendo is not the only party that is an offender and others like WB don't have a centralized location that you can just boycott entirely.

So I'm hoping everyone who reads this spreads it around and raises awareness about what ramifications this could have going into the future.

That's all for today. Have a good night.

Tuesday, June 6, 2023

After-Thoughts: Erased, A Murder Mystery, Yes or No?

 Erased: The Town Without Me, is a manga about a struggling artist by the name of Satoru Fujinuma. He has the ability to rewind back in time whenever a death is about to occur so that he can go in and stop it. Almost immediately after establishing and defining this power of his, his mother is killed and his ability named Revival initiates to save her life. The catch is that it doesn't rewind by only around a minute like it normally does. Instead it takes him back 20 years to a time in his life where 3 of his classmates mysteriously died and his mother was investigating the cause. His path is clear: stop the murders and save his mother's life.

Although every version of this story has differences in terms of how they approach the subject matter they all go with more or less this conceit. Satoru goes back in time to save his mother by stopping the murderer who does it. Now, notice my word choice there. I didn't say he REVEALS the killer, I said he STOPS the killer.

This is an important distinction because it plays into how many people view Erased as an anime. For context, I was watching a video by Gigguk on his second channel which you can watch right here under the name Garnt (I'm certain he'll get the monetization. If he doesn't, sorry Gigguk, this is the first time I've ever embedded a video).



At the 7:25 mark in the video he mentions Erased and has some criticisms of its placement on this particular Top 30 list, most of which have to do with his assessment that Erased is, in fact, a murder mystery. He surmises that when it comes to a murder mystery, the payoff of who the murderer is is just as important as the journey and concludes that because the ending was utter garbage, it's not an anime that deserves a spot on this list.

Now I'm not here to criticize either Gigguk or Kotaku because frankly that's not what this is about. What I'm here to do is answer the question of, is Erased: The Town Without Me a murder mystery series? That's what I'm here to answer.

In order to answer this question, though, we need to define what a genre is. This is probably basic stuff everyone knows but to summarize, a genre is a category of fiction that is descriptive of what you're likely to find in it. Now this can be just about anything by itself, after all by this definition Higurashi Kai can be referred to as an action series just because the last episode has a fight scene in it. However, usually genre tags refer to tropes that are common within the genre that are also contained within the given work. Because of that, for Higurashi Kai to be considered an action series, it can't just have one fight scene. Its plot needs to revolve around the fight scenes, so much so that the writing structure has to do a lot more with facilitating and communicating fight scenes than it does with almost any other facet of the plot.

So then, now that we know what a genre is, what are the general tropes that come with the murder mystery genre? Well, murder mysteries, also known as whodunnits by those that are ultra fans of the genre, are all about solving the mystery of who killed this person and how. This means that plot beats are usually built around the facilitation of solving the mystery.

Now, there are a few things to keep in mind about murder mysteries, such as the Ten Commandment of Murder Mysteries. As listed here: 



Now obviously not all of these commandments are going to be followed all the time but I do want to address a few of them since a few have become commonplace associations with the genre as a whole. Specifically the mentioning of someone early on in the story who could've done it.

Now, in theory, it could simply be a matter of someone being mentioned by name and having their face in an obscure location and that would qualify but in practice this person usually comes as part of a set, specifically the set of suspects. Making the murderer one of the suspects not only gives a clear reason to believe any of these people could do it but by consolidating all of the potential answers into this pool of people, you've effectively made the game multiple choice. So if a suspect pool has 4 people, that means you have a 1 in 4 of chance of guessing it right randomly, assuming one of those suspects isn't killed part way through the mystery, and even then that doesn't exclude the possibility of multiple culprits.

The rest of the commandments are just generally good practice when it comes to writing since murder mysteries are all about the plot consistency and more specifically the viewer's ability to put the mystery together before the final reveal. As a result you can think of a murder mystery almost like a game, and solving the mystery before you're given the answer is the goal.

If this were a game, it would be most similar to a puzzle game and to solve a puzzle you need two primary things: first, is you need a tool to solve the mystery with and you need a process with which to use that tool. So obviously the process is putting clues together to map out a general timeline of events. Meanwhile, the tool you'll use are the clues you're given throughout the way. If we were real life detectives we'd have to search for that stuff ourselves but because fiction is performative in nature, a mystery series will usually and necessarily place focus on anything that is supposed to be a clue. There's no such thing as an accident when it comes to fiction and this is especially true of animation. Because of this if the writer or cameraman is focusing on something, it's something they want you to notice.

One of these clues is obviously the suspect list, which is a group of people that could've committed the murder, either because they had a reason to do so or because their presence in the mystery fits the timeline of events as far as cause and time of death are concerned. In this way, the suspects require MMO, which stands for Means, Motive, and Opportunity. Or in other words, how they did it, why they did it, and whether or not they could've possibly done it.

The crime scene will also have clues of its own, such as blood trails, indications of the weapon used, items on the person that are present and/or suspiciously absent. Anything that could provide a hint as to what happened without outright revealing it by itself.

Dying messages can also be used as long as they're used carefully. For a dying message in a story like this to be believable it needs to be just ciphered enough that the murderer doesn't see it as a clue, otherwise they'll just get rid of it, but not so indecipherable that the person it's intended for can't code break it. This sort of thing will obviously depend a lot on the situation and the characters involved so there's no one size fits all right way to do it.

And finally, while the commandments do list that the detective can't have been the one to do it, and this is absolutely something all mystery works should do there is some leeway for characters to believe they did it.

So with all of this in mind, do I believe Erased: The Town Without Me is in fact a murder mystery? Frankly, no. And when I say it's not a murder mystery, I don't mean it's automatically good or bad just because it is or isn't one, I'm saying it's not written the way a murder mystery is generally written. Even bad murder mysteries will contain many of the tropes that I've listed yet all of them are seemingly absent in the story of Erased.

Let's start with the plot structure, I won't cover everything but I will bring particular focus to Satoru's actions during this series in both the anime and manga because his actions as the protagonist are crucial to understanding the lens this series was written from. I won't be consulting the live action series just because, while I'm sure it has its merits, I haven't watched it. So let's take note of some of the things that occur, starting with the first episode of the anime, which will approximately be around the first 4 chapters of the manga.

You see a few things of note about Satoru's actions: the very first thing we see of him in this anime is his Revival being used as a means to save the lives of various people from a truck driver who passed out at the wheel. Satoru himself took some injuries but everyone else is more or less unharmed as a result of this. In the anime we get one more event like this prior to the main catalyst at a shopping center, where Satoru goes back in time and has to identify not only who's about to be killed but also where in the area it's happening.

Now in the manga, this event actually takes a little bit longer. Namely that in the anime Satoru rewinds one time before asking for help from his mother who is present for this excursion. In the manga, he rewinds around 10 or 15 times unsuccessfully before his mother helps him after noticing the desperation on his face. In both versions it's revealed to be a kid with a balloon who was in the process of being kidnapped.

Another thing the manga has during this event which is not present in the anime is an outing with Satoru's currently established closest friend Airi, who helps him save a child who's suspiciously looming around a condemned building. In the manga it's supposed to be the same person setting this up to try and figure out how his plans are being foiled, which inevitably leads into the next event that results in Satoru's biggest Revival which is his mother's death.

Before we get to that though one thing I'd like to highlight here is that Sachiko Fujinuma, who is Satoru's mother started thinking about things that will become relevant to the later parts of this plot, specifically that there were some murders 20 years ago that involved at least one suspect who looked suspiciously like the guy committing the kidnapping. She also notes that he noticed her spot him, which is why he goes to Satoru's house in the first place. He doesn't kill her right away though.

Rather he waits for Satoru to leave the house angrily after the two of them fight. In the anime it's nothing more than a shouting match but in the manga Satoru breaks one of the windows in his own apartment which is a pretty good use of circumstantial evidence to commit a framing for a murder. Satoru then comes home to his mother having been killed and he has to escape, yes, but he also goes through his biggest revival yet, which takes him back to when he was 9 years old and he has to stop the murders that took place at his old school.

A few things of note are brought up during this following sequence. Firstly, that Satoru is trying as hard as possible to blend in and ironically him failing to blend in is in itself blending in. The other thing though is that Satoru uses his knowledge of the present to help him form a mental model of what's going on in this current past. Namely that the three victims, Kayo Hinazuki, Hiromi Sugita, and Aya Nakanishi are the victims and it's Satoru's goal to prevent their murders. And at least at first, the situation seems fair enough. Two of the victims go to his school, one of them is part of his friend group, and the one convicted at the time Jun Shiratori AKA Yuuki is close with Satoru which will allow him to gather at least that alibi.

However, on his first go around he's not successful, not in the way he'd like anyway. He didn't manage to save Kayo that time, what he did manage to do was delay her death by about 3 days, which in turn showed up as a modification to his present when he went back there. This was enough to prove that the past can be altered and Satoru gives it a real college try on his next attempt.

From here Satoru's actions are placed on two priorities: the first is getting Kayo away from her abusive mother as her mother's negligence is likely what resulted in her being targeted in the first place, not helped by the fact that she's abusive in her own rite. And the second, is to make sure that Hiromi never goes home alone thereby creating a deterrent that can buy Satoru some time until he can fully rescue Kayo and move onto Aya.

Along the way he ends up working alongside a boy named Kenya, who if you guys thought he was a smart kid, yes he is, in fact he's smart enough that in the altered present, as well as I assume the prior he successfully became a lawyer. And since I've seen the criticism that these kids are too smart to be kids, I want to argue that the only particularly smart one is actually Kenya himself. Satoru doesn't count due to the fact that he has a 29 year old's brain and everyone else is more or less average for kids their age. They're just following Satoru's lead and doing what kids do for the most part.

Anyway, this process consists of putting Kayo in a place where neither her mother nor the murderer can find her until the authorities get involved, after which Kayo is basically home free. This process mostly consists of creating a space that can keep Kayo warm in the snow and entertained while she's not in school so that hiding isn't so unbearable.

Now if any of you are about to ask "When am I going to start bringing up the clues Satoru uses to solve the mystery?" that's just it. Clues are never really presented. We do have musical and visual cues on a particular person that indicate they may be the culprit but no real emphasis is placed on solving the mystery in question.

Now I'm not saying I'm a particularly good writer, however, if I were a mystery writer and I was working with this premise, I would make the jumps between the past and present a lot more frequent. More specifically, I'd create more situations for Satoru to be in the present to help make sense of clues he finds in the past. This story doesn't really do that.

This story doesn't really highlight clues as much as it exposition dumps retrospective information as Satoru learns it, and the present is mostly used for the sake of drama following his mother's murder. No real time is spent gathering evidence, and we're never explicitly given a list of suspects. And it's not as though the series never had an opportunity to.

Without changing the narrative at all, Satoru after coming back to the present before his final revival, is given access to the old records that his mother and her coworker had gathered on those old murders. We are technically given a list of suspects in that around 6 names flash across the screen but the presentation is off when compared to the murder mystery genre. Namely that the 6 names we're given do not belong to any character we physically see in the setting. All of these names are faceless. And secondly, the person who actually did it that Satoru recognizes on a more detailed page is not shown to us the viewer until the murderer reveals himself to Satoru.

So we're never really given a predefined group of suspects that have anything to do with the plot and the one that is on the list that we know is listed as a pseudonym except for his profile page, which we never see in full and the vital parts that Satoru saw are not revealed until much later. An actual whodunnit series would've given each of these suspects a face, a reasonable combination of MMO, and some time interacting with Satoru so that we can put the pieces together as he does.

Instead the plot plays out more like a game of cat and mouse where the murderer is always present but never visible, and the characters have to outsmart him, not by figuring out his entire plan but simply by predicting his next move.

In fact, I want to go back to episode 1 as that actually has a directly comparable moment in a series that categorically is a whodunnit, regardless of whether or not it's actually good at it (Hint: it is, sometimes). That being Danganronpa. I'll give some vital information on the very first mystery of the series only because it's directly relevant.

Makoto Naegi is a boy who got recruited for the prestigious Hope's Peak Academy as one of 5 students who won the lottery to get in. Hope's Peak is a school filled primarily with supernaturally prodigious students each with their own special talents. Makoto, being one of the five that got in via the lottery, is considered having a talent for Luck, which according to this school is measurable and possible to study which is why they do the lottery in the first place.

Fast forward a little bit to the first death, Sayaka Maizono. After spending the majority of the first chapter bonding to Makoto, she ends up dying in his dorm room due to the fact that they chose to swap rooms the prior night. Makoto is naturally the prime suspect and that means that much of the tension in this first chapter is based not only on solving the mystery but also on clearing Makoto's name. Sound familiar?

Right away, we're given a mystery that starts off in a very similar way to how Satoru is implicated for the death of his mother. Yet this event plays out very differently. Firstly, Makoto ends up getting the help of the girl named Kyoko Kirigiri who, at this time, does not know her talent or even her backstory but she appears to be amicable at least. Rather than jump to the conclusion that Makoto killed Sayaka like everyone else did, Kyoko approaches him more inquisitively than anything. She's calm and rational, she mostly just makes observations and she asks Makoto questions that illuminate more of the situation.

During this event, two particular things are made note of: first off, the nameplates on Makoto and Sayaka's doors were swapped, meaning that whoever did it seemingly wanted people to think that Sayaka was killed in the wrong room. Very suspicious for someone to do who randomly attacked but not so much for someone attempting to frame another person, if they intended to swap them back that is.

The other thing that's noted is that Makoto's bathroom has a doorknob that is a little tricky to open and is prone to jamming. This is important to note because Monokuma establishes that the girl's dorms have locks on the restrooms but the boy's dorms do not. Meaning someone who was lured into the room could be convinced that it's a girl's room without suspicion being cast upon them.

In other words, these clues suggest that Sayaka wasn't a victim of a premeditated murder as much as she was a victim of her own plan. She intended to kill someone in Makoto's room, then swap the nameplates and frame Makoto for the murder and it just ended up not working out for her.

I won't spoil the rest of the mystery just because the answer is literally written out by the deceased but if you want to know, the hint is 11037.

Anyway, notice how the plot is written in such a way that Makoto is implicated for Sayaka's murder but emphasis is placed on gathering clues and crafting alibis that can both solve the mystery and clear Makoto's name in the process.

Compare this to Satoru and while his event does play out very differently, the way in which it is different is not conducive to either solving the mystery or clearing his name. Instead after his mother is killed, he spends the bulk of his time in the present running away from the cops and trying to gather information on old records when he has some free time. None of this is spent clearing Satoru's name but what's even more indicative of this is that a mystery solving plot could have been written around this idea using only the pieces the series itself presents to us. Specifically Satoru has a time that he was out and about during the murder and he has a friendly character, namely Airi, who'd go to bat for him in the event he needed it. All this sequence would've had to do is just have Satoru run into Airi and chat with her for a few minutes before he gets back to his mother's corpse. Then the police can take him in, he tells them who he spoke to, she corroborates his story, and then Satoru is let go for the most part but is only given information on the downlow via Sachiko's old connections and with some extra advantages due to his ability to travel back in time.

In addition, Revival is another element that's not conducive to a mystery series. Not so much the fact that he can go back and forth in time in the first place but how little control Satoru actually has over it. In a proper mystery series, Satoru may not have complete control over this ability but he'd certain have enough control that solving a mystery in both the past and present would be easily feasible. This is something that other series have done and continue to do and yet the fact that Revival is a power that not only activates only as necessary but also only takes Satoru far back enough to prevent a particular killing, makes it an element of chaos, one that Satoru cannot control. It induces randomness into the equation and as a result it sparks drama, suspense.

All of these things are what lead me to believe that this is a suspense show. After Satoru goes back in time, there's quite a lot of calm. However, that calm is spent enjoying the quiet moments Satoru now appreciates with his mother rather than contemplating everything that happened and how to piece it together. The actual murder prevention is spent more on preventing acts as they happen rather than figuring out the nature of the culprit to catch them in the act. In fact, once the timeline starts deviating too much, Satoru loses his edge and makes mistakes, attempting to prevent a kidnapping on Misato Yanagihara whose kidnapping is bait to lure Satoru out to allow the culprit to take him out of the equation.

A murder mystery can be thought of as a game of cat and mouse in a sense but usually the culprit is the mouse and the detective is the cat. The culprit's already committed the crime now they need to make sure they get away with it. Meanwhile, the detective is the one on the prowl, searching for tracks, he's on the hunt. Yet the way Erased plays out is the opposite. Satoru is saving the mice while living among them but the culprit is the cat, the hunter.

This dynamic is pretty much inverted from what you'd expect of a typical murder mystery dynamic which I'm sure can work but there are so many other things that don't align with the tropes of a murder mystery that I simply can't call it one.

Now I'm not blind to the anime's flaws in particular. Its final two episodes in particular were rushed out the door with some first draft writing that never took place in the manga which is why the live action series was made in the first place, to give people the ending that they wanted. However, the major distinction here between a suspense series and a mystery series is that with a mystery, yes, the destination is paramount. With a suspense series, the journey is a lot more important. The destination isn't completely irrelevant, it's definitely possible to be taken out by the final reveal of what's been going on, it's something even this series could be seen as guilty of. However, the process of finding out who the culprit is for a murder mystery is the journey and having all the pieces come together is the destination. For a suspense series, the journey is escaping a threat and the successful evasion or erasure of that threat is the destination.

Now I don't personally want to watch Erased ever again after having fully finished the manga. However, if you haven't seen it yet, I highly recommend you do so. It does cut some minor stuff out of the beginning. However, episodes 1-9 are in a lot of ways a better telling of the narrative than the manga. Once you've reached episode 9, I highly recommend jumping over into the manga to pick up where that episode left off as it includes a lot of things that give context to not only the anime but to the major players of the series in general, such as the culprit's full backstory that elaborates on how he became a serial killer, Kenya's history that leads him to want to become a lawyer in the first place, and even some weird predestination shenanigans with Airi getting involved in these final chapters.

As for why I'm talking about this, it's mainly because I thought this debate on whether Erased is a mystery or suspense show or both or neither was settled a long time ago but I guess it wasn't. I also didn't message Gigguk directly because he and I don't really know each other and I don't think he'd respond to my messages anyway. And leaving a comment this long on a video that's not even primarily about Erased does seem a bit too passionate for a youtube comment. Not for a blog post though. Unlimited characters baby.

Anyway that's all for now. Have a wonderful evening.

Monday, April 10, 2023

Pre-Emptive Thoughts: RWBY Volume 9 Onward

 I did not think I was going to jump back onto this train. Oh well, let's talk I guess. I finally continued past the part of Volume 7 that I got hung up on and decided to keep trucking along and I'm now at the most recent episode which, if I'm correct, at the time I write this is RWBY Volume 9 Episode 8. If I'm wrong, well, you'll probably be past that once you look this up anyway.

RWBY Volume 9 is a bit of an improvement over prior Volumes. It has a bit of a tonal clash but that's the premise. These girls from a pre-apocalyptic world come to what is their world's version of Alice in Wonderland, known in the series itself as The Girl That Fell Through The World. And we've been given enough to chew on that I decided to create a few speculations about what's going on. I'll be referencing information from Volumes 8 and 9 primarily as that's where this stuff is most relevant but I won't be discussing anything past Episode 8 of Volume 9 as it's not out currently. So think of this as a theory-craft post.

What am I theorizing about though? Well, specifically what is the deal with The Girl That Fell Through The World and what impact will it have on the story going forward? So I'll summarize the Fairytale a little bit then get into my logic before I pull in evidence.

The story goes that Alyx is a young girl who finds her way into Ever-After via a hole in the ground and begins going through some trials and tribulations to get back home. These include purchasing an item from the Jinxer's Auction, playing a game with the Red King, the Curious Cat helps out in exchange for receiving information, and Alyx ends up finding her way home somehow.

However, as the story progresses we find a few things are amiss. Firstly, several characters in Ever-After appear to somehow recognize the human species but don't quite understand it enough to put a finger on it. Characters from the tale do appear but either older or in an altered shape, with the Jinxer being older than depicted in the Fairy Tale, the Red King now apparently being the Red Prince and the figure of the Rust Knight being a much older version of Jaune Ark.

Once this final bit is revealed, Jaune gives an explanation as to what he knows. Specifically that the events in the Fairy Tale do occur, the problem is what's not recalled. Specifically that Alyx wasn't alone, she had a brother who came along by the name of Lewis. The events of the Fairy Tale did occur but a lot of things happened that the Fairy Tale didn't mention. Toward the end of Jaune's recollection he notes that the poison Alyx was supposed to drink was given to him and the Curious Cat took her and Lewis to the Great Tree. However, while both went, only Alyx is recalled in the Fairy Tale, Lewis was never mentioned in Remnant nor ever rediscovered in the Ever-After by Jaune.

So what's going on here. Well, I have three total possibilities, all of which have holes in them currently but I'll lay out the ground work and present evidence for each. Starting with what I think may be the least likely of the three.

A Time Loop

Okay so during the events of Volume 8, things kind of hit the fan and the World of Remnant is left at a stalemate between Osma and Salem. Salem now has 2 of the Relics which means she's getting ever closer to achieving her goal. She's immortal so she has time to recover but she's lost quite a bit in this last battle. Her primary fortress was destroyed, two of her top men, Watts and Hazel were killed during the struggle, and Salem doesn't have a real way yet to get the other two relics. She doesn't know where the Haven Relic is and she doesn't know where the Summer Maiden is. Salem's forces have been heavily crippled.

In addition to that, Ozpin is finally back in action and the remains of Team ORNJ have the Winter Maiden in the form of Winter Schnee. Winter proved that she was strong enough to fight against Cinder in 1-v-1 Combat and Raven Branwen, the Spring Maiden, proved to be equally capable of that in Volume 5. If Ozpin or Qrow can somehow convince her to either join the fight or stay in hiding, this gives Ozpin a chance to recover the two lost Relics and start over. Salem may have all the time in the world but so does Ozpin and by extension Oscar. In addition Ozpin's Forces are in much better shape than they were when they had to deal with Ironwood now that he's earned the trust of the people back AND gotten a Maiden on his side. Even if the battle simply devolves into Osma and Winter vs Salem and Cinder, the odds could go in either of their favors in that outcome. Since killing either Winter or Cinder would cause a reset on the Maiden power causing it to go to someone else at random. The worst case scenario would be for both Maiden powers to go to Salem but she may be exempt on the basis of Age and Immortality.

In the midst of all this though a single line is uttered. The timeline has shifted. Somehow these characters knew what was going to happen enough to comment on timeline alteration and what's more several characters state this. Cinder, Ironwood, and Ozpin. Cinder and Ironwood are one thing but Ozpin is a very particular figure to be talking about timelines. Very strange that he'd bring that up.

We know time manipulation is possible in the series has Time Dilation Dust is possible early on in the series and the beginning of Jaune's story in Volume 9 features time rewinding so we know the flow of time is non-linear and can be manipulated to some extent. So how does this pertain to The Girl That Fell Through The World?

Well, this theory posits that the version The Girl That Fell Through The World that the characters read about did happen exactly as written but the version Jaune experienced is not. All you'd need to believe this is Multiverse theory. Assume the only things that need to change are that one version has Lewis come with Alyx into Ever-After, and one in which he does not. After this, deviations can occur. This would explain why the occurrences are similar but different. It's why some events would not be recalled as they didn't happen and it may also explain why Alyx behaves differently in one story than the other.

The reason I think this theory is the least likely of the three is a few fold. First off, it's relying a lot on a single line that, at this time, is a setup with no payoff. Multiverse theory is something like dream theory in the sense that it can explain almost any discrepancy in narration or character profiles. However, we do not know enough to assume that it's what it's operating on.

Likewise, this theory doesn't explain how Alyx got out of the Ever-After in the first place. Sacrificing Lewis in exchange for Alyx's exit is Jaune's working theory but for the theory I'm positing to work, we have to assume there's another method of escape, one that doesn't require Lewis to even exist. And if Jaune's right that the Tree is a version of Death, it isn't a method of escape at all. If all it does it remake someone with new memories or a different personality, it couldn't have been the method of escape if that's all that's going on. There's still a lot the character's don't know about this world but it's functions have been fairly consistent as far as what's been presented thus far, namely that everything has a specific rule that it follow unilaterally. It is only beholden to that one rule but it is completely beholden to that one rule. Once you know the rule, everything else falls into place. So for the Tree to have a function that operates outside its own rule doesn't add up.

In addition, if Alyx had a brother that just didn't go with her, why wouldn't she reference him? Sure Multiverse theory could explain that by just saying that her brother either never existed in that timeline or died before being relevant to her life but that seems like a huge copout for such an important twist. Some writers may take that route but I doubt RoosterTeeth has the guts. Considering the pandering they get up to in this Volume, they'll only take pre-approved risks and introducing an element that potentially changes the entire status quo is not one of them.

Alyx is Not JUST Alyx

So let's entertain Jaune's theory for a moment, that Alyx sacrificed Lewis in exchange for her own escape. How might that've worked? Well, if we assume that the tree takes you back to your birthplace for some reason after it reshapes you and Lewis bypasses the clean slate by having his memories sacrificed for hers, what may have happened is that Lewis and Alyx did indeed escape together but not in the way that implies. Not as two people on a journey, but as one person entirely.

If the two of them somehow merged into one person, this would fit inline with elements of the series up to this point. Alyx would call herself Alyx because she's the dominant personality but her memories would mix with Lewis'. Events that require them both to be present would be forgotten as a contradiction she couldn't reconcile and any memories that one could experience without the other would be remembered not as Alyx or Lewis but as herself. After all, when you have a memory, do you remember yourself by your own name or do you remember yourself as you? If Alyx and Lewis merged, the memories they each had would not be Alyx's and Mine or Mine and Lewis', they would just be Mine. Any memories that have no contradictions would be kept and the ones that do would be forgotten as misrememberings or imagination.

Narratively this would make Jaune a more trustworthy narrator since Volume 9 doesn't appear to have one right now and it would explain why some memories are kept out of view of the Fairy Tale. Alyx herself doesn't remember them so her story wouldn't recount them.

I think this is the second most likely because it's inline with elements from the series thus far. People reincarnating or two merging into one has been a thing for a while and if the tree wipes the slate clean and grants a new purpose, this would fall in line. Substituting Lewis' personality and memories as the cost for Alyx' would be a weird exception but it could hold and since nobody's ever done it before, nobody knows quite how it works, nor does anybody who would currently still exist.

This still doesn't explain everything though. For example, if the Tree does kill and reshape, how does that translate into Alyx going back home? So far nothing about what we know about the tree mentions reincarnation and while it is a possibility, it's still a stretch. In addition, it's worth pointing out that several of the Fairy tales in the setting we've been given have been relatively accurate such as the Maidens of the 4 Seasons and the Gods of Creation and Destruction. These ones are proven to be canon and while Qrow did say in Volume 4 that some are real and some are made up, this one seems to be an outlier in that it's somewhat true but pieces are missing. Context is always going to be missing from historical accounts to an extent but with fairytales in this series, no, certainly not enough to create a brand new version of events.

This theory still requires us to make a lot of assumptions about how this world works and what is true and false. But as I wrote this, I came up with one more theory that may just be plausible.

Alyx was a Maiden

Okay, let's work our way backward now. What do we know about Alyx really? Well, we know that her recounting of events from the fairy tale is not 100% how Jaune recounts it and we know her personality doesn't 100% match up with how she's depicted in it. We know she's a young lady and one who was desperate to leave Ever-After. We know that she lost trust in her brother and Jaune over time and poisoned them to allow her to get back home.

Now we can assume the Herbalist may have had something to do with this since it's not referenced in the Fairy Tale but the Herbalist seems to offers tests of character and resolve that can be passed but also failed. We see this earlier in this very season where Blake, Yang, and Weiss managed to individuate and become whole but Ruby just ended up breaking down further to the point where Neo was fully capable of convincing Ruby to commit suicide via the Tree. Now as of Episode 8 we don't know fully what this means. However, the Herbalist seems to have played a part in Alyx' change in personality.

However, when Alyx took Lewis up to the Tree, we don't know what happened. We'll likely find out but if Jaune is right that Lewis died, how did Alyx survive? Well, let's take a look at her gender and age, specifically the fact that she fits the criteria to be able to potentially have been one of the four Maidens.

The Maidens have a very specifics set of rules they abide by in terms of how a girl becomes one: that being that the prior maiden will transfer the power to whoever they think of at the time of their death. The exception is if they think of a boy or an elderly woman. If they do that, the maiden's power is tranferred to a young woman at random.

If we assume she was a maiden, the Tree ending her life would result in her spirit reincarnating back in Remnant. Afterall, her power would go to a human woman, and at that time none were in the Ever-After. If she didn't know she was a maiden but it was revealed to her via the Herbalist, this would be what made her so confident that the Tree could take her back home in some capacity. It would explain why she may not trust Jaune, and her taking Lewis with her may have been her attempting to save him and it not working.

Now this would require some logical leaps to make but the way the Herbalist's hallucinations work seem to be very specific. All four of Team RWBY were not confronted with fears, or doubts, or things like that. They were confronted with their younger selves. Rub, Weiss, Blake, and Yang all resolved their issues with past versions of themselves, not different people. This would be different if Alyx were a maiden, though. Since a past life and a younger self would be almost interchangeable for her, and it's also been documented that the Maidens don't necessarily know they are one right away this being how it's revealed would naturally cause something of a change of heart. It would be a drastic reaction, sure, but drastic too is the realization that you are simply one in a long line of lives lived by one soul.

It would explain almost everything. Why Lewis wouldn't be recalled in the fairy tale, why Alyx would be the only one to successfully make it back, why she'd be certain that the tree would work in the first place, why she wouldn't have information that Jaune is privvy to, how the tree that kills or rewrites memories could be an out for Alyx while still being nothing more than a death entity,

Of course, this still leaves a problem. Even if we ignore the Time Dilation as a gimmick to turn Jaune into a fairy tale character there's still what happens at the end of Episode 8 to consider. Namely that Ruby decides to be taken by the Tree. During Episode 8 Ruby has had all she can stand and has left on her own. She comes face to face with Neopolitan who uses this as an opportunity to work with the Curious Cat to break Ruby down to the point that she doesn't want to live anymore. She says she doesn't want to be her and that she thinks the world would be better off without her.

Now, obviously, no one in the actual story believes that. Neo was simply trying to break Ruby to have her revenge over Torchwick. The problem is that Ruby decided to drink the drink and has been absorbed into the Tree. The thing is, this is only Episode 8 of an entire volume and while ending a series this popular via the main character's suicide is a gutsy move, again I don't believe RoosterTeeth are the kind to take any risks that are not preapproved. So I don't think Ruby is actually dead or going to die. However, if my assumption is correct, that means nearly every other assumption that was made about the Tree and Alyx may be wrong.

It's possible the Tree may have an innate property of reincarnation upon the Ascension process. It's possible that the time dilation will occur in the sense that Ruby herself will be sent back in time to before all this occurred but with some, if not all, of her memories intact. It's possible her Silver Eye quality may come with a reincarnation trait similar to the Maidens.

It's possible the real answer is some combination of these three or even that bits and pieces of each theory is true but the real answer is more complicated and requires more pieces. It's possible more pieces will show up in Volume 10 after Volume 9 is over since we've got around 4 episodes lefts of this one season. However, I thought I'd vomit my thoughts onto a post yet again after I apparently got a content warning on one of my posts that Google didn't want to tell me which one. So I thought let's test them again with another content warning. For all I know my blog may be deleted after this, who knows for certain?

Have a wonderful night and I'll see you next time.

Saturday, March 4, 2023

After-Thoughts: Optimization Do's and Don'ts in Game Programming

 Okay so let's say you're someone who's interested in Game Design. You have the best idea in the world that you think will make a lot of money while also making a lot of players very happy. Now all you need to do is select your tools and begin building. But you notice a few problems. Specifically that your optimization isn't going well. What do you do? Well, here are some tips.

Naturally this is going to be a long one but I hope you guys find it interesting.

So let's start with some basics. What you should actually do while you're in your Engine of choice. I'm going to make this generalized so that you can follow along with pretty much any Engine you're using but I am most familiar with Unreal Engine with some basic understanding of Unity so keep that in mind.

Use Tick/Update Sparingly

This function has a different name depending on what Engine you're using, in UE4 and 5 it's called Tick, in Unity it's called Update but regardless of what it's called, I think most Engines have some variation of this. That being a function or module that is called every frame. Now most engines are Object Oriented and this means that each individual piece of code you build can be divided into their own separate Module or Function. For those who don't know the difference, a Function is something that returns a value, usually one that can be plugged into a variable whereas a Module is just something that performs instructions. Think of it like in Java where you have functions that start with a variable type like an int or a bool, and then you have functions that start with void. Voids are the only functions in Java that don't return anything but they still do stuff. That's essentially the difference between a function and a module on a general level.

This can have several benefits, such as building your code in pieces so that if one of them isn't working correctly, all you need to do is fix the broken piece or the broken interaction rather than scouring the entire program for what is and is not working, although you will still probably have to do that. However, the main benefit in this case is that from an optimization standpoint, you can divide up pieces of code across different modules and then the game will only call the specific modules that need to be called.

Put another way, any function that exists within a singular Actor will only be called while that actor is actually in the game world. Any functions that are specific to it will not be called if it's not there. Same applies to Level specific Code when Level Streaming in particular.

Tick or Update is very different in that while variations of it may be Object specific the function itself isn't called in specific circumstances like upon collision, upon overlap, or upon spawn, this function is called every frame. To give you an idea of how taxing this can be on your machine, if you put a piece of code onto Event Tick, it will be called every time a frame is drawn. So if your game runs at 60 FPS it'll be called 60 times per second. However, if what you have on Tick is so heavy that your machine can't handle it at 60 FPS, it'll simply reduce the framerate so that it can keep up. This is one way in which a game that should be able to handle framerates can end up falling short tremendously.

So if you want to avoid that, Step 1 is to put any code that doesn't need to be called every Frame onto an event or function that is only called when necessary. An additional step for any function that needs to be called every frame when relevant but not all the time is to place a logic gate onto that specific piece of code so that it can be disabled when it isn't relevant.

For example try having many function specific pieces of code placed into their own modules, then you can place those modules onto Tick, and then have a logic gate at the very beginning of that module check to see if it's currently relevant, and if it isn't, disable it. That way the function is still called, it just won't do anything. Which isn't the best situation to be in but it's still preferable if there's no other way around it.

Optimize Your Variable Types

Okay so this'll be in two categories but they're both the same problem. When programming in an Object Oriented manner, there is an inclination to make variables for every single function you want to use. And there are times to use variables. There may be a situation where you want to check for a state or substate so that things run as intended, especially if you have an input buffer. Putting that onto a variable that can just be checked when necessary is a good thing to have.

However, not everything needs to be a variable. For example, if you have a value that is specific to a function rather than general to an object, don't make it a variable, make it a parameter. That way the value is only checked when the function is called. Then you can set the parameter upon call using the value itself (known in programming as a literal) rather than the variable itself. Literals are very valuable in situations where you need to cut down on performance because they're just the values by themselves without storage. They're a computation that doesn't consume memory once the computation is over. The reason to use a variable is if the value needs to be stored. Parameters offer a good mix of the two.

However, let's not ignore the fact that there will be many times where the values needs to be stored. Either because it's being accessed constantly or because it's universal enough that it's better to be stored as a singular value rather than parameterized or removed from memory once computed. If it only needs to be referenced once then remove it to make space for other things. However, if it's going to be referenced constantly, it's better to keep it in memory so that you're not wasting instructions on constantly bringing it in, removing it, and so on. It's better to just keep it and let it do its thing if that's the case.

But that doesn't mean all variable types are created equally. Variable types will vary depending on the Engine but some are fairly universal. Let's go over a few very quickly.

Boolean: A boolean is usually registered as True-False value in presentation but what it actually is can be described as a single bit, a 1 and 0, on or off. It only has two states because of this. Either it's a 0, false, off, etc, or it's a 1, on, true, etc. It doesn't consume too much memory or computations because it's only the size of a single bit. It's the smallest value that can be accommodated.

Byte: Bytes are whole number values that are 8-bits large. 8-bits means that it has 8 switches that can be either on or off. In Binary Code, you could compute it as a minimum of 00000000 or a maximum of 11111111, with the first value being equal to 0 and the second value being equal to 255. Naturally due to the binary computation though, it can handle any value in between those two. With 01000000 being equal to 2, 10100000 being equal to 5 and 00000001 being equal to 128. Because every successive bit is double the max value of the previous value. I'll talk more about this in the actual tips portion.

Integer: This is a standard one as well, a 16-bit whole number. However, it's different from the Byte in one more meaningful way. That being that a Byte cannot go below zero. Any attempt to will cause overflow. Integers, however, can have negative values, meaning that the full range of the number being double the bits in theory actually has a total range of the maximum value and the negative version of that maximum value in practice. You can increase the maximum range by setting it to unsigned, which will prevent negative numbers allowing a higher cap without increasing the bit-size but that's the final meaningful distinction.

Integer-64: Not every engine accommodates this variable type but I will bring it up for comprehension's sake. An Integer-64 is almost identical to an Integer except rather than a 16-bit value it is a 64-bit value. The difference is essentially 2^64 - 2^16. Other than that, it's functionally identical to the Integer type.

Floating Point/Float: This is where things start to get a little interesting because Floats are 32-bit values but they're unique from integers in that they don't handle whole numbers exclusively. Instead, they also handle decimals. Integers will take a number like 2.5 and cut off the decimal turning it into a 2. It won't round up, it'll truncate. Now, Unreal Engine comes with a round-up function. A round up function is easy enough to build. However, decimals offer some additional utility that Integers can't provide such as framerate counting, percentage calculations, and some other things that can also be done with it. For now, let's move on.

Vector: Vectors are not a universal term but I'll use it for the sake of this. A Vector, in Unreal Engine Terms, is basically a combination of 3 float values that are used for the sake of axis calculations. Very frequently these are used as XYZ calculations with 3D Graphics but they can also be used as RGB calculations since in Texture Coordinate Terms X = R, Y = G, and Z = B.

2D Vector: 2D Vectors are very similar except rather than XYZ they only contain XY. These are universally more common in 2D applications but they are still useful for Texture mapping since an XY can also be used as UV.

4D Vector: 4D Vectors have 4 float values rather than 3. These are usually represented as WXYZ in some programs, though it's more frequently used as RGBA, with the 4th value being Opacity, very useful for Texture Maps of the PNG variety in particular.

Rotators: Rotators are also comprised of 3 float values like Vectors are but vectors are linear values which means they can be used for location and scale just fine. They don't work super well for rotation though so Rotators get their own variable type as it has its own functionality. It usually works on values between 0-359, with anything over overflowing back into 0. This is one of those cases where overflow is a good thing, though. Because if your character is going from 359 to 360 in a singular frame, naturally this means they'll go back to 0. However, you don't want them to rotate all the way back around, you just want them to go back to the starting position the very next frame.

Transform: Transform is comprised of 9 floats in theory. However, in 3D graphics processing, it's usually comprised of a Vector for Location, a Rotator for Rotation, and a Vector for Scale. Because of this it's mildly more complicated than an Array of Vectors, which I'll get to in a moment.

Arrays: Arrays are not a variable type as much as they're a variable variation. To put it simply, an array is a variable of any type that holds multiple disparate values as separate instances rather than having a singular changing value. Put another way, an Array of 9 Integers doesn't hold a single Integer, it holds 9 total separate integers together all at once. This does mean that an array of 9 integers is equal to 9 integer variables in theory. However, in practice, the benefit this offers is that all those disparate integer values are placed very close to each other so that if multiple ones are referenced together in a similar calculation, they can very easily be searched for in more or less the same space. Object Oriented Code already does this by looking within the object it applies to but nothing's stopping you from using this to localize even further.

There are other variable types, such as Characters, Strings, Text, Enumerations, etc. However, those are usually very difficult to optimize since they have very specific purposes. If you're using a Character variable, you're doing so because each individual character needs to be sortable. If you're using a string, it's usually for debugging purposes. If you're using text, it's for presentation purposes and so on.

Every other variable I listed, however, has a lot of overlap with each other so they're much easier to discern when one variable type may be preferable to use over another. So let's discuss.

Logic Gates

A logic gate is any barrier that will only use the following code based on a condition that has been met. Generally there are 3 types of conditions that one may take.

If/Else uses Boolean conditions, it checks for True and False. Switch Case uses Integers, Bytes, Strings, Characters, Enums, etc. And Loops will use Integers or Arrays.

So the question is, which logic gate do you use? Well, generally, there's going to be 1 of 2 answers for If/Else compared to Switches. If/Else only takes two outputs. A true and a false. If you only need to check for 2 outputs anyway, then you'd may as well use an If/Else to make a single check more flexible. However, if a single input needs many potential outputs, it's better to use a Switch. The reason for this is fairly simple: a lot of people will check for whether something is doable by nesting if statements. For example:

If (A == True)

    Do A

Else if (B == True)

    Do B

Else if (C == True)

     Do C

The problem with this in practice is that you're checking the condition multiple times and the checking of the condition will slow you down the more times you check.

However, if you have a Switch Case, it'll be more like:

Switch on Alpha

    Do A

    Do B

    Do C

    Do D

    Do E

In this case what's happening is it's checking the variable Alpha for whether it's equal to any of those values, and because Alpha is one variable with one value, the only one of those things it'll do is the one that is accurate to Alpha. If you want you can even add a Default Option which is what the Switch does when none of the other options are valid.

This may not look faster but it is in practice because it's only checking Alpha once. Whereas in the If/Else statements case it's checking Alpha each time to see whether it equals A then B then C then D then E. The difference is the Switch checks once, where the If/Else checked 5 times or more.

Now of course none of these will take float values. However, if you have a variable to check for multiple different states, try using a whole number variable like an Integer or a Byte so that you can run a Switch case.

As for Loops, well, I generally try to restrict Loop usage to Arrays because that consolidates how much actually needs to be done. So I'll generally use a For Each Loop and then do what needs to be done for whatever spot in the array it's currently at. I don't generally use Loops for anything that isn't specifically for an Array anymore because that can be pretty wasteful if you don't know exactly what range you're working within.

Variable Sizes

Now the thing with Object Oriented Programming is that if you're not careful, the total number of variables you're working with will rapidly go up. However, it is true that you have a minimum number of variables you need for your code to function. However, not every variable is the same size.

You see, because the benefit of a variable is that it stores values for upcoming use, a variable's actual consumption of data is not based on its current value, it's based on the maximum value it can accommodate. So if you make an Integer Variable, the total number of bits that variable uses in RAM is not equal to the number of bits used on its current value up to 16 bits. It uses exactly 16 bits. Because that Integer doesn't know if the number it needs will go up or down from where it is now at any time. As a result it's up to you as the programmer to discern whether the maximum value that variable can accommodate is entirely necessary.

Now of course, there are circumstances where you'll need negative numbers, positive numbers, whole numbers, decimals, big numbers, and small numbers. However, the thing about speed and size is that if you want to push everything close together you'll want to make those variables the same type so that they can be placed inside of an array. So what do you do? Well, for the most part there aren't too many situations where you'll need to make a choice. Obviously if something can be handled by a Boolean, you won't want to change it because that's the smallest size that a variable can get, and any benefit that an array would offer would be offset by the number of bits that array would use. So making an array of Booleans and an Array of Integers is usually going to be a better idea than just making a gigantic array of integers or Booleans. Having a smaller array of both will usually be preferable.

But what about variable types that are a lot more similar? For example, Bytes, Integers, and Integer-64's are all more or less very similar to each other. Now if you're making a Disgaea style SRPG where the numbers have to be possible to make infinite, well, that simply isn't possible but an unsigned Integer-64 is probably as close to infinite as any game would need to accommodate. However, if your maximum number count doesn't need to be that large or numbers aren't being presented to the player at all, then Integer-64's are basically 4 times the bit count without 4 times the benefit.

Alright so that just leaves Integer compared to Byte. Now, if the code is never shown to the user, that just means whether or not you need an Integer or can settle for Byte depends on how big the numbers you need will actually get. For example, if you only need to accommodate numbers 1-10 for a specific function, you don't need a negative and you don't need 16-bits worth of numbers, so a Byte can cover that just fine. If your highest value is 100 and you don't need a negative, use a Byte. If the way you've coded your game does require a negative values, see if you can modify it just slightly so that it uses only whole numbers instead. For example:

If you have a direction check, which uses Dot Products which return any number between 1 and -1, instead of using the raw value that was returned, instead perform a check of sorts. Say for example you have a forward, a back, and a neutral. If it's neutral, return 0, if it's forward, return 1, and if it's back, instead of returning -1, substitute it with a 2 instead. That way you can more easily substitute the Integer for a Byte.

However, if your code absolutely needs negative values, as in something about the way your game works simply requires negative numbers. Say for example you have a monetary sort of game where you have things that you can use to gain currency and things you can use to spend your currency on. But to simplify the code, you only want to do a + operation. This would mean that for things that grant you money, the number would have to be positive but the things that cost money would have to be negative. That way, you can set the general Benefit/Cost to a singular parameter and only have one math calculation per increment. This is a good idea in a sense.

However, instead of using an Integer for that, why not a Float?

Calculation Speeds

Now then let's talk about the difference between an Int and a Float. As I've said previously an Int is a whole number, a Float is a decimal. Ints are 16-bits, floats are 32-bits. So one would think that a float would be less preferable to an Int but that's not necessarily the case. You see, Integers, Integer-64's, and Bytes are really easy to compare to each other because they're all whole number values. However, floats have an interesting history.

You see, once upon a time back when processors were first being made, they added a math portion called the ALU. The CPU is the central processing unit which handles general instructions, and the other half is the ALU which stands for Algorithmic Logic Unit, and it handles math calculations. This includes the calculations for a decimal value such as a float. Now back in the day, the hardware that was used to handle floats was so weak that Float calculations were often very slow. So while the decimals offered benefits, it generally wasn't a high enough benefit to justify using over whole number values which could sometimes be BS'd into Percentage Calculations if Necessary by setting the Max meter to 100 and then setting the damage to a whole number value somewhere between 1-100. Or if it's an RPG with percentage calculations, simply set the meter to itself*100/percentage. I may have done the math wrong on that but the point is that in many cases where percentages were necessary the code may have BS'd it in the back end to simulate percentages but actually just calculating in increments of 100.

However, one thing that happens a lot with innovative technology that is weak but rife with potential is that manufacturers will often overcompensate on increasing its power. This happened with floating point calculations to the point where now, in the current era, decimals actually calculate faster than whole numbers. And while it is true that Floats are double the bit sizes, Bytes are 1/4th the Bit-size on ints. So if you convert as many Ints to Bytes as you do to Floats, and say we have 20 Ints for the sake of argument. That's 20*16 = 320 bits. Half of those as Bytes and half as Floats would be (10*8) + (10*32) = 80 + 320 = 400. Which is quite a large increase, I won't lie. However, consider this:

If you were using that many Ints for the sake of logic gates and other things that are used everywhere, it's possible that a majority of those ints could very easily be turned into Bytes. So if out of 20 Ints you turned certain ratios of Ints into Bytes and Floats, here's the chart of the ratio of Bytes:Floats:Bit-Counts

10:10:400 = 1/2

11:9:376 = 11/20

12:8:352 = 3/5

13:7:328 = 13/20

14:6:304 = 7/10

15:5:280 = 3/4

So all you need to do is make sure that you maintain a 7/10ths ratio of Bytes to Floats and then remove Ints entirely. There are exceptions of course. Again, if you need absurdly high numbers, use Integer-64's in place of anything else and then just simplify your gameplay and total calculations elsewhere. If you can afford to use smaller numbers though, try this and see how it works.

But that's not all with Calculation Speeds. As stated before, the fastest way to make a series of same-type variables faster is to put them all next to each other. And the way you put them all next to each other is by putting them into an array. So if you have a series of Bytes that are all separate variables, just combine them into 1 variable. If you have a series of variables that are all Bools, combine them into a Bool array. So on and so forth you get the idea. But of course, that's not where the fun stops. No, you see, you also have 5 more variable types that are essentially multiple floats put together. You have a Vector, a 2D Vector, a Rotator, a 4D Vector, AND a Transformation. This actually leads into a separate discussion. One about Structures.

A structure differs from an Array in that it is basically a variable type that is comprised of several unique variables that may do different things. A Vector is a structure that is comprised of 3 floats, a Rotator is also a Structure comprised of 3 Floats but it comes with additional code for the calculations to be Rotational Quantities rather than Scalar Quantities. A 2D Vector is a Structure comprised of 2 float values, a 4D Vector is a structure comprised of 4 float values, and a Transform is a Structure comprised of 2 Vectors and a Rotator. You may have more complex structures you may end up working with but you get the point.

The major difference between an Array and a Structure is that when you reference an array you can reference individual values as necessary. Whereas with a structure, you have to access every value within it simultaneously, even if you're only using one particular value. In theory an array and structure both comprised exclusively of floats will take up the same amount of processing power but the difference is that the only part of an array that's processed at once is the individual spot that's being used where when you use a structure the entire structure is being used. This means that while the data size might be the same in theory the calculation speed on the array is faster in practice because each individual value can be accessed independently. This is fine enough if you need every single value all at once or you're using so much of the struct that using it all at once is faster than using each individual part. However, if you only need one value currently, you'll generally prefer an array.

Which is better? Depends on context. If you need every unique value in the variable all at once, go with a struct. If you need only a singular value from it at any given time, use the array. And if you don't know which you'll need but you need most of those values more consistently than you'll only need one, then use the struct just to be safe. However, if you think you can get away with using an array because you're only using small portions of the array at once, use the array to consolidate.

I ended up having a lot more to say than I thought I would. So I'm going to split this into pieces. The next one on this subject will be about GPU programming and Graphics Optimization. So long.

Thursday, December 29, 2022

After-Thoughts Mini: Hero, a Meaningless Title (In Modern Fantasy Anime)

 I've been watching quite a few anime as of late and there's some overlap in terms of a lot of these. And no I'm not simply referring to the marketable stuff like waifu's or the Comedy genre tag that I look for specifically. It seems like every time I watch an anime that takes place in a fantasy setting the title of Hero is not a moral disposition or even something that represents a grand person who does grand deeds as a result of a grand prophecy or what have you.

To be clear not every Fantasy Anime I've watched necessarily has a "Hero" character. Obviously many series have been attempting to ask questions about the lines between heroes and villains for a long time. The Fate series, while not strictly fantasy, has many characters in the form of Heroic Spirits who are Heroes by classification but may not necessarily be a Hero in terms of a Good Moral Alignment. However, while the Fate series has Heroes that can run the gamut between good and evil, the Fate series also very rarely paints even characters squarely in the good or evil morality as strictly good or bad people. This is not the occurrence I'm referring to.

I'm also not referring to a situation where the hero is the strongest of the Human faction but is otherwise a good person anyway, like Hero Kanon from Misfit of Demon King Academy. Demon King Academy has a huge theme of humans being far more evil than they seem to believe they are yet Hero Kanon stands in stark contrast to this as not only is he the only human that Anos Voldigode viewed as a genuine friend and equal but also a human that views other humans as utter scum for how low they'll sink to accomplish a goal where Anos always proved that he would sacrifice himself for those he cares about. In this case, the human species as a whole veers toward the evil end of the moral spectrum but Kanon himself does not.

In this case what I'm referring to is the term Hero being used as a classification almost like its their Job title or race yet the characters in the Hero camp are concisely not in the Good Camp that you'd expect. There are a few examples I can cite off the top of my head but as far as I can tell the first instance I can identify comes in the form Redo of Healer. We've had evil main characters and Hero downfalls prior to this but many of those series usually make a clear moral distinction between heroes and villains.

More specifically, from a narrative point of view, Hero in Redo of Healer is a class of characters that have a few notable differences from other people in the setting but the general idea is that they do not have limits on their ability to grow and can break other people's limits through the use of sexual bodily fluids. By the way, if you're asking right now if Redo of Healer is a hentai, technically it isn't but its subject matter and presentation suggest that it may as well be.

Anyway, the Heroes are divided into multiple other sub-categories with Healer being one of them. Now, the Healer Hero ends up reversing time and getting revenge on the other heroes for the vicious deeds they committed against him but it's worth noting that the Healer isn't a good person either. He may be doing the world a favor by making people aware of how awful the heroes are but at the end of the day he's still committing and causing atrocities to get it across. He's no more a Good person than any other hero is, he just happens to be in opposition to the others.

Likewise Rising of the Shield Hero is one where Heroism seems to be separate from the moral alignment as well. I won't talk about this one too much just because I haven't seen it but a big chunk of this story's premise seems to be placed on the other heroes being scum in their own rite and Shield Hero just happens to be making something of himself separate from them. I don't know if he'd classify as Lawful Evil, Neutral Evil, or Lawful Neutral given the way he goes about things but it is clear that if he is in the good alignment, he's the only one of the heroes who is.

A, as far as I understand it, series with a similar application to Shield Hero is a recent anime called Beast Tamer in which the hero is tasked with defeating the Demon King and the Hero's party ostracizes the Beast Tamer from their group because they view him as a liability in combat and generally very weak.

Now, one of the more predictable things about this anime prior to finishing up episode 1 is that the Heroes seem to think of carrying gear and scouting the area as less of a valuable skill than it actually is. It's sort of like the first episode of Goblin Slayer where the Priestess' first party chooses not to properly prepare an invasion of a Goblin Nest because they think it'll be a piece of cake only to face a rude awakening when the Goblins are not as trivial as they expected. This is somewhat of a similar situation, Rain was carrying the gear and scouting the area which, while not solving the quests outright, definitely streamlined the process, giving them the lay of the land and also causing them to not waste so much time or energy on gathering or carrying supplies.

To be clear, Goblin Slayer is not this sort of series. Goblin Slayer very much paints its heroes in a very positive light morally, Goblin Slayer's maturity is more in the removal of the romanticizing of the Adventurer Job. Being an adventurer isn't easy, it's bloody, there are people who do it solely for the money, and even low level enemies like Goblins can still be incredibly dangerous if not handled with care. Goblin Slayer's theme is more about not underestimating a supposedly weak faction as opposed to the moral alignment of anyone in said faction.

The Hero's Party in Beast Tamer, though, they're very vainglorious only doing the job to gain the recognition that comes from completing it yet they abandon Rain due to viewing him as completely worthless only to find that things don't go as planned without him. Even before you get to the episodes of the party struggling, it's going to be clear that the hero's party will have a much more difficult time without a courier to carry their stuff or a proper scout to survey the area.

We get other revelations about Rain pretty quickly, like he's apparently abnormally strong for a Beast Tamer and he's also able to gain the properties of those he contracted with to improve his own base abilities and, as of Episode 7 there's an implication that the character that is said to be the Hero may not actually be the Hero. I don't know if it'll lead to Rain actually being the hero but the idea seems to be that while Aurios (I think that's how you spell his name) is descended from the Hero, the Hero's application of absorbing the blood of others to limit break and gain power to defeat the demon king is a lot more similar to Rain's abnormal ability to make contracts with entities he shouldn't be able to and the boons therein. But since I'm not certain, I'll let it slide.

For now though, let's focus on the fact that not only do the heroes abandon Rain when they view him as worthless, yet their plan for overcoming that difficulty is bringing him back only to abandon him when their job is done. And once that fails and they get their shit pushed in by Rain and his familiars, they contract him to obtain a Shield from the Lost Woods that they were unable to navigate. After he obtains it in only 2 days, where they got no progress in 7, they decide to invite Rain back to the party to defeat the Demon King only to reveal that they haven't changed at all. They don't have a newfound respect for Rain nor do they believe that they did anything wrong by mistreating him. They simply view him as a benefit to their goal.

So I have two predictions about the way this series is going to go: either Aurios actually is the hero, at which point being a hero doesn't equate to being morally righteous, making it a formality based on tradition. Or, it'll turn out that Rain is the actual hero, thereby completely nullifying the point of this post. I guess we'll just have to wait and see.

Thursday, September 1, 2022

After-Thoughts: Madoka Magica & Fate/Zero comparison

 I just finished watching Madoka Magica and I couldn't help but be struck by the number of similarities I saw to Fate/Zero, an anime that I consider to be among my favorites, if not my favorite in totality. However, while I do believe parallels exist, they seem to be very different in terms of their tones and executions. Which one is better, you may ask? Well, first, let's discuss why these two series are worth comparing.

So first and foremost, both series have not only high production values but also similar staff behind them. The animation studio at UFOtable brought Fate/Zero to life with some of the highest quality animation you're ever going to see, and while Studio SHAFT didn't quite reach that height with Madoka Magica I will say that its style is very striking and memorable, something I'm not going to forget for a long time. In addition, both series were written by Gen Urobuchi and had musical compositions largely directed by Yuki Kajura, with Kalafina showing up for some of the music as well, particularly OP and ED. In addition, both settings are very similar in ways, combining both the majesty of modern fantasy with the horrors that come with the use of magic. Magic in both settings is a very painful and corrupting aspect of the settings and both settings even revolve around the corruption of a person's wish, not only the lengths to which someone will go to get it granted but also the corruption behind the wish itself even when the desire behind it is inherently noble. Finally, a greater seemingly omnipotent force is behind the events of the story, albeit in different ways, and it's their influence that ultimately results in the narrative's beginning and end.

So now that I've brought up points of comparison, let's talk about character and thematic relevance since those are going to be key to understanding my takeaways.

Now, after watching both these series, I was struck by how much these settings had in common in terms of what happened and how everything's portrayed. To start, however, I want to clarify that not all of these similarities are necessarily the result of the writer Gen Urobuchi. While he did write out the narrative for both, the thing to remember is that Fate/Zero was written as the prequel to an existing work, while Madoka Magica was written as an original story. Because of this Urobuchi had limitations to work around when writing Fate/Zero specifically due to the pre-established setting of Fuyuki established in Fate/Stay Night by Kinoko Nasu. As a result, various themes and events occur due to Fate/Stay Night locking these things in stone. Sure there was a lot that Urobuchi had to work with in terms of his own creative vision but there were still things to keep in mind.

Certain figures such as Kiritsugu Emiya, Kirei Kotomine, Artoria Pendragon, and King of Heroes Gilgamesh had to remain constant since they're consistently referenced in Fate/Stay Night as being major players in Fate/Zero's Grail War. In addition, the Fuyuki Fire that occurs in the aftermath of the Grail War had to remain constant, as did the nature of the Holy Grail. Other things could be altered or fine-tuned for the sake of the narrative but these things had to remain unchanged.

Madoka Magica, however, was written as an original work that had a lot more to do with the Magical Girl formula, which is why it strikes me as odd that so many elements remain consistent between the two settings. Obviously, I'm not going to focus too much on specific stuff, like a black-themed main character being both a gun wielder and time manipulator, or a spear-wielder finding some sort of kinship with a sword wielder. These things are interesting coincidences but to focus on such surface-level details is to really miss the big picture. At their core, both of these series have characters that are motivated by a wish they want granted and make sacrifices to achieve such wishes. So let's tackle that first.

Fate/Zero takes place in the greater Fate series and Nasu timeline as an entry that covers a Holy Grail War. The Holy Grail War is a battle fought between seven masters who summon a servant of a given class to do battle, and it is initially believed that the last remaining master with a servant will have their wish granted by the Holy Grail. Along the way, great evils are committed in order to obtain the grail on multiple parts but it is ultimately revealed that the Holy Grail is not all that everyone thought it was. I'll talk more about that later.

Meanwhile, Madoka Magica follows a group of girls who live in an idealic world with no real notable problems initially but who come to meet this mysterious cat-like creature that offers them a deal: in exchange for having one wish granted, you shall become a magical girl and fight against witches to protect the world from suffering.

In other words both series revolve thematically around the idea of a single wish and what that means for the world at large. However, while this element is a driving force in both, they manifest in different ways. For example, in Madoka Magica, to become a magical girl, you have to make your wish first and your wish is then granted. Several of the girls have various wishes but it's clear that not all is as it seems. For example, Mami was placed in a situation where her only wish was to continue living. After being caught in a car accident and nearly dying, she took Kyubei's deal not for some greater aspiration but because she was in dire straights and needed assistance. The other girls didn't have the same thought process, though.

Sayaka for example chooses to restore the motor function in the hands of a boy she likes so that he can play the violin once more. Her goal is inherently selfless yet one particular problem that arises with it is how a selfless wish like this ends up harming her mentality. Meanwhile, Kyoko had a similar style of wish, wanting people to listen to her father and take his teachings to heart. The thing is though that while both wishes sound selfless in theory, they're not necessarily what the other person wanted in practice. This is much more the case with Kyoko, who's father murdered his family and committed suicide once he realized that it was Kyoko's magic that caused people to listen to him rather than any form of miracle, her selfless act ended up devaluing what he was doing.

In fact, side-note about Kyoko, I notice that she tends to eat a lot. There's almost no circumstance in which she's not eating a large amount of food whenever she's on-screen. My personal theory is that while she says she's okay and is fine living for herself, I speculate that she eats as much as she does in order to cope with what's happened. I don't have a huge amount of evidence to back that up, it's just a thought that came to mind as I was watching.

Finally, Homura's wish is simply to save Madoka's life because Madoka was the singular greatest source of happiness for Homura. This results in Homura going through a time loop where she attempts to simultaneously defeat Walpurgisnacht without letting Madoka become a magical girl. However, by doing so, she creates a timeloop that restarts every time Madoka dies, which in turn causes a large number of potential timelines to converge, making Madoka's magical potential stronger with each loop as well as making Madoka herself more appealing to become a magical girl to Kyubei. In other words, by choosing to attempt to save Madoka she ends up making that job substantially harder on herself with each passing loop.

In other words, much of the drama stems from what the characters are willing to do to have their wishes granted, as well as how much being a good person ends up sacrificing in order to achieve it.

Fate/Zero has a substantially larger roster of characters but it does have a similar style of dynamic in which everybody has a goal to achieve that the Holy Grail makes possible in some way and future drama is stirred up by everybody's desire for it. Although not everyone involved has a clear goal in mind and not everyone's goal pertains specifically to the Holy Grail. For some examples:

  • Tokiomi Tohsaka wants to obtain the Grail to reach the Root of Akasha in the hopes of obtaining true magic and any knowledge he desires. However, apart from that, he doesn't seem to have anything in particular in mind.
  • Kirei Kotomine has a wish to be granted but his wish is to understand his own true nature as he doesn't know why the things that bring others joy and satisfaction only bring pain to himself and vice versa. Kirei could've potentially achieved this wish without the Holy Grail under the right circumstances but he happened to be chosen before that could happen so he figured he'd may as well compete.
  • Lancer doesn't have any specific wishes, only to be given a chance to fight with honor one last time, something that was deprived of him while he was alive.
  • Kariya Matou doesn't give a crap about the Holy Grail either way but he sees what Zouken is doing to Sakura and wants to rescue her from that Fate. His deal with Zouken is that Zouken will let her go if Kariya can get him the Holy Grail. In other words the Grail is a McGuffin that he can trade for what he wants as opposed to the Grail itself simply giving it to him.
  • Waiver wanted recognition and proof that he's a valuable mage and he believed participating in the Holy Grail war would do that for him. What he actually planned to wish for was irrelevant because he quickly found himself out of his depth in this particular contest. In other words, he joined in order to prove himself, and survived simply because he didn't want to die. We'll come back to Waiver though.
In other words, everyone has a goal to achieve and the Grail has something to do with it but even with this accounted for, the major difference between the Grail War of Fate/Zero and the Magical Girl process of Madoka Magica is that the Masters battle in the hopes of achieving a wish, whereas the Magical Girls fight to pay off their wishes.

This is an interesting inversion in ways but one question this raises for me is what sort of impact does it have on character motivations and the theme? Well, in the case of Fate/Zero, one particular question that all the characters have to answer is how far are you willing to go to have your wish granted? In other words, the characters aren't even guaranteed their wish and therefore they need to fight, deceive, play dirty, and sometimes ruin any form of good they may have envisioned for themselves.

On the other hand, the girls that choose to become Magical Girls have their wish granted right away so in other words, the question is less about what you'll do to achieve the wish and more about how much you're able to endure for what you received?

This is actually one notable way in which I believe Kiritsugu and Homura are similar to each other. While yes both are black in color scheme and have some degree of time powers, what's more notable is that the two have a notably noble ambition but have given up on any ethical means of achieving it. Kiritsugu believed at first he wanted to stop all suffering only to find he couldn't do it with the power of a single person, so he chooses to fight in the Grail War, and do whatever it takes to win and in exchange he will use that wish to remove any and all suffering from the world, even if that means he has to be the last remaining evil to do it. Meanwhile, Homura decides all she wants is to save one person that mattered to her and was willing to endure any amount of pain on her own shoulders in order to achieve it. Her actions allowed her to do noble things at times but only for the sake of her own larger goal of keeping Madoka from becoming a magical girl. Their motives and ambitions may differ but at the end of the day the two have a goal to achieve and are choosing to shoulder the entire burden on their own in the hopes that they're the only ones who'll suffer at the end of it.

Likewise, I see some parallels between Sayaka and Artoria as well. Artoria is fighting for the Holy Grail to undo the damage to her kingdom that she brought on during her rulership. The Fate Route of Fate/Stay Night goes into much more detail on this than Fate/Zero ever did but essentially, Artoria is choosing to pick up her sword here in the hopes of redoing her time in Camelot so that she can prevent its ruin. There just happens to be a slight snag in this though: the Berserker Class Servant.

You see, this Grail War's Berserker isn't just any old servant, he's Sir Lancelot, the Knight of the Round Table that served most closely with Artoria. Before engaging him in battle Artoria wanted to redo the selection process so that she could get a second chance and not lead her kingdom to ruin. She thought she could take the mistakes that she made, learn from them, and be a better king in a redo. However, it's only after she runs into Lancelot, defeats him, and has the Grail taken from her at the last second that she reflects on what happens and amends her wish: rather than redo her life to alter the fate of her kingdom, she decides that she's entirely unfit for the job and decides that she wants someone else to be king so that hopefully her subjects, Lancelot in particular does not come to the same fate that they did under her. Of course, that amendment is more relevant to Fate/Stay Night than Fate/Zero but it's worth pointing out because Artoria takes on the battle for an initially noble cause yet the longer the battle goes on the more of a toll it takes on her until eventually she just wants to opt out completely.

In this way, Sayaka is similar. Sayaka's wish is initially noble, to restore the motor function of her friend's hand so that he can play the violin and be happy again. Essentially, she wants him to be happy not just for himself but also for her. On the one hand, her goal is selfless in that she's helping someone else to achieve a state of happiness that they wouldn't have without her. But there's also a selfish element to it, she doesn't just want him to heal, she also wants him to love her. 

This all comes to a head after two particular events take place, the first is that her soul gem is taken away from her body and her body becomes inanimate. It's revealed during this phase that when you're a magical girl, your soul is no longer in your body, it's in your soul gem, and your body just happens to be an avatar through which the magical girls fight. Kyubei later goes on to clarify that in this state they can suppress physical pain and continue fighting and heal later if their body gets damaged. He also makes note that some magical girls can go their whole lives without ever realizing this fact.

The other thing that happens, is Sayaka's friend Hitomi chooses to confess her feelings to that same boy but gives Sayaka a chance to do so first. This seems fair on a surface level but Sayaka is dealing with something that makes her own confession difficult: now that her soul is no longer in her body her body is basically just an animated corpse, she's a zombie in her own words, she's not alive the way others are. Therefore, she believes that it wouldn't be right for her to get together with Kyosuke. Nor that he would be able to love her if he found out what she was.

On the other hand though, his happiness was what brought her happiness and forcing herself to separate from him is what leads to her mental breakdown: deciding to revel in brutality, shut down physical pain in the hopes that it shuts down her emotions as well, choosing to be reckless with her life because she sees no value in it anymore, even rejecting help from others because she doesn't want to be saved.

Artoria and Sayaka have massive differences of course but the major takeaway with them is that a single act of selflessness or a desire to save another lead to their eventual downfall. Helping someone else does not necessarily lead to one's own salvation. If this were a Fate/Stay Night comparison, this would be the point where I bring up Shirou Emiya but since he isn't featured anywhere in Fate/Zero outside the epilogue, I'll just move on.

However, while two of our major players end up with an outcome of misery and pain, it's not all doom and gloom for everyone in either series. Kiritsugu Emiya sacrificed everything, even his own happiness to try to save the world but when it was brought to light that the Holy Grail was going to destroy everything instead, Kiritsugu rejected it, with his answers "1 life versus 3 billion. It's an easy choice." Meanwhile, Rider in particular was able to find some semblance of peace at the end because for him the journey was always more important than the destination. When he was alive, his goal to reach the ends of the earth and find Okeanos. When he was summoned long after his death, he saw what Okeanos really was and found that everything he did was pointless. Rather than despair at that though, he laughs, now seeing something even greater to achieve. He now wants to win the Holy Grail not to grant any particular wish but to grant himself a mortal body so that he can go on and Conquer the world that formed after his death. He could've easily wished for it with the Grail himself but he decides that there's no point in a lofty goal if the process is just to press an instant win button. So instead, his actual wish is a lot smaller and in exchange he'll use that small wish to achieve his goal himself. In other words, his wish was not the end of his journey, it would've been the beginning of a new one.

Likewise, in Madoka Magica, when Madoka sees all the suffering everyone goes through, from Sayaka over every revelation she had gone through, to Kyoko choosing to abandon everyone and fight for herself, to Mami's unfortunate death, even down to Homura living through the same time loop over and over again to achieve some form of alternate outcome, Madoka realizes that she can save every magical girl by removing the witches they become before they hatch, becoming a higher concept herself to allow Magical Girls to obtain their wishes without having their lives end in suffering and pain. In other words, once a magical girl becomes a witch, Madoka removes the suffering from them so they can have some semblance of peace.

Now, at the time I write this, I have not watched Madoka Magica Rebellion, which is the direct continuation of the 12 episode series that I just finished, so I can't speak on it directly. But looking at the 12 episode series by itself, Madoka's sacrifice to save everyone else is very similar to what Kiritsugu wanted to achieve, take all suffering onto yourself to save everyone else. But where Kiritsugu had to sacrifice the opportunity at the last second because the Grail could only grant the wish in a way he could comprehend, Madoka successfully becomes a god and takes every magical girl's suffering away. What ramifications this has in Madoka Magica Rebellion, I'll find out when I watch it. But for now, this is at least a somewhat definitive ending.

It's hard to talk too indepth about comparisons beyond this because there's so much less material to work with in Madoka Magica than in Fate/Zero. Fate/Zero was over double the length so it already had a longer run-time to begin with but it also has a much larger roster of characters, with around 14 as opposed to Madoka Magica's 5. As a result, I can't really talk endlessly on this particular comparison. But regardless, I do see all these similarities and while the modern fantasy settings may partly be responsible for that, it may also partly be that Madoka Magica was inspired by some of Fate/Zero. While the Fate/Zero anime came out some time after the Madoka Magica anime, the Fate/Zero light novel was written by Gen Urobuchi well before Madoka Magica began production so it's possible that the takeaways Urobuchi had during the writing of Fate/Zero still persisted somewhat into Madoka Magica. What I will say is that both series are deeply meaningful and have a lot of lessons to teach, even outside of such a basic comparison as this one.

That's all for today. Have a good day.