🌌 Inspiration
"The universe is vast, chaotic, and unforgiving."
My inspiration for Beyond Galaxies: Shelter came from the intersection of sci-fi world-building, real physics, and strategic survival games. I wanted to create a game where every decision matters—where the gravity of a planet affects your crafting costs, where the atmosphere determines your weapon's effectiveness, and where your team's survival depends on collective intelligence.
From movies like Interstellar and The Martian, I drew the sense of isolation and the need for ingenuity. From physics and chemistry, I borrowed concepts like gravity modifiers, atmospheric composition, and resource synthesis. The core crafting mechanics dynamically scale based on gravitational shifts:
$$ C_{\text{craft}} = C_{\text{base}} \cdot (1 + \Delta \gamma_p) $$
Where \( C_{\text{craft}} \) represents the final adjusted resource cost, \( C_{\text{base}} \) is the item's blueprint requirement, and \( \Delta \gamma_p \) is the planet's gravitational variance relative to Earth baseline (\( 1g \)). The result is a game that feels both epic and intellectually engaging.
🧠 What It Does
Beyond Galaxies: Shelter is a daily cooperative survival game built on Reddit's Devvit platform. Players join one of three teams (RED, BLUE, or GREEN) to defend their planet from cosmic disasters.
📋 Core Features:
- 🌍 10 Unique Planets — Each with its own gravity, atmosphere, internal geology, and external weather effects that directly impact gameplay.
- ⚗️ 30 Crafting Recipes — Combine resources to build walls, weapons, shields, traps, boosters, and hidden special items.
- 🗺️ 12×12 Grid Map — Collect resources from terrain tiles (mountains, rivers, forests, mines, labs, factories) and place defenses strategically.
- 🛡️ Daily Attack Cycle — Every 24 hours, a cosmic disaster strikes. Your team's survival is resolved mathematically:
$$ \sum_{i=1}^{n} D_i \ge \Lambda_{\text{disaster}} $$
Where \( D_i \) represents the individual defense values of structures deployed on the 12×12 grid, and \( \Lambda_{\text{disaster}} \) is the incoming cosmic hazard threshold. Survive and earn +20 bonus points.
- 🏆 Competitive Leaderboard — Track points, daily streaks, and Corrector Bonuses. Top players earn recognition.
- ♻️ Salvage Mechanic — Recover 50% of resources from old defenses to adapt your strategy. Refunds scale dynamically:
$$ R_{\text{recovered}} = \lfloor 0.50 \cdot C_{\text{craft}} \rfloor $$
- ⭐ Corrector Bonus — Replace a weak defense with a stronger one in the same category to earn +20 bonus points:
$$ S_{\text{player}} \leftarrow S_{\text{player}} + 20 $$
🛠️ How I Built It
💻 Tech Stack:
- Devvit Web — Reddit's developer platform for building interactive posts.
- Phaser 3 — For the 12×12 isometric map, particle effects, and attack animations.
- React — For the overlay UI (team status, inventory, crafting menu).
- Hono — Lightweight backend framework for API routes.
- Redis — In-memory database for state management (teams, HP, defense, inventory, points).
- TypeScript — For type safety and maintainable code.
🎯 Key Challenges:
- Grid-Based Defense Placement — Implementing a drag-and-drop system on a 12×12 grid where each cell can hold exactly one item required careful coordinate mapping and validation.
- 24-Hour Attack Cycle — Building a scheduler that automatically resolves attacks, resets team stats, and rotates planets every 24 hours without manual intervention.
- Corrector Bonus Logic — Tracking category maxima per team to detect when a player places a stronger item in the same category as an existing one.
- Salvage Mechanic — Ensuring resource refunds are calculated accurately based on gravity-adjusted crafting costs.
🚧 Challenges Faced
- ⚠️ Authentication & Deployment — The Devvit CLI had authentication issues early on, requiring multiple login attempts and a shift to Web Console installation.
- ⚠️ State Management — Keeping Redis keys consistent across API routes and Phaser scenes was challenging but essential for real-time updates.
- ⚠️ Manual vs. Auto Team Assignment — Balancing user choice with fallback logic to ensure no team is empty.
- ⚠️ Attack Animation — Syncing the Phaser scene with Redis state updates required polling and event-driven architecture.
- ⚠️ Deadline Pressure — Building a complete game from scratch in a few weeks, with all features working and polished, was the biggest challenge of all.
🏆 Accomplishments I'm Proud Of
- ✅ Fully Functional — A fully functional daily survival game deployed on Reddit.
- ✅ Dynamic Gameplay — 10 unique planets with dynamic gameplay modifiers.
- ✅ Discovery Elements — 30 recipes with hidden combinations for discovery.
- ✅ Interactive UI — Grid-based defense placement with real-time feedback.
- ✅ Automated Systems — Automatic 24-hour attack cycle with team survival mechanics.
- ✅ Deep Mechanics — Corrector Bonus, Salvage, and Daily Streak systems.
- ✅ Platform Compatibility — A polished UI that works on both desktop and mobile.
📚 What I Learned
- Devvit Development — Building for Reddit's platform is both challenging and rewarding. The community is supportive, and the documentation is improving.
- Phaser 3 — Creating an isometric grid with clickable tiles, particle effects, and animations was a deep dive into game development.
- Redis State Management — Designing a state schema that works across server and client was a valuable lesson in distributed systems.
- User Experience — Small details like toast notifications, visual feedback, and leaderboards make a huge difference in player engagement.
- Team Collaboration — Even as a solo developer, I learned to iterate fast, test frequently, and prioritize features.
🔮 What's Next
- 🚀 More Planets — Expand to 20+ planets with even more exotic properties.
- 🚀 PvP Mode — Allow teams to directly compete for resources.
- 🚀 Mobile App — Port the game to a standalone mobile experience.
- 🚀 Seasonal Events — Special challenges with unique rewards.
🙏 Special Thanks
The Reddit Devvit team for creating a platform that makes game development accessible.
The Phaser community for their excellent documentation and examples.
The hackathon organizers for this incredible opportunity.