Inspiration
It's interesting the things we tell ourselves to feel better—little comforting lies, self-affirmations taken to their most absurd extremes. Late one night I stumbled on a delusion calculator and realised there was something deeply funny about seeing your own delusions laid out online. That “eureka” moment sparked the idea behind Delusion Generator™: a playful desktop app that both mocks and embraces our human need for comforting (or over-the-top) exaggerations.
What it does
Generates “fake tweets”: You get a front page post with your own username, avatar, and randomised like/retweet counters. Flip-card mini-stories: Click the card to squash it, flip it around, and reveal a bite-sized narrative on the back—then click again to pull a brand-new tale from the void. Personal stats dashboard: Track how many delusions you’ve spun, your average “likes,” and which mode you lean on most (Narcissist, Romance, Copium). Custom avatar & handle: Pick your own social-media persona—upload an avatar and choose a handle to make every tweet unmistakably yours.
How I built it
Core Engines: StoryEngine: Randomly stitches together “beginnings,” “middles,” and “endings” into mini-stories. StatsEngine: Tracks total delusions, average likes, and per-mode counts in a singleton. UI Layers in WPF/C#: Animated Background: Loaded an embedded GIF with a BitmapImage pack URI, docked behind everything. Fake Tweet Panel: A styled Border + StackPanel showing avatar, handle, tweet text, and randomised like/retweet counts. Flip-Card: Centered Border with ScaleTransform and a clickable MouseLeftButtonUp event to flip between front/back content. Stats Dashboard: A separate StatsWindow with text summaries and an ItemsControl bar chart powered by my converter. Extras: File-dialog avatar picker, formatted numbers with :N0, typewriter-style text reveal, and light/dark opacity overlays.
Challenges I ran into
Animated GIF support: WPF doesn’t play GIFs in brushes, so I had to load it into an Image and layer it manually without killing performance. Namespace hurdles: My converters and App.xaml code-behind started in mismatched namespaces, triggering “type not found” errors until I aligned x:Class and xmlns:local. No PlaceholderText: Classic WPF TextBox lacks placeholders—after experimenting with styles and adorners, I simplified to using the Tag property or removing hints entirely. Parsing formatted numbers: Parsing “1,234” from the UI blew up with FormatException, so I switched to storing raw integers in fields and only formatting them when I displayed them. Smooth flip timing: Getting the flip-card effect to never flash blank required guarding rapid clicks, squashing to zero scale, swapping content in the animation’s Completed event, and expanding back cleanly.
Accomplishments that I'm proud of
Seamless flip-card mini-stories with no external libraries—just WPF DoubleAnimation. Extensible, data-driven engines for both storytelling and stats tracking, ready for JSON templates or AI hooks. Fully customisable fake-tweet UI, letting me—and users—pick our own handles and avatars. Rich personal stats dashboard built with ItemsControl bars and converters, all in pure WPF/C#. A polished WPF/C# codebase that leans on pack URIs, resource dictionaries, converters, and animations for a modern desktop feel.
What I learned
WPF without XAML: I built nearly the entire UI in C# to harness WPF’s animation and layout power. Animation timing: Mastering the scale-squash flip and hooking into the Completed event taught me precise control over WPF animations. Data binding & converters: Writing an IValueConverter for bar widths reinforced how resources and binding work under the hood. User-first design: Adding avatar pickers, custom handles, and a stats window demonstrated why separation of UI and engine logic is crucial.
What's next for Delusion Generator
AI-Enhanced Delusions: Plug in an LLM to craft richer, on-the-fly affirmations and story variants. JSON-Backed Themes: Let users drop in JSON packs for custom story fragments, color schemes, and layouts—no recompile required. “Delusion Feed” Timeline: Persist every tweet/story locally and let users scroll back through their personal delusion archive. Share & Export: Add “Copy to Clipboard” and “Save as Image” so you can post your favorite fibs anywhere.
Log in or sign up for Devpost to join the conversation.