Shop OBEX P1 Docs P2 Docs Learn Events
Big Hollywood Fun with LEDs — Parallax Forums

Big Hollywood Fun with LEDs

JonnyMacJonnyMac Posts: 9,194
edited 2012-09-07 02:23 in Propeller 1
Every summer I make one of these posts -- and here we are again. This year my friends at Biomorphs (Steve Wang's FX shop) were hired by Riot Games to create two characters from the huge online game, "League of Legends." The characters are Tryndamere and Ryze. Both on on display at the PAX gaming convention in Seattle this weekend.

Here's Tryndamere:

418840_446388062073061_2124896134_n.jpg

Yes, he's as big as he looks. If he were standing flatfooted on the floor without his helmet he would be 7'4" tall.

Admittedly, this one was pretty easy. I used an EFX-TEK HC-8+ controller (why not, I designed it) to control seven channels of LEDs. You'll notice that most of the lighting is in crystals are on the sword and in his armor. What Steve tends to ask for is a cyclical modulation of the lighting (ramp up, ramp down) with a "shimmer" on top of that. Assuming you have multi-channel LED dimmer that is compatible with byte values, here's how simple the code is:
repeat                                                        ' throb and shimmer
    repeat level from 255 to 100
      outs.set(HELM,  level + dither) 
      outs.set(ARMS,  level + dither) 
      outs.set(JEWEL, level + dither) 
      outs.set(BELT,  level + dither) 
      outs.set(KNEES, level + dither) 
      outs.set(SWORD, level + dither) 
      pause(8)
        
    repeat level from 100 to 255
      outs.set(HELM,  level + dither) 
      outs.set(ARMS,  level + dither) 
      outs.set(JEWEL, level + dither) 
      outs.set(BELT,  level + dither) 
      outs.set(KNEES, level + dither) 
      outs.set(SWORD, level + dither)
      pause(8)

    
pub dither

  return prng.random ~> (32 - 3)


Of course, we spent a little time experimenting with the low side value of the overall brightness and the dither setting. I really like Michael Rychlik's PRNG object (which implements George Marasglia's algorithm [see post, below]) and tend to seed it with Chips RealRandom object. The dither() method uses SAR to maintain sign so that it returns a signed value; by adding the dither and use a small delay the crystals "shimmer."

The eyes created a bit of a challenge. The aqua LEDs we used were incredibly bright and I couldn't get control of them -- to Steve's satisfaction -- with my standard dimmer code that is used for the other channels. After an hour of futzing I just pulled that channel from my standard dimmer and wrote a custom driver for the eyes. Steve wanted them to throb like everything else, but at a nearly imperceptible level. I ended up doing this in PASM; 20 minutes later Steve was happy.


The second character is called Ryze.

528015_446387775406423_1243360907_n.jpg

This one used two HC-8+s: one in the base (for the base and his eyes), and one in the energy ball. The eyes animation is very close two what I posted above. There are three channels in the base and I sequence them quickly to create a bit of a rotating look. That said, they also get the "shimmer" treatment (Steve really likes that).

The real fun was in the energy sphere. After banging our heads for a couple weeks we found an RGB LED strip that uses individual WS2801 drivers for each LED. We cut this into smaller strips and attached it to a core that holds the HC-8+ and mounting points for holding rods that support the outer sphere. When this project first came up we were going to use a plasma ball but Steve told his client that he though we could do better, and get closer to the game artwork (we had no idea how tough that would be). At any rate, I wrote a PASM driver for the WS2801 (was pretty easy) and we gained control over 94 RGB LEDs. In the end there are two animations running on top of each other: one creates a swirling pattern and transitions from green to blue and back. The second creates a ring that traverses from the south pole of the sphere to the north pole and then bounces back. The ring animation takes the value from the swirl animation and swaps the green and blue channels. In the end it became fairly simple but looks really cool.

As the original idea was to somewhat mimic a plasma ball there are super-bright white LEDs in the core at the base of the support rods (which are interestingly textured with hot glue). I wrote a lightning simulation that runs on the available six channels of the HC-8+, again using Michael's PRNG object. It looked great. Then Steve asked, "Jon, can I have more lightning?" I was very tired (we had some long days in a shop that was over 100 degrees most days) so it took a moment, but then it dawned on me that I could launch my lightning method into a second cog (it's all Spin). Bingo, it looks fantastic!

I know that some old-timers are yawning and thinking, "Jon, it's just LEDs for Pete's sake..." Yeah, you're right. But if you could see the joy on the faces of Steve's crew when those things light up, you'd smile like I do. My simple LED lighting tricks add a bit of life to otherwise inanimate objects. And in the end when a Hollywood FX legend like Steve Wang gives me a high-five and says, "McPhalen, you made magic" well, I'll be happy to come back next summer and write even more LED code.

Most importantly, the client was thrilled -- so much so that they asked if they could have a second shop visit day for their art department (60 people!). On that day one of them approached me and asked what I did on the project. "I designed the electronics and programmed the animations." "Oh, cool. Did you use an Arduino?" "No... because 'Arduino' is Italian for 'junk.'" I didn't let the look of shock hang long on his face; I cracked a smile, told him I was kidding, but that the Arduino just didn't have the muscle to do what we need to do (especially as quickly as Steve always wants it). I had a spare HC-8+ with me and showed it to him, telling him about the Propeller. He said he had heard of Parallax, but didn't know anything about the Propeller. That last part I do not know how to solve....
640 x 480 - 420K

Comments

  • skylightskylight Posts: 1,915
    edited 2012-09-01 09:57
    Sounds a great project, have you a video of it all working?
  • JonnyMacJonnyMac Posts: 9,194
    edited 2012-09-01 10:00
    Steve took video in the shop but he hasn't posted it yet because the displays just went public yesterday. When he does I'll post a link. Something may pop up on YouTube over the weekend, as well. PAX is a huge convention and there's been quite a bit of online conversation about how cool these displays are.
  • doggiedocdoggiedoc Posts: 2,245
    edited 2012-09-01 10:20
    Nice work Mr. McPhalen. It may be "just LEDs" like you hinted, but LEDs is what motivates a lot of us around here. (Well me anyway!)

    Paul
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-09-01 10:49
    Wow, Jon! That's impressive! Think how many people blink an LED and then think that's it for LEDs and can't wait to move on to something "sophisticated".
  • JonnyMacJonnyMac Posts: 9,194
    edited 2012-09-01 11:33
    I make these posts every year to point out -- especially to enthusiastic newcomers -- that there is far more to LEDs than the simple blinky-light demos found in so many programming tutorials. I am in fact just controlling LEDs, but in this context they're awesome.

    Just found this on YouTube:
    -- http://www.youtube.com/watch?v=z3CsSj5c5wA

    It's a slide show (no motion video -- yet), but does give more angles on both characters.

    For those that missed them, these are the previous projects:
    -- http://forums.parallax.com/showthread.php?134092-Hollywood-Fun-With-Propeller-powered-LEDs
    -- http://forums.parallax.com/showthread.php?126553-Propeller-Powered-Starcraft-II-Marine

    Every year we work to up the ante on lighting control; the energy ball really set the mark high -- next year should be a real challenge.
  • RaymanRayman Posts: 14,826
    edited 2012-09-01 14:17
    Very impressive, as usual... Still, I think the blonde lady was my favorite for some reason...
  • JonnyMacJonnyMac Posts: 9,194
    edited 2012-09-01 15:21
    She (Mourningstar) is on display at PAX this weekend, too. There's also a human (cosplayer) version named Crystal. Last fall we built costumes from the molds used in the original displays. The cosplayer costumes have static lighting, no animation control.

    tumblr_lxjdulKBVk1qa9a20o1_500.jpg

    Crystal is a hardcore cosplayer; there's a neat little video with Steve and her at this link:
    -- http://www.gamerlive.tv/article/firefall%E2%80%99s-mourningstar-gets-sexy-cosplay-crystal-graziano
  • ElectricAyeElectricAye Posts: 4,561
    edited 2012-09-01 15:46
    Man, that's just out of this world!
  • lonesocklonesock Posts: 917
    edited 2012-09-01 17:34
    That looks awesome, great work!

    Jonathan

    P.S. I can't wait to see the video.
    P.P.S. Well, I can wait, as obviously I have to...
  • Heater.Heater. Posts: 21,230
    edited 2012-09-03 15:33
    JonnyMac,

    Very impresive.

    Whilst It makes me very hapy to see a few lines of my code make it to Hollywood (I guess many script writers would sell their souls for that) the credit should really go to the late George Marasglia who invented that stuff, I only reimplemented it. http://en.wikipedia.org/wiki/Multiply-with-carry
  • JonnyMacJonnyMac Posts: 9,194
    edited 2012-09-03 17:40
    As a firm believer in credit where it's due, I have edited my original post. Thanks. And thanks for the implementation of the algorithm; I really like it; as a guy who does this kind of stuff and a whole lot of Halloween prop control code, it's very useful.
  • RaymanRayman Posts: 14,826
    edited 2012-09-03 18:11
    I wasn't sure if Crystal was plastic or real until I saw the video... I'm impressed that real people can actually wear that stuff...
  • JonnyMacJonnyMac Posts: 9,194
    edited 2012-09-03 18:49
    Those things can be tricky -- lots of test fittings to customize everything. I had to fit the batteries for the costume LEDs in the chest compartment and with her build, there was not a lot of room....
  • RaymanRayman Posts: 14,826
    edited 2012-09-04 12:19
  • StefanL38StefanL38 Posts: 2,292
    edited 2012-09-04 13:01
    Hi John,

    are you allowed to upload a video showing the LEDs in action?
    best regards
    Stefan
  • PaulPaul Posts: 263
    edited 2012-09-04 13:29
    Saw a picture of Tryndamere on Reddit, yesterday. Good work Jon (et al). Hope to see the animated version soon.
  • JonnyMacJonnyMac Posts: 9,194
    edited 2012-09-04 17:31
    are you allowed to upload a video showing the LEDs in action?

    If I had one I would have by now. Steve shot some video of the animations running in his shop the night we fine-tuned the programming. I'm waiting for him to post that so I can link to it.
  • KyeKye Posts: 2,200
    edited 2012-09-04 20:34
    That's sooo cool Jon, excellent work!
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-09-04 20:59
    JonnyMac wrote: »
    The cosplayer costumes have static lighting, no animation control.
    Why not? It should be easy enough to fit.
  • JonnyMacJonnyMac Posts: 9,194
    edited 2012-09-05 10:04
    I said the same. In the end, though, it's the client's choice.
  • JonnyMacJonnyMac Posts: 9,194
    edited 2012-09-07 02:23
    I came across a bit of video in my DSLR. This was shot a few days before we finished. The final program simplified the main ball motion and used more "lightning" strikes.

    -- http://youtu.be/YuSMKciw0J8

    The guy with the beard, Cleve, is about 6' 2" so you can get an idea of how big this character is.
Sign In or Register to comment.