the sartrean knight

published

Categories iOS
Stack SwiftUI, Combine

overview

The Sartrean Knight is a short interactive story blending medieval fantasy with existential philosophy. Inspired by the works of Jean-Paul Sartre, the experience invites you to navigate a reflective journey about meaning, freedom, and the consequences of choice.

You play as a weary knight facing a mysterious gatekeeper. Through dialogue and memories, you will determine your own path and conclusion, featuring multiple unique endings and full support for both English and Portuguese.

I developed The Sartrean Knight in one week during the initial phase of my experience at the Apple Developer Academy. The project was an opportunity to explore interactive storytelling and the design of meaningful choices.

I learned a lot about using JSON to build a game's narrative structure, as well as improving my skills in SwiftUI and Combine. It was also a rudimentary way to implement localization for an app, paving the way for me to later learn about using string catalogs.

tech stack

SwiftUI
UI framework
Combine
reactive state

code snippets

To keep transitions between scenes instant, I map the story's JSON into a dictionary when the app starts. This swaps out slow linear searches for O(1) lookups, so the game stays snappy even as the script gets longer.

private func loadStory() {
    guard let url = Bundle.main.url(forResource: "story", withExtension: "json"),
          let data = try? Data(contentsOf: url) else { return }
    do {
        let decoded = try JSONDecoder().decode(StoryData.self, from: data)
        for page in decoded.screens {
            pages[page.id] = page
        }
        orderedPages = decoded.screens
        currentPageID = decoded.screens.first?.id
    } catch {
        print("Failed to decode story.json: \(error)")
    }
}

design choices

palette

mist #F1F1F1
ink #000000
paper #FFFFFF

typography

MedievalSharp / antiquity and authenticity
The quick fox jumps over the lazy dog
Jacquard 24 / gothic decorative touch
The quick fox jumps over the lazy dog

rationale

The design of The Sartrean Knight was inspired by the aesthetics of medieval manuscripts, reflecting the philosophical and historical theme of the narrative. The choice of MedievalSharp and Jacquard 24 fonts aims to evoke a sense of antiquity and authenticity, while the soft color palette and old paper textures complement the game's contemplative atmosphere.

At each stage of the narrative, I included an image to provide visual context and deepen immersion in the medieval setting. These were crafted to reflect the themes and emotions of each scene, reinforcing the player's connection to the plot. The image frames resemble illustrations from an old book. While the images themselves don't follow one specific style, they have a gothic feel that captures the characters and setting.

credits

people

design · development
pedro wiezel

fonts

MedievalSharp
Wojciech Kalinowski
Jacquard 24
Sarah Cadigan-Fried

assets

textures
@joou and @samueladekunle (Figma Community)
backgrounds