Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Participants: Derya Akbaba * Ben Allen * Natalia-Rozalia Avlona * Kirill Azernyi * Erin Kathleen Bahl * Natasha Bajc * Lucas Bang * Tully Barnett * Ivette Bayo * Eamonn Bell * John Bell * kiki benzon * Liat Berdugo * Kathi Berens * David Berry * Jeffrey Binder * Philip Borenstein * Gregory Bringman * Sophia Brueckner * Iris Bull * Zara Burton * Evan Buswell * Ashleigh Cassemere-Stanfield * Brooke Cheng* Alm Chung * Jordan Clapper * Lia Coleman * Imani Cooper * David Cuartielles * Edward de Jong * Pierre Depaz * James Dobson * Quinn Dombrowski * Amanda Du Preez * Tristan Espinoza * Emily Esten * Meredith Finkelstein * Caitlin Fisher * Luke Fischbeck * Leonardo Flores * Laura Foster * Federica Frabetti * Jorge Franco * Dargan Frierson * Arianna Gass * Marshall Gillson * Jan Grant * Rosi Grillmair * Ben Grosser * E.L. (Eloisa) Guerrero * Yan Guo * Saksham Gupta * Juan Gutierrez * Gottfried Haider * Nabil Hassein * Chengbo He * Brian Heim * Alexis Herrera * Paul Hertz * shawné michaelain holloway * Stefka Hristova * Simon Hutchinson * Mai Ibrahim * Bryce Jackson * Matt James * Joey Jones * Masood Kamandy * Steve Klabnik * Goda Klumbyte * Rebecca Koeser * achim koh * Julia Kott * James Larkby-Lahet * Milton Laufer * Ryan Leach * Clarissa Lee * Zizi Li * Lilian Liang * Keara Lightning * Chris Lindgren * Xiao Liu * Paloma Lopez * Tina Lumbis * Ana Malagon * Allie Martin * Angelica Martinez * Alex McLean * Chandler McWilliams * Sedaghat Payam Mehdy * Chelsea Miya * Uttamasha Monjoree * Nick Montfort * Stephanie Morillo * Ronald Morrison * Anna Nacher * Maxwell Neely-Cohen * Gutierrez Nicholaus * David Nunez * Jooyoung Oh * Mace Ojala * Alexi Orchard * Steven Oscherwitz * Bomani Oseni McClendon * Kirsten Ostherr * Julia Polyck-O'Neill * Andrew Plotkin * Preeti Raghunath * Nupoor Ranade * Neha Ravella * Amit Ray * David Rieder * Omar Rizwan * Barry Rountree * Jamal Russell * Andy Rutkowski * samara sallam * Mark Sample * Zehra Sayed * Kalila Shapiro * Renee Shelby * Po-Jen Shih * Nick Silcox * Patricia Silva * Lyle Skains * Winnie Soon * Claire Stanford * Samara Hayley Steele * Morillo Stephanie * Brasanac Tea * Denise Thwaites * Yiyu Tian * Lesia Tkacz * Fereshteh Toosi * Alejandra Trejo Rodriguez * Álvaro Triana * Job van der Zwan * Frances Van Scoy * Dan Verständig * Roshan Vid * Yohanna Waliya * Sam Walkow * Kuan Wang * Laurie Waxman * Jacque Wernimont * Jessica Westbrook * Zach Whalen * Shelby Wilson * Avery J. Wiscomb * Grant Wythoff * Cy X * Hamed Yaghoobian * Katherine Ye * Jia Yu * Nikoleta Zampaki * Bret Zawilski * Jared Zeiders * Kevin Zhang * Jessica Zhou * Shuxuan Zhou

Guests: Kayla Adams * Sophia Beall * Daisy Bell * Hope Carpenter * Dimitrios Chavouzis * Esha Chekuri * Tucker Craig * Alec Fisher * Abigail Floyd * Thomas Forman * Emily Fuesler * Luke Greenwood * Jose Guaraco * Angelina Gurrola * Chandler Guzman * Max Li * Dede Louis * Caroline Macaulay * Natasha Mandi * Joseph Masters * Madeleine Page * Mahira Raihan * Emily Redler * Samuel Slattery * Lucy Smith * Tim Smith * Danielle Takahashi * Jarman Taylor * Alto Tutar * Savanna Vest * Ariana Wasret * Kristin Wong * Helen Yang * Katherine Yang * Renee Ye * Kris Yuan * Mei Zhang
Coordinated by Mark Marino (USC), Jeremy Douglass (UCSB), and Zach Mann (USC). Sponsored by the Humanities and Critical Code Studies Lab (USC), and the Digital Arts and Humanities Commons (UCSB).

Code Critique: Ruben and Lullaby by Erik Loyer

Title: Rube & Lullaby
Author: Erik Loyer
Link: https://github.com/eloyer/ruben-and-lullaby
Year: 2009

Upon the occasion of CCSWG20, artist Erik Loyer has shared the code for Ruben & Lullaby, a wonderful iOS work in which you play (as in playing a musical instrument) a conversation between two fighting lovers. You can make it worse by aggravating them or try to smooth things out, as you interact to calm them down (via rubbing the screen) or irritate them (by shaking it). The piece also features a "dynamic score," which is also affected by user interaction.

Erik has pointed us in some potential areas of interest:
Input is handled in EAGLView.m — both accelerometer (tilt to cut, shake to anger) and touch (tap to change eye position, stroke to calm).

The logic behind the story mechanics, shot transitions, and the dynamic score is all contained in StoryManager.m — I'm interested in exploring these as potential constraints on live performance by actors and musicians.

The XML file rl_data.xml contains data describing each character view, as well as a script that serves as a kind of superstructure for the experience.

In Localizable.strings you can find the vestiges of an abandoned attempt to make the story mechanics easier to grasp through text.

Here's a demo of the app.

Let's explore.

Comments

  • Okay, let's get this started properly. First, Erik has pointed us toward some fairly easy-to-read code. Here's a passage from the file StoryManager.m file.

    /**
     * Returns the current ending state of the story based on character emotions.
     */
    - (NSString *) getEndingState {
    
        NSString *state;
        RubenLullabyGLAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
    
        if (ruben.hasExpressedFeelings > .666) {
            if (lullaby.hasExpressedFeelings > .666) {
                if ((ruben.emotion < .666) && (lullaby.emotion < .666)) {
                    if (delegate.glView.hasTouched) {
                        state = @"hug";
                    } else {
                        state = @"happy";
                    }
                } else {
                    state = @"sad";
                }
            } else if (lullaby.hasExpressedFeelings > .333) {
                if ((ruben.emotion < .666) && (lullaby.emotion < .666)) {
                    if (delegate.glView.hasTouched) {
                        state = @"hug";
                    } else {
                        state = @"happy";
                    }
                } else {
                    state = @"sad";
                }
            } else {
                state = @"lLeaving";
            }
        } else if (ruben.hasExpressedFeelings > .333) {
            if (lullaby.hasExpressedFeelings > .666) {
                if ((ruben.emotion < .666) && (lullaby.emotion < .666)) {
                    if (delegate.glView.hasTouched) {
                        state = @"hug";
                    } else {
                        state = @"happy";
                    }
                } else {
                    state = @"sad";
                }
            } else if (lullaby.hasExpressedFeelings > .333) {
                state = @"sad";
            } else {
                state = @"sad";
            }
        } else {
            if (lullaby.hasExpressedFeelings > .666) {
                state = @"rLeaving";
            } else if (lullaby.hasExpressedFeelings > .333) {
                state = @"sad";
            } else {
                state = @"sad";
            }
        }
    
        return state;
    

    This code determines the end conditions based on emotions. While it's tempting to make something out of the 666, I'll just read this as Loyer dividing emotional levels into thirds. This is such an intimate game, I find it touching to look at the code that determines the state of the game by measuring a combination of expressed feelings, emotions, and touch.

    A subsequent portion of the code, brings camera angles into the mix:

                    `   [establishingView setCharacterPose:[NSArray arrayWithObjects:@"hug", nil]];`
    

    Let's talk a little about this model for character relationships, particularly as it pertains to outcomes of the game. What does this code tell us about the view of relationships modeled here?

Sign In or Register to comment.