Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

GSoC 2018 Cadence Holmes

justKD edited this page Jun 6, 2018 · 27 revisions

Cady

Schedule - CST (GMT -5)

Sun Mon Tue Wed Thu Fri Sat
Available 10am - 5pm 10am - 5pm 10am - 5pm Available 10am - 5pm 10am - 5pm

Links

My Portfolio | GitHub

Bio

I'm a music major. Well, I'm a PhD candidate in Experimental Music and Digital Media, but my degree will technically come from the School of Music. I've never taken a formal comp sci or coding class. I got into programming when learning Csound to compose electronic music, and it's been an up-and-down ride since then. Now I primarily do web and mobile development, most often for art and/or social justice/awareness/growth, and I'm always looking for new opportunities to learn.

I fancy myself a multi-media artist. My portfolio includes music, visual art, installations, as well as mobile and web apps. I'm really interested in subversive processes where common tools and techniques are used in uncommon ways to produce new kinds of art.

As a researcher, I tend towards user experience and interaction design, especially concerning technology for STEAM education and informal learning.

Proposal

Out-of-Character Contextual Information for PowerUp!


Status Reports

Community Bonding Period

What have you accomplished (list specific items accomplished)?

  • I've met and chatted with several people!
  • I've taken this time to become more familiar with the PowerUp iOS codebase and database.
  • In order to move forward with my proposal, it was necessary to map out the current Q&A database. It turned out to be a bit of a pain to do manually, so I created a web app that automatically parses the tables and lays out the records in a connected tree. It's been a huge help to me in planning my time tables, but I think it's also going to be a big help as we try to clean up and improve on the current scenario writing. https://github.com/justKD/Sqlite-GoJS-DB-Map

What issues or roadblocks have you encountered this week?

  • When forming my original proposal, I knew the writing in the current app could be improved on, but I wasn't aware of how fragmented the database was going to be. A big part of what I want to contribute is not just code, but also resources to use in order to improve the outcomes we could expect from the app. I'm having to rethink what that contribution might look like!

Have they been resolved, and if so, how?

  • Not yet. But I've started looking into helping with the scenario writing in general.

What do you plan to accomplish next week?

  • I'm mulling over how to best help with the scenario writing. It's a little overwhelming for a number of reasons, but I started another web app that might be able to help with designing scenarios more efficiently.
  • I'm also finalizing my design plans for the classes I need to implement. I want to ensure the new functionality leaves a minimal footprint on existing code.

How does your progress compare to your project schedule?

  • I think things are on track. Coding officially starts Monday!

Week 1 - 5/14

What have you accomplished (list specific items accomplished)?

  • I shared a different take on the mapper tool. The Sqlite mapper is still useful for checking the current state of the database, but I also have been working on a tool to help create and edit scenarios. I shared it with the PowerUp team at our weekly meeting. It's already been useful to me in creating dummy data for testing, but I think it can be used as a general tool for building and maintaining branching scenarios. Detailed description in the readme. https://github.com/justKD/powerup-scenario-builder

  • I started writing classes to handle the out-of-context events I've proposed. I've finished a working initial version of the popup controller. Right now the scenario view controller is checking for and presenting the popups, but they could also be added to mini-games.

  • PopupEventController Example

I'm trying to build the class to be as easy-to-use as possible, and especially trying to leave the smallest footprint on existing code as I can. By subclassing UIView and using a delegate method, the view can be added and released all from an instanced variable rather than creating a strong reference to a persistent view. Here's an example of launching a popup:

guard let popups = PopupEvents().scenarioPopups[scenarioID] else { return }
guard let model: PopupEvent = popups[popupID] else { return }
let event: PopupEventPlayer? = PopupEventPlayer(delegate: self, model: model)
guard let popup = event else { return }
self.view.addSubview(popup)

/* Line by line, this code:
- retrieves the collection of popups for the current scenario
- retrieves/initializes a model
- initializes a local instance of the PopupEventPlayerClass, assigning the presenting controller as the delegate
- checks to ensure a everything's worked so far
- adds the view to the controller - the class handles it's own geometry, animations, sound, and interactions
- (the model provides strings, badge image name, and checks for sound)
*/
  • It times itself for automatic dismissal, or can be tapped to manually dismiss it. Then it calls the delegate method where it can be removed from the main view, and ARC handles the rest.
func popupDidFinish(sender: PopupEventPlayer) {
    sender.removeFromSuperview()
}
  • You can check out the entire class here: PopupEventPlayer.swift on GitHub

  • I added a new field to the Answer table for popupID, and have a model file to hold a list of the popup models. Something like this:

let popupEvents = [
    1: PopupEvent(mainText: "test model 1",
                  subText: "has sound",
                  image: "minesweeper_abstinence_heart",
                  useSound: true),
    2: etc.
  • The only changes to existing code were:

    • Change the answer model to include the popupID field
    • Change the database accessor to include a constant for the new field and return it in the answer model
    • Call the function to present the popup when an answer is selected
    • Declare the view controller as the delegate and add the delegate method
  • After finishing this class, I created test data and have been trying to put the class through the paces. It should always gracefully exit any functions (or just ignore a field) if anything is wonky, but never cause a fatal error.

  • I also updated existing unit tests to ensure they still pass.

What issues or roadblocks have you encountered this week?

  • Nothing serious. It's kind of a pain switching back and forth between javascript and swift. They are similar enough in syntax to cause muscle memory headaches.
  • I was looking into creating UI tests for the class. Setting them up is a little different from unit test cases, so it wasn't as easy as just adding a test class to the existing test target.

Have they been resolved, and if so, how?

  • I'm getting there. I just need some more time getting back into the Swift groove.
  • I'm going to try and get the target for UI tests set up this week.

What do you plan to accomplish next week?

  • I'm going to work on getting the UI test environment ready and design tests for the PopupEventController class.
  • And I'm going to start work on the intro and outro story sequence classes.

How does your progress compare to your project schedule?

  • My original plan is having to change a bit since the current scenario content is evolving. I'm on track to finish the code infrastructure by the end of the first coding period.

Week 2 - 5/21

What have you accomplished (list specific items accomplished)?

  • I finished a first working version of the StorySequencePlayer class. It handles stepping through a collection of events that each describe a scene. Each step contains a left and right component that describes an image, text, and animations. Similar to the PopupEventPlayer class, StorySequencePlayer is designed to be as self-contained as possible.
guard let model = StorySequences().intros[scenarioID] else { return }
let sequenceView: StorySequencePlayer = StorySequencePlayer(delegate: self, model: model)
self.view.addSubview(sequenceView)

/*
- get the collection of scenario intros and retrieve the correct model if it exists
- create an instanced StorySequencePlayer passing the delegate and model
- add to top view
*/

  • I also wrote a class to help create animations. It's based off of a concept that I've used in objective-c, but I think swift improves it greatly.
  • I'm using this class to animate events in the story sequences, but it could be used elsewhere in the app
/*
- The Animate class attaches to any UIView and lets it be animated using a pseudo-sentence syntax
- You can chain together events that should happen simultaneously using .function()
- And you can chain together timed events using the optional callback function then: {}
- Animate includes functions for basic transforms, as well as some other pre-designed more complex animations
*/

Animate(view, duration).setOptions(.curveLinear).rotate(to: 90)

let view = Animate(view, duration)
view.setSpring(damping, velocity).translate(by: [50, 0], then: {
    view.flip().shake(then: {
        view.reset()
    })
})

What issues or roadblocks have you encountered this week?

  • I'm not used to actually working with other people in a git project. I'm usually free to be sloppy and make random edits and changes without explanation, and then merging a big chunk of well-worked code.

Have they been resolved, and if so, how?

  • I think so. I just have to be careful and actually think about how I'm structuring changes in branches and commits.

What do you plan to accomplish next week?

  • Tests for the new OOC classes.

How does your progress compare to your project schedule?

  • Still on track to finish coding the main infrastructure to handle OOC events by the end of the first coding period.

Week 3 - 6/1

What have you accomplished (list specific items accomplished)?

  • I finished automated UI tests for StorySequencePlayer and PopupEventPlayer. They test expectations for user interaction.
  • I've also finished unit tests for both classes. Since their general functionality is being tested in the UI tests, my unit tests focus on being thorough and asserting that the datasets are complete. I've set them up with the expectation that the datasets will be a part of the platform agnostic databases rather than hard coded in swift.
  • The StorySequencePlayer test asserts that all strings from the database match existing options. It tests for media files (sound and images) as well as testing that the position and animation enums are matched.
  • The PopupEventPlayer unit tests check each stored model by creating an instance of PopupEventPlayer and asserting that the correct elements exist and match the data we expect.

What issues or roadblocks have you encountered this week?

  • I haven't submitted the PR for the unit tests yet because one of the UI test PRs is causing an issue. Even though the StorySequencePlayer test passes in Xcode, the Travis-CI check is failing. At first, it was because I didn't account for an actual new game not showing as many screens as starting a new game and overwriting old data, but now it's not entirely clear what the issue is. Travis fails when it tries to find a button to tap, but it can log the buttons data at that time, and running the actual test in Xcode doesn't have the same issue.

Have they been resolved, and if so, how?

  • The Travis check hasn't been resolved yet. It's just not entirely clear to me what is different between running the test in Xcode and what Travis-CI tries to do.

What do you plan to accomplish next week?

  • I want to get this Travis thing resolved for sure, but otherwise I have a couple housekeeping issues to deal with in the new classes:
  • There's a bug in the story player text: when new text is generated, all text slides up and old text fades some. The issue is when the left and right events both have text. The left side is added first, and, even though it is new text, it fades right away. I've got a fix in mind and will implement it soon.
  • Then, I need to add in an example outro sequence. That shouldn't be a big deal since the event is the same as an intro, but the way it is launched is different and needs to be tested.
  • Finally, I want to move the datasets to an external file that could be used cross-platform. Right now they are just hard coded in the app. I need to move the data and create the functionality to parse them.
  • (I also want to create examples of how I envision these story sequences could be used. I think there's opportunity to use them in different ways.)

How does your progress compare to your project schedule?

  • Still on track to finish coding the main infrastructure to handle OOC events by the end of the first coding period. I should then be able to start documentation beyond the in-line comments and markdown, and to prepare issues to help port the classes to Android.