Bits from The Force Awakens Novelization

The_Force_Awakens_novelizationI finally finished reading the novelization of The Force Awakens (a couple of other books distracted me), and there were several interesting things near the end.

Han and Leia are married
When Han sees Leia: “Husband and wife stood regarding each other…” The film doesn’t specify if Han and Leia were still married by the time of The Force Awakens. Actually just going by the movie it isn’t clear if they were ever married. Glad to see that point cleared up. Although I’m still frustrated by their relationship overall; they did so much better in Legends… oh well.

Han hasn’t seen Kylo Ren’s face in 10 years
“For the first time Han saw the face of his son as a grown man…” Kylo Ren is around 29-30 years old during the events of The Force Awakens, so we can assume that Han hasn’t seen Kylo’s face for around 10 years. That’s longer than I expected.

Kylo is weakened
After Kylo murders his father, he falls to his knees and “found himself weakened”. I find it interesting that the act that Kylo hoped would make him stronger actually had the opposite effect.

Kylo knows who Rey is
After Rey calls the lightsaber to herself, Ren murmurs “It is you.” Kylo Ren believes that Rey is someone in particular, not just a surprisingly strong Force user.

It-is-you

Advertisements

Proliferation of Dependencies

Ten years ago or so, I wrote lots of relatively small Windows applications. It was important to me to minimize dependencies on external libraries besides those available in Windows. I wanted to ship a single exe that anyone could drop on Windows 2000 or later and run it without installing anything else. To that end I wrote my code in C against the Win32 API directly. No MFC, no .NET, or anything else. If I could restrict my calls to functions in kernel32, user32, gdi32, and advapi32, all the better.

This weekend I’ve been working on a web application. While reflecting on my Win32 days, it struck me just how many dependencies I’ve taken to deliver this web application. Of course there’s the baseline trio of HTML, CSS, and JavaScript, but then I’m also leveraging Node.js, Express, Jade, Passport, Socket.io, MongoDB, jQuery, and Knockout, plus a bunch of other small npm packages. Wow, what a change from my old “minimize dependencies” philosophy!

C-3PO’s Red Arm

Marvel’s C-3PO #1 (aka C-3PO: The Phantom Limb) finally was released this month, after a long wait! The comic book was originally supposed to be part of the “Journey to Star Wars: The Force Awakens” publishing program leading up to the release of The Force Awakens, but that didn’t happen. I ordered my copy in October, and had nearly forgotten about it!

It was a good story, providing a satisfying explanation for why C-3PO would actually choose to keep a non-matching limb. I found the story a little slow going at first, but the themes of droid sentience and free will were intriguing. Honestly, my favorite part was the inclusion of the “spice spiders,” bringing an element of Legends into the Disney canon.

C-3PO_comic

Digest authentication with Express 4

While adding digest authentication to a Node.js / Express 4 site, I ran into an issue. I was using Passport middleware for authentication, along with the passport-http strategy. Authentication worked fine with an Express router for my root path, but when I added authentication to a sub path (e.g. /api/cats) every request failed with an HTTP 400.

After some debugging, I found that digest.js from passport-http checks that the request URL matches the URI that was supplied with the authentication credentials. This is a problem because a mounted route handler sets req.url to a path relative to the mounted path, so in the example above req.url is ‘/’ while creds.url is ‘/api/cats/’, and the string comparison fails.

It turns out I’m not the first to encounter this, and there’s already a pull request for a fix, but it hasn’t been merged yet. In the meantime, I didn’t want to modify the passport-http code, so I made a change in my code to work around the issue. I added a custom middleware function that was called immediately before calling passport.authenticate that updates req.url using the same approach as in the pull request fix. Of course a side effect of this is that now req.url is no longer relative to the mounted path, but that isn’t an issue for my code.

// Middleware to ensure req.url works with digest auth
function (req, res, next) {
    req.url = (req.baseUrl ? req.baseUrl : "") + req.url;
    next();
}

Arduino Simon

Last year I decided to build a simple Simon style game using an Arduino. The game has four LEDs, each a different color, and a corresponding button for each LED. The game lights up a pattern of LEDs, one after another, and the player repeats the pattern to progress to the next level. Each level builds upon the previous level by adding one more element to the sequence. There is also a simple buzzer that provides audio feedback. Each LED is assigned a pitch that is played when it lights up, and there’s a victory “song” that is all of two notes!

Hardware

The LEDs were connected to digital pins on the Arduino via 220 ohm resistors. The buttons, or momentary switches, were connected to digital pins using 10k pull down resistors. The buzzer was connected directly to a digital pin. Turns out the buzzer was really loud, so I made a covering out of clay to reduce the volume. I originally used an Arduino Uno, but later decided I wanted something more compact, so I changed to the Nano. I also started with tiny DIP push buttons, but they were difficult to use, so I swapped them out for bigger push buttons.
simon-arduino-circuit-diagram

Parts List

The Code

The tone function was used to play notes on the buzzer. To create a random sequence for the player, I used the random function, and set the seed with an analogRead from pin zero, which was floating. The rest was just digitalWrite (to set the LED states), digitalRead (to check the button presses), delays, and keeping track of game state in memory.

Photos

v1 – With tiny buttons and Arduino Uno
simon-arduino-v1

v2 – With bigger buttons and Arduino Nano
simon-arduino-v2

Star Wars Continuity Explained

Do the various stories in all the Star Wars books, comics, games, and cartoons fit together as a single cohesive story? No, they don’t. There are two major Star Wars continuities, what I’m going to refer to as “Legends” and “Disney.”

Before Disney acquired Lucasfilm, there was a very large body of Star Wars content (books, comic books, games, cartoons) collectively known as the Expanded Universe. It told the story of what happened outside of the movies. Disney made the choice to brand this material as “Legends” and start from scratch with their storyline.

The Star Wars Disney continuity is comprised of the first six films (Episodes I – VI), the Clone Wars cartoon, and everything published since Disney took over. That includes The Force Awakens, all novels since A New Dawn, the Rebels cartoon, and the comics published by Marvel starting in 2015. Often this continuity is referred to as the “new canon” or just “canon” material.

The Star Wars Legends continuity basically includes everything else, although there’s some nuance to consider. The original six movies still “happened” in Legends, despite not being part of Legends. Generally speaking, Legends tells a fairly consistent story, particularly considering the large volume of material that needs to fit together. However, there’s a few big exceptions to this:

  1. Keeping a unified continuity didn’t seem to be a priority before Heir to the Empire was published in 1991, so don’t expect earlier works to fit in cleanly. The early Marvel comics are good example of this.
  2. Another problem area is The Clone Wars cartoon series. Despite being released before Disney’s acquisition, it stomped all over established continuity at the time. I prefer to just think of this cartoon as part of the Disney continuity only. Unfortunately that doesn’t quite work out, because some Legends material references content from the cartoon.
  3. Some Legends stories are “what if” stories, and not intended to be part of the Legends timeline. These are known as “infinities” stories.

For a more in-depth view of Legends and canon, see the “Canon” page on Wookieepedia.

Since Disney’s Legends decision, I’ve seen lot of the comments basically saying that that the old stories “aren’t true”, “didn’t happen”, or “don’t matter” anymore. I see things differently: there are now two Star Wars timelines, that happen to intersect at some points. Like any good mythology there’s not just one story. The old stories didn’t become less entertaining or less valuable. Sure, many Star Wars fans will only ever know Disney’s version of events, but anyone who wants to dig a little deeper can find a fascinating alternate Star Wars in Legends.

Originally posted by me, January 10, 2016, on docs.com:
https://docs.com/matthew-justice/8084/star-wars-continuity-explained

 

A Review of The Force Awakens

The Force Awakens was a great movie, and I thoroughly enjoyed it. It felt like “Star Wars” in a way that the prequels never quite captured. It had humor, compelling characters, plenty of action, mystery, a stirring musical score, and wonderfully familiar sights and sounds. Clearly this movie was designed to induce nostalgia, and it does an exceptional job of that. It also raises a ton of unanswered questions that makes me eager to learn more.

That said, in some ways, the movie was a bit too familiar. The film almost felt like a reboot of A New Hope (and certain parts of Empire & Jedi) rather than a sequel. This isn’t exactly a complaint, just an observation. I’m sure this was a conscious decision, and I hope we’ll see more original storylines in the upcoming films.

Despite being a fantastic film, there was a lack of emotional grounding in a couple of key events. The destruction of the Hosnian system should have had more emotional resonance. How can the audience be expected to care about some planets and beings that we know nothing about? Similarly, Kylo Ren’s confrontation with Han should have been very moving. It wasn’t for me; probably because I don’t have insight into Ben Solo’s motivations. Of course A New Hope placed audiences in 1977 in a similar situation, asking viewers to care about things that they didn’t understand. I hope that once the new trilogy is complete, we’ll go back and watch these scenes a feel a deeper connection.

I can’t talk about a new Star Wars movie without discussing it in context of Star Wars Legends. Some brief background: before Disney acquired Lucasfilm, there was a very large body of Star Wars content (books, comic books, games, cartoons) collectively known as the Expanded Universe. It told the story of what happened outside of the movies. Disney made the choice to brand this material as “Legends” and start from scratch with their storyline. However for me personally, Legends is Star Wars. I’ve spent way more time with the books and comic books than I have with the movies. So while I’m excited about the new Disney storyline, I can’t help but see the new material in light of Legends.

The Star Wars Legends universe that I know and love contains characters and places that hold much more emotional capital for me than Ben Solo possibly could at this point. I don’t know Ben Solo, but I do know Jacen Solo, and when he turned to the dark side, killed Luke’s wife, and eventually had to be taken out by his twin sister Jaina, I felt it. It meant something to me because I had hours invested in reading about his character and seeing him develop over the course of years. I’m sure that my investment in Legends contributes to the feeling that The Force Awakens doesn’t have emotional impact for which I had hoped.

Disney could have helped fill that emotional gap, at least for some fans, by linking elements of the film more closely to the now discarded Legends storyline. Let Kylo Ren be Jacen. Naming him “Ben” was doubly annoying, given that Ben is the name of Luke’s son in Legends, which really makes more sense. Rather than create a new “Hosnian” system, why not use a system from Legends, that certain viewers know and care about? I understand that Disney is targeting the broad fan base of Star Wars, and not the niche audience of Legends fans, and that completely makes sense from a business perspective. I was just hoping for a little love for the fans who have been following the Star Wars saga closely for years.

All of that said, I loved The Force Awakens. It sets the stage for a new universe with the potential to be every bit as rich and memorable as Legends. I can’t wait to see where this new story takes us.

Originally posted by me, December 24, 2016, on docs.com:
https://docs.com/matthew-justice/1229/a-review-of-the-force-awakens