# Grayhat Blog Tag: Gaming > Expanded public blog context for posts tagged Gaming. ## Page - [Gaming Tag](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/tag/gaming) - [Gaming Tag LLM Context](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/tag/gaming/llms.txt) - [Root LLM Context](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/llms.txt) - [Root Full LLM Context](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/llms-full.txt) - [Tag API](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/api/public/v1/tags/gaming) ## Tag Details - Slug: `gaming` - Description: Not provided - Post count in current snapshot: 6 ## Current Posts - [Wrap-up: Web Social Party Game Jam!](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/web-social-party-game-jam) - Grayhat's first national game jam was an absolute blast! Over 65 developers from 10 universities battled it out to create the best multiplayer card games using PlayroomKit—and the results were wild. Here's the full behind-the-scenes breakdown. - [Pixels to Players: How Good Game Designs are Executed](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/pixels-to-players-how-good-game-designs-are-executed) - Taking a game from an idea to reality is hard. How do you navigate through a sea of endless ideas and technologies, to deliver something... fun? - [Building a Unity Plugin in JavaScript](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/building-a-unity-plugin-in-javascript) - Make your JS Library compatible with Unity. - [Create Multiplayer Web Games, Faster](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/create-multiplayer-web-games-faster) - We built a React/Vite-powered game engine, powered by Playroom. - [Build games in Swift](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/build-games-in-swift) - Going down the memory lane of child play, I think of the days when the world seemed so much bigger from a little boy’s eyes playing Temple Run on a borrowed iPhone - a work of enormous wonderment. Lost in the labyrinth of my favourite video game, I yearned to be part of its magical universe. A single thought endlessly echoed in my mind: "How is this game created? I want to make games like this!" As the years passed and I grew, it was no surprise that I found myself on the path of a developer. W - [We built a multiplayer, web-based Mario-like game with PlayroomKit... in 7 days!](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/we-built-a-multiplayer-web-based-mario-like-game-with-playroomkit-in-7-days) - How we transformed an open-source single-player game to multiplayer. ## Child Route Content ### [Wrap-up: Web Social Party Game Jam!](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/web-social-party-game-jam) - Slug: `web-social-party-game-jam` - Published: 2025-04-28T18:41:28.000+05:00 - Updated: 2025-04-29T01:03:14.000+05:00 - Reading time: 7 min - Tags: Events, Game Design, Gaming, Unity, Playroom, PlayroomKit, Announcements, Multiplayer Gaming - Authors: Talal Ahmed Khan - Visibility: public ℹ️This is just the beginning for us.Picture this: **65 game developers**, **10 universities**, and **48 chaotic hours** to build multiplayer card games from scratch. Why did we do it? Simple—**to break things at scale.** At Grayhat, we’ve been building **PlayroomKit for Unity** for months—testing mechanics, debugging sync issues, taking the SDK to production (finally! 🥲) and pitching wild ideas to Little Umbrella. But why keep the fun to ourselves? ### **Get the bread** ✅ **Massive Playground for Experiments** We set the *exact same challenges* we face in client projects—multiplayer sync, turn systems, state management—and let **10x more developers** crash into them. The result? A goldmine of feedback, failed prototypes, and genius workarounds. (*Jou cheez hum kar rahay hain, wohi in say karwa kay dekho!*) ✅ **Direct Firehose of Talent & Ideas** No theory, no hypotheticals—just **raw, unfiltered game dev chaos**. Our team (@Talha, @Saad, @Talal, @Zohair) got to mentor, troubleshoot, and *be inspired by good ideas* (shhh) from jammers. Some of these concepts? **Mindstorm-level potential.** ✅ **Side Perks** - HR training? Check. (*Nothing teaches like a room full of panicked devs.*) - Marketing boost? Check. (*Nothing sells like screaming students.*) - PlayroomKit partnership leveled up? **Big check.** ### **Why NaSCon?** - **Lesser (not zero) logistical nightmares** (Islamabad = home turf) - **FAST-NUCES host team = instant synergy** - **Recruitment pipeline?** (*Hello, future Grayhat hires.*) Bottom line? **We didn’t just run a game jam—we weaponized it.** And this was just **our first time.** ### **The Game Judging Panel 👁️** The Game Jam’s submissions were evaluated by **Tabish Ahmed** and **Aaron (aka @swagshaw on Discord)** from **Playroom/Little Umbrella**, two key figures in the multiplayer gaming space. **Tabish Ahmed**, a co-founder of **Little Umbrella**, has been instrumental in shaping Playroom’s vision for accessible multiplayer game development. His background in product strategy in various FAANG companies (Google, Meta, Adobe) and developer ecosystems made him the perfect judge for assessing both technical execution and creative design. **Aaron (@swagshaw)**, Playroom’s Developer Advocate, is a well-known voice in indie game dev circles—especially on Discord, where he helps run the **Boss Rush Game Jam**. His deep understanding of gamejamming and hands-on experience gave him unique insight into how teams could leverage the SDK’s multiplayer features to build unique games. *(Next up: The full story of how 65 devs survived 3 days of multiplayer madness.)* 🚀 ## **Day 1: Learning, Brainstorming & Chaos** 📍 **Venue:** FAST-NUCES, Islamabad - **9:00 AM:** The FAST-NUCES host team arrived, setting up projectors, decorations, and (most importantly) water bottles. - **12:00 PM:** Participants rolled in—some confident, some nervous, all excited. - **Problem Statement Drop:** "Build an original multiplayer card game. No Uno clones!" (We had to enforce this *multiple* times.) - **Workshop Time:** The Grayhat team, spearheaded by **Talha Momin**, ran a **PlayroomKit deep dive**, explaining multiplayer sync, game states, and how to avoid disasters. - **Most Chaotic Moment:** A last-minute Wi-Fi firewall problem forced some teams to **hotspot from their phones**. By evening, teams had rough prototypes—some functional, some… *experimental*. *****The "How to use PlayroomKit" Workshop, delivered by Talha Momin (Software Engineer 1) ## **Day 2: Build Day** 🕒 **9:30 AM:** Host team arrived 🕒 **10:30 AM:** Teams returned, looking slightly more tired but determined. - **The Great Multiplayer Struggle:** Many teams hit roadblocks with PlayroomKit syncing.- *"Why does my card disappear when I play it?"* - *"Why is my opponent seeing a different hand?!"* - **Grayhat to the Rescue:** Volunteers ran from table to table, fixing bugs and calming nerves. - **Underdog Story:** Team *"Anicards"*—who had zero Unity experience before the jam—somehow built a working animal battle card game. Legends. By **2 PM**, exhausted but hopeful, teams left to polish their games overnight. ****Day 2 was mostly about coding, and collaborating ## **Day 3: Judgement Day** 🏆 **8:00 AM:** Final sprint—some teams arrived **early**, frantically fixing last-minute bugs. - **9:00 AM:** Judges arrived (Grayhat on-site + Playroom online). The pressure was *on*. - **Judging time:**- *5th Ace* had judges super impressed with a well thought out genre-blender game. - *Anicards* – Well, at least it worked! - *Others – *mostly submitted half-baked designs and implementations. But understandable given the duration of the event. - **Winner Announcement:**- **🥇 1st Place:** *5th Ace* (PKR 50,000) – "A genius social deception game!" - **🥈 Runner-Up:** *Anicards* (PKR 30,000) – "Simple, polished, and fun!" - **Most Emotional Moment:** The *Anicards* team (all first-time Unity users) **celebrated like they’d won the lottery**. ## **What Participants Said** Here's the real, unfiltered participant feedback from the Game Jam, presented clearly and honestly: ### Participant Testimonials: The Good, The Bad, and The Real The Frustrations*"PlayroomKit is not good - it doesn't make game dev easy. We spent hours just trying to get basic multiplayer working."* *"My cards remained static and unplayable even though I made sure they were copied prefabs from the original. After analyzing the code for hours, I had to change my entire strategy."* *"The introduction of PlayroomKit was a surprise that threw us off. We needed at least a week to properly learn it before competing."* The Technical Challenges*"Biggest struggle? Definitely PlayroomKit integration. The initial setup was confusing and we lost valuable time."* *"We're newbies and making a multiplayer game without prior experience is hard. The documentation wasn't enough for beginners."* *"The Discord activity integration was unclear. A short tutorial would have helped immensely."* The Positive Experiences*"The mentors were incredibly helpful. When we were stuck, they came to our table and solved our issues personally."* ("Anicards" team member) *"Despite the challenges, I'm now fully entering game dev because of this event. The hands-on experience was invaluable."* (Enthusiastic participant) *"Card designing was the most enjoyable part for me. Seeing our creations come to life was rewarding."* (Anonymous artist) Suggestions for Improvement*"Don't limit developers to specific tools. Let us use what we're comfortable with."* (Anonymous developer) *"Announce required SDKs at least 3 days before the jam. Learning new tech during competition is stressful."* ("Doctor vs Virus" team) *"More time! Two days isn't enough, especially when learning new tools. A 5-day jam would be better."* (Multiple participants) The Real Talk*"Nascon management was terrible. But the Game Jam organizers themselves were great - responsive and helpful."* (Blunt participant) *"There's nothing a student enjoys more than staring at Visual Studio for 3 hours, taking a break, then staring for 3 more. 10/10 would do again."* (Sarcastic but dedicated participant) *"The competition felt like 50% game dev and 50% wrestling with external tools. More focus on actual game creation would be better."* (Experienced participant) The Silver Linings*"Even though we didn't finish, we learned so much about multiplayer sync that we couldn't have learned in classes."* ("Cards Clash" team) *"The Q&A session at the end was super helpful for understanding what we did wrong."* (First-time jammer) *"Seeing our simple animal battle game actually work in multiplayer was magical. Worth all the frustration."* ("Anicards" team) 📉 **Biggest Struggles:** - **Multiplayer sync issues** (of course) - **Confusing PlayroomKit setup** (npm + Unity = headaches) - **Time pressure** (many teams couldn’t finish in the short duration) ## **Key Takeaways** ✅ **PlayroomKit is dope but needs better docs & templates.** ✅ **Multiplayer is HARD.** (But rewarding when it works.) ✅ **Original ideas win.** (No Uno clones made it to finals.) ✅ **Mentors = heroes.** (Shoutout to the Grayhat squad.) ## **What’s Next?** 🔜 **More Jams, More Games:** We’re already planning the next one—bigger prizes, smoother onboarding, and maybe even a **Discord integration challenge**. 🚀 **For Playroom/Little Umbrella:** - **Better Unity docs** (please!) - **One-click starter templates** (save us from npm hell) - **Native build support?** (WebGL is cool but limiting.) 🎮 **For Participants:** Keep polishing those games—some of these deserve a real release! ### **Final Words** Huge thanks to: - **FAST-NUCES** for hosting. - **Playroom/Little Umbrella** for the SDK + judging. - **All participants** for the chaos, the memes, and the awesome games. **Missed this one? Don’t worry—we’re just getting started.** 🚀 ## **Play the Winning Games** ### The 5th Ace (Winner 👑) **Team:** Neva **Playable Demo:** https://5thace.playroom.gg **Concept:** - A **social deduction card game** blending bluffing and strategy. - Players alternate roles: *Liar* (creates false card combos) vs. *Detective* (calls out bluffs). - Power-ups add meta-layers to deception. **Why Explore Further?** - Proven fun factor with minimal assets (Minecraft-inspired UI). - Scalable for Discord’s social ecosystem. - Potential to expand with themed decks (e.g., cyberpunk, fantasy). Unity WebGL Player | 5th Ace*5th Ace### **Anicards** (Runner-Up 🥈) **Team:** Red Team **Playable Demo:** https://anicards.playroom.gg **Concept:** - Animal-themed **asymmetric battle game** where cards represent creatures with unique powers. - Lightweight but functional multiplayer sync via PlayroomKit. **Why Explore Further?** - Simple core loop ideal for quick sessions. - Easy to reskin for educational/children’s markets. - Could integrate NFT-style collectible animals. Unity WebGL Player | ANICARDS*ANICARDS### **Other Game Jam Submissions (Non-Winners)** - **Doctor vs Virus** *(Learning Squad)*- Asymmetric card game: Doctor (heals) vs. Virus (infects organs). - **MCards** *(Usama)*- Multiplayer solitaire-style card game. - **Solo Leveling: Hunters Unleashed** *(Lada)*- Fast-paced boss-battling card game with gear/summon mechanics. - **2Q (Monster Duel)** *(2Q Team)*- Turn-based monster battle with elemental strengths/weaknesses. - **Cards Clash** *(Ziki Team)*- Unfinished card combat game (concept only). - **Unnamed Card Game** *(NebrasAssad)*- Attempted dynamic card system with prefab issues. ### [Pixels to Players: How Good Game Designs are Executed](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/pixels-to-players-how-good-game-designs-are-executed) - Slug: `pixels-to-players-how-good-game-designs-are-executed` - Published: 2024-08-14T23:04:07.000+05:00 - Updated: 2024-08-15T11:11:02.000+05:00 - Reading time: 6 min - Tags: Game Design, Product Design, System Design, Design, Gaming, Multiplayer Gaming, Playroom, PlayroomKit, Development, Software Engineering - Authors: Maaz Tariq - Visibility: public ** Great video games are like great books or movies; they resonate with us because they reflect our own experiences, dreams, and fears Like a composer crafting a symphony or a painter stroking onto their canvas, designing a game is a similar creative endeavour to any other art. There are no ways to design a game and a million ways to create one simultaneously. Making a good game is like making a good movie, it is supposed to be an experience one goes through that leaves an impact and gives a new perspective. Crafting together a piece of media that can deliver enough sentimental value to keep players coming back, that is what game design is all about. ## Making your Game Relatable One of the key aspects of making a moving art piece is adding elements in the piece that help the audience relate to it. When one sees another character going through situations they have gone through in real life, it develops a bond with the character. This pattern is commonly seen with anime protagonists having very relatable personality traits or situations in even a supernatural world. ** It should be the experience, that is touching. What I strive for is to make the person playing the game the director ***- Shigeru Miyamoto*** *****Papers, Please****Invoking that feeling of relatability is a key part of keeping the players coming back. A good example of executing this strategy is “Papers, Please”. To say very loosely, it's a game about checking and approving documents. A very simple premise, but it is a hit game because the way it sets the mood and develops the scene is very natural. It reminds you of a paperwork-heavy office, it makes you feel like an actual clerk with all the tediousness that comes with it. flipping through pages to check for rules, the applicant’s documents missing or fraudulent cards and ID cards and you have to manage all this junk under a time limit. The authenticity of the experience sells the game. *****Katana Zero****The experience we want to invoke is not limited to experiences our player has personally experienced but also seen others experience in their vicinity. The video game “Celeste” does an excellent job of explaining what depression feels like to people who haven’t experienced it, helping them understand people who suffer from depression. “Katana Zero” is a game with an excellent storyline. It explains the struggles of a soldier dealing PTSD in a very supernatural, ongoing conspiracy theory setting. After going back and forth with some product teams, I've learned that this goes hand-in-hand with KYC (Know Your Customer). Something which might help you to narrow down an idea is to first do some bare-bone **audience research. **Who is the target audience you have the most access to, whether in your friends circle, community, or in your company's easiest access? What is daily life for them, what is entertainment, what makes their heads turn? Just some raw data from here, organized and transformed into a "player persona", can act as a prompt for you to brainstorm some better ideas - Then you can easily validate or verify your ideas by just bouncing them off of that persona. (you can even reach out to an audience member and present ideas to them) ## Using the Right Tools Invoking experience is one of, if not the greatest, priorities for a game designer. The designer must have tools capable enough to pull off the ideas they draft. A designer’s canvas is the engine they use. The way you cannot achieve on a smaller canvas what you can on a larger one. You cannot do things on an engine that is incapable of following through with the mechanics of your design. More often than not, the development-end of game-building is almost as artistic as the design side. It makes sense, given that you need to create a world which truly captures the emotion conveyed in the game, or at least having enough helpful snippets which can keep the code clean while building out the game. This usually drives companies to build custom game engines, or at least base them off of existing ones. Many times, technological advances are the reason for designing new experiences to human entertainment. Grayhat's npm package "create-multiplayer-game" is built to speed up the development process and simplify implementing game designs. We use it thoroughly when building out game prototypes - However, by the time the game reaches production, the engine does take a beating. But we use the new findings to improve the engine once more. The package aims to streamline the creation of React-based (more coming in the future!) multiplayer games, making it easier for developers to focus on the creative aspects of game design rather than being limited by technical challenges. *create-multiplayer-game (CMG) does lots of heavy lifting for you. It provides you with prebuilt modules so you don’t have to reinvent the wheel every time. CMG provides a silent router, letting you change game phases without any changes in the URL bar. This makes the game-flow entirely in control of the game itself and handles the possibility of cheating by messing with the URL to switch phases. It also has its own loading module which can show what file is being loaded in real time. All in all it has the essential parts of a video game for any kind of game prebuilt, so you can focus on the design instead of the execution. ## Learning from Retrospective “Meme, Chat, Robots” has a user interface and design similar to Meta apps. When talking about the game with Saad Bazaz, I learned Meme, Chat, Robots’ UI was designed by a talent at Meta. Using Radix, helps us make reusable components that can be used throughout the project, giving it a coherent look and feel. Addition of a silent react-router, one that can route to different pages without showing changes in the URL. While seemingly a small change, it makes a substantial difference for video games. A video game has to follow a game flow, unlike apps where users can go to whatever page they like. moving from stage 1 to stage 2, or from a cut-scene to gameplay requires a game flow that cannot be tampered with from the URL. ## Get Your Hands Dirty As a game designer, your tools are the technologies and languages you build games with and your canvas is the game engine you use. To translate your designs into the game, you will have to know how the game works. How it's built and why it does what it does. You can’t get away with skipping learning a phase of development, learning development helps the design be grounded and realistic. *## Recycle your Trash There’s no such thing as bad ideas. I have used parts of stories and themes I wrote in my high school essays in complete products! Stories and ideas that don’t seem like a good fit are just in the wrong place. Always save your drafts and keep them close whenever you want to brainstorm a new theme or look for your game. Have different folders for all kinds of media you draw inspiration from, then try to fit them to any future projects. Make different folders for music and art and keep adding any ideas in those folders. ** The first mark on an empty canvas is the most difficult to make Having a stash of resources like these help you form your first stroke on a blank canvas. ## Verdict As daunting as designing a video game may seem, following only a couple of principle can guarantee an interesting result. Trial and error is part of the game, like any design process. Pair it with some direction and you’re good to go! Here’s a small recap: - Design the experience, not the app - Bind real-life experiences with the video game’s experience - Use a capable game engine, that fits your game aesthetic and can pull off your design - Learn and apply from previous projects, embrace failure - Learn and experience every part of the dev process firsthand Now building the latest video game, I have learnt a few more lessons to help me contribute to CMG. Stay tuned for more in-depth articles discussing game design and CMG! ### [Building a Unity Plugin in JavaScript](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/building-a-unity-plugin-in-javascript) - Slug: `building-a-unity-plugin-in-javascript` - Published: 2024-05-04T14:21:06.000+05:00 - Updated: 2024-08-31T13:07:31.000+05:00 - Reading time: 6 min - Tags: Development, Gaming, Multiplayer Gaming, Software Engineering - Authors: Talha Momin - Visibility: members **Playroom for Unity is open-source. Check it out here: https://github.com/asadm/playroom-unity**Interested in trying out Playroom for Unity? Check the docs! Join the Discord channel too in case you need help, you'll find me lurking there sometimes. 😁Creating a game is no easy task, and crafting a multiplayer experience adds an even greater level of difficulty. But thanks to industry experienced developers who've created numerous tools which make the process of creating multiplayer games easier and more productive, developers can now focus on creating fun and immersive experiences for their users, and not worry about the networking side. One growing platform for this purpose is PlayroomKit by Playroom, which mainly focuses on multiplayer web-based party games. I'm a Unity Developer, so I've had my eyes on similar multiplayer plugins for quite a while. Some of them are: - **Normcore:** https://normcore.io/ - **Photon:** https://assetstore.unity.com/packages/tools/network/photon-unity-networking-classic-free-1786 - **PlayFab:** https://learn.microsoft.com/en-us/gaming/playfab/features/multiplayer/lobby/lobby-matchmaking-sdks/multiplayer-unity-plugin-quickstart - **Hathora:** https://hathora.dev/ One of my biggest complaints (and the community's) is how hard it is to get things up and running with these libraries. All that previous knowledge helped me, when I had to implement a plan to create PlayroomKit for Unity, keeping the objective in mind, making sure I didn’t hurt Developer Experience, and using my knowledge in Unity and hacking around in C# and JS. ### The Goal **Combine the ease of PlayroomKit with power of the Unity engine.The PlayroomKit package is super simple to get started with… in JS, at least. That’s a developer experience we needed to port to Unity. At the same time, we had to make the Unity library at feature parity with the JS library, following the exact same API. (That makes it easier to write docs, at least 😃) Here our first **problem** arises which is quite easy to pinpoint: Unity uses C# and PlayroomKit is a JavaScript package. So some interoperability had to occur. To achieve this, we had the following approaches: - Convert the JS library to C#, or, - Use a JavaScript Interpreter for .NET (JINT), or, - Use the Interaction with browser scripting provided by Unity itself. **If you want to go deeper into the thought process of “why” we went with our final approach, I highly recommend reading Playroom’s official blog on this very topic.### The Approach We went with the **third approach**, referring the Unity docs. In short, the workflow is like this: - We work with 2 files: a JSLIB (JavaScript Library) and C# class. - The JSLIB file acts as a bridge between PlayroomKit (or any other JS library) and C# (Unity) *What I call "The Bridge".The figure above shows basic working of the system. ### Problem 1: Passing Data The Unity documentation shows an example where the primitive datatypes are being used to pass data between C# and JS. This process of converting is known as: ***Marshalling.** This process involves converting an object's memory representation into a format suitable for storage or transmission, especially across different runtimes.*The documentation gives us a good starting point with examples for the basic datatypes: Hello: function () { window.alert("Hello, world!"); }, HelloString: function (str) { window.alert(UTF8ToString(str)); }, PrintFloatArray: function (array, size) { for(var i = 0; i > 2) + i]); }, AddNumbers: function (x, y) { return x + y; }, StringReturnValueFunction: function () { var returnStr = "bla"; var bufferSize = lengthBytesUTF8(returnStr) + 1; var buffer = _malloc(bufferSize); stringToUTF8(returnStr, buffer, bufferSize); return buffer; }, And in C# we will define the functions like this: [DllImport("__Internal")] private static extern void Hello(); [DllImport("__Internal")] private static extern void HelloString(string str); [DllImport("__Internal")] private static extern void PrintFloatArray(float[] array, int size); [DllImport("__Internal")] private static extern int AddNumbers(int x, int y); [DllImport("__Internal")] private static extern string StringReturnValueFunction(); To use these functions, we can call them like so: void Start() { Hello(); HelloString("This is a string."); // sending a string to JS float[] myArray = new float[10]; PrintFloatArray(myArray, myArray.Length); int result = AddNumbers(5, 7); Debug.Log(result); Debug.Log(StringReturnValueFunction()); }Now this is all great, but the issue arises when we have to deal with async code or functions with callbacks. ### Problem 2: Async Code or Callbacks?! There are great discussions on the Unity Forums regarding using async functions and for passing callbacks as well. In the case for PlayroomKit, instead of using async / await, we went with providing callbacks, (PlayroomKit already provides callback parameters wherever required). The pattern here is something like so: ### [Create Multiplayer Web Games, Faster](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/create-multiplayer-web-games-faster) - Slug: `create-multiplayer-web-games-faster` - Published: 2024-05-04T10:31:32.000+05:00 - Updated: 2024-08-31T13:41:49.000+05:00 - Reading time: 2 min - Tags: Development, Multiplayer Gaming, Gaming, JavaScript, Developer Tools - Authors: Syed Abdullah Nasir - Visibility: public **Open-source Product Announcement! Check out create-multiplayer-game on NPM and GitHub. Currently in alpha.***Imagine this**...* You have a great idea for your next indie game, and since the world is online-first, you dive into the world of multiplayer game development, but you want to skip the tedious setup process. Sockets? Firebase Realtime DB? Eventually, you give up on multiplayer, and focus on building a great single-player experience first. When you do, and you put off multiplayer to the end, you end up having to refactor a lot of code to make it "multiplayer-ready". What if games were built **multiplayer-first**? That's why we built a React/Vite powered game template, powered by Playroom. It swiftly conjures up a multiplayer game template in React, so you can focus on bringing your gaming vision to life. npx create-multiplayer-game@latestIt will ask you a few small questions to personalize your game. Have a look. *Works great with macOS and Linux.**Name Your Game: **First off, we need a name for your masterpiece. What will you call it? **Project Name: **Need a project name, or are you happy with the default generated one? Feel free to customize it as you like! **Choose Your Template: **Now, which template suits your fancy? Use your arrow keys to browse the options: *Option A:* "vite-react-ts": A ReactJS project with Vite, crafted in TypeScript. It's equipped with PlayroomKit for multiplayer magic, along with an array of game components, sounds, and interactions. Usually the top choice. *Option B:* "next-ts'': A NextJS project in TypeScript, powered by PlayroomKit for multiplayer functionality. Once you've made your choice, sit back as we download your selected template. Then, you'll be greeted with a message: "Project initialized at . Happy Coding!" ### What's next? - We're building a mechanism for you to keep updating your game, as we improve our templates. - We're building a useful Chrome DevTool for debugging game states (no more hardcoding or adding "cheats" to go forward in a game). - Some premium templates with some extra goodies. Read more here: https://grayhat.studio/games/pricing *We love open source, bringing useful tech to builders, and contributing to the overall knowledge stream. A lot of our work is R&D-based and on experimental tech. If you're interested in working with or for *Grayhat*, DM or comment!* **This article was authored by** Syed Abdullah Nasir, **Software Engineer at Grayhat.** ### [Build games in Swift](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/build-games-in-swift) - Slug: `build-games-in-swift` - Published: 2023-09-27T16:07:00.000+05:00 - Updated: 2024-05-14T13:13:06.000+05:00 - Reading time: 4 min - Tags: Development, Gaming, Swift, Apple, Apple Developer, Multiplayer Gaming, iOS, Playroom, PlayroomKit - Authors: Anonymous - Visibility: public *Apple is making moves into the gaming world. You might want to prepare yourself for it.Going down the memory lane of child play, I think of the days when the world seemed so much bigger from a little boy’s eyes playing *Temple Run* on a borrowed iPhone - a work of enormous wonderment. Lost in the labyrinth of my favourite video game, I yearned to be part of its magical universe. A single thought endlessly echoed in my mind: "How is this game created? I want to make games like this!" As the years passed and I grew, it was no surprise that I found myself on the path of a developer. With each step, I honed my skills and explored various avenues. But destiny had a plan of its own, and it led me to the realm of Swift. *Perhaps the little boy within me had awakened to redirect me to a path I was destined to tread.* And there, I discovered Swift, Apple's remarkably user-friendly programming language, waiting to breathe life into those long-cherished dreams. As Apple dives further into entertainment and gaming with hardware like the VisionPro, and with its own custom M1 chips, we may see a surge of Apple-native gaming engines, a more refined Unity and Unreal, machine learning frameworks, and perhaps, a new era of desktop and mobile gaming with Apple. Let’s step into the world of gaming in Swift, uncovering the tools, frameworks, and tips that make it an exciting journey for budding game developers. ### Starting off with a simple, thought provoking question - why Swift? **Blazing fast performance. **Like a high-performance sports car in the programming world, it is built for speed and efficiency. When it comes to gaming, performance is key, and Swift ensures your games run seamlessly and without a hitch. Swift is optimized for Apple, and ships natively for all OSes - iOS, iPadOS, macOS, watchOS, to name a few. **Go beyond Apple devices. **Originally designed for Apple gadgets, Swift has spread its wings. You can use it to create games not only for iOS and macOS but also for other platforms, reaching a broader audience. Making a greater impact. **Seamless integration. **It plays harmoniously with Apple's tech toolbox, including SpriteKit, SceneKit, and ARKit. This synergy simplifies game development, letting you harness cutting-edge features with ease. ### How does an app dev do game dev? Game development is pretty similar to app development - it just involves more creative processes, however these can be easily mapped to one's app development pipeline: - **Idea Generation: **Start with a spark of inspiration. Think about what kind of game you want to create. Is it a mind-bending puzzle, an adrenaline-pumping action-adventure, or perhaps a captivating simulation? - **Designing Gameplay: **Outline the rules, objectives, and gameplay mechanics. Consider how players will interact with your game world. - **Coding with Swift: **Dive into Swift to bring your ideas to life. Write the code that powers your game mechanics and characters. - **Testing and Tweaking: **Games evolve through testing. Playtest your game, gather feedback, and make improvements. - **Polishing Graphics and Sound: **Create captivating visuals and immersive audio to make your game come alive. - **Launching Your Creation: **When your game is ready, launch it and share it with the gaming community. Embrace player feedback to enhance your creation. While Swift is a great choice for game development, like anything in life, it certainly its has its cons, I have enlisted some below: - Platform Limitations: While Swift has expanded its horizons, it's still primarily associated with Apple platforms. - Types of Games: Swift seems better for* point-and-click *games, *puzzle *games, and games with native UI. Swift may not be a good choice for complex games involving interactions and physics-based game mechanics. While there are open-source game engines in Swift like GateEngine available, their support is limited and it's just good for pet projects. - Learning Curve: Learning Swift and game development can be a bit challenging, especially for beginners. - Resource Availability: The Swift game development community is smaller compared to other game development languages like Unity or Unreal Engine. On the flipside, opting for a native programming language like Swift over web technologies offers several advantages: - Performance: Native languages are finely tuned for specific platforms, delivering superior performance compared to web-based technologies that run in a web browser. - Access to Hardware: Native languages have direct access to hardware resources, enabling more efficient utilization of device capabilities such as graphics and sensors. - Offline Play: Native games can be enjoyed offline, ensuring a seamless gaming experience without needing an internet connection. - Platform Integration: Native languages offer deeper integration with platform-specific features and libraries, resulting in a more polished and immersive gaming experience. Taking Swift game development a step further, my team built PlayroomKit's SDK for Swift, enabling easy multiplayer between platforms. This groundbreaking advancement involves wrapping a JavaScript SDK in Swift, providing you with the ability to seamlessly incorporate web technologies into your Swift-based games. This, in turn, opens up opportunities for cross-platform gameplay, expanding your game's reach to even greater heights. To showcase the power of PlayroomKit, we integrated it into a TicTacToe game. Simple, yet engaging. The result? A fun and interactive gaming experience that seamlessly combines the best of both worlds: Swift and web technologies. Swift - a secret doorway to your (*I mean* *our)* game development dreams. Whether you're painting 2D wonders with SpriteKit, exploring 3D universes with SceneKit, or unleashing your creativity with Metal, Swift equips you with the tools to make your gaming visions come alive. With passion, creativity, and a bit of Swift know-how, you're set for an incredible journey into the world of game development. Get ready to craft experiences that captivate players, bring joy, and make your mark in the gaming universe. It's time to let your gaming adventures begin! **Author:** Engr Sajid Khalil **Editor:** Fatima Majid ### [We built a multiplayer, web-based Mario-like game with PlayroomKit... in 7 days!](https://grayhat-company-blog.grayhatstudio.workers.dev/blog/we-built-a-multiplayer-web-based-mario-like-game-with-playroomkit-in-7-days) - Slug: `we-built-a-multiplayer-web-based-mario-like-game-with-playroomkit-in-7-days` - Published: 2023-08-09T16:51:00.000+05:00 - Updated: 2025-10-12T20:37:37.000+05:00 - Reading time: 5 min - Tags: Multiplayer Gaming, Playroom, PlayroomKit, Gaming, Innovation - Authors: Saad Bazaz, Anonymous - Visibility: public To play the game, open this link on a laptop or TV: https://cast-app.vercel.app/ *Update: *We've now proudly open-sourced this project! Repository: https://github.com/grayhatdevelopers/platformer.ai *“The best articles are the ones with clickbaity titles.” - Unknown* We’ve been grinding our gears for 2 years at Grayhat, trying to get into games. Sure, we love web development and making the best products for our clients. Sure, we’ve built things in low-level vanilla JavaScript (at that point I would’ve loved me some chocolate JS) which haunt me in my sleep every night. But that doesn’t beat the fun in games, does it? We tried everything; Unity. Unreal. ThreeJS (we even tried building a game engine in ThreeJS - more on that later). The toughest part? **Multiplayer**. Every single time. Sure, we got some good, choppy single player working. But when it came to having more people join the fun, the logic just didn’t scale. This year, we made a resolution to try something new. We brushed off the trusty ol’ game engine, Phaser3, and explored some interesting new tech for multiplayer - **PlayroomKit.** *(I mean, we’re not biased towards it. There are a lot of great solutions out there - it’s just that this is the one we helped build.)* It’s not really something new unless we give ourselves an insane challenge, is it? So here goes… A multiplayer Mario-like game in 7 days. 7. *Multiplayer.* ## Day 1 - Inception: *“We’ll have to start by building a Mario-like game.”* *“Last I heard, my job title wasn’t ‘Wheel Inventor’. Let’s try something else...”* We usually build upon the shoulders of giants, and this time was no different. We found some cool code for Mario in Phaser3 on GitHub. The code comments were in Chinese, so it took some translation with ChatGPT to understand what it meant. We studied the refreshingly-nice documentation for PlayroomKit. Given that our objective was a classic platformer game, the Phaser example gave us a good high-level overview of how the game would work. PlayroomKit's Stream Mode makes your game act like a typical game console - A separate screen plays the game, while the phone(s) are simply controllers. We found that was a nice option for our Mario game, since the classic feel of the NES is really hard to replicate on a phone’s tiny 5” screen. ## Day 2 - Masters of Puppets We ran the project, and fell into the classic dilemma. As a software engineer, it feels easier to rebuild a project from scratch because it makes the code feel more like you. That keeps you safe and comfortable. I feel like the sign of a good software engineer is their ability to play with the cards they get and make the best out of it. I think of it as *iterative rebuilding* - use the right practices *going forward*, and *refactor* things which get in your way. Sort of like a long antibiotics course. In our case, the code structure was great - but to actually have the player move whenever the controller on PlayroomKit was moved, we thought we might have to dive deep into the game logic. Fortunately for us, we had a short brainfart - We could simply **simulate keypresses **within the game. I knew for a fact that game engines had such options, to account for bot players, and for automated testing. I’d seen a similar concept being used in Google’s own blogs, where they simulated keypresses on Chrome’s Dino Game. So we created a basic Phaser KeySimulator, and hooked it up with our phone controller: // Simulate pressing a key simulateKeyPress(keyCode) { const keyObj = this.input.keyboard.addKey(keyCode) keyObj.isDown = true keyObj.timeDown = this.time.now keyObj.isUp = false keyObj.timeUp = 0 this.input.keyboard.emit('keydown') } // Simulate releasing a key simulateKeyRelease(keyCode) { const keyObj = this.input.keyboard.addKey(keyCode) keyObj.isDown = false keyObj.timeDown = 0 keyObj.isUp = true keyObj.timeUp = this.time.now this.input.keyboard.emit('keyup') } // An example of simulating the UP key for 1 second simulateKeyPress(Phaser.Input.Keyboard.KeyCodes.UP) setTimeout(() => simulateKeyRelease(Phaser.Input.Keyboard.KeyCodes.UP, 1000)That was it. No need to change controls deep down - We just puppeteered it from the top! ## Day 3 - Powering Up We whipped up a simple SNES controller using some great code from Codepen. We hooked the buttons with PlayroomKit’s state logic and started sending “inputs” from the controller to the cast screen. See the Pen SNES Controller by Tim Pietrusky (@TimPietrusky) on CodePen. So far, we’d gotten single-player to work. Game running on laptop, controller running on phone. *Some problems: 1. It was only single-player. 2. We had no way to automate testing. We had to play the game every single time to test every feature. ## Day 4 - Luigi: Our idea was to have a free-for-all of players filling the game, to test the limits of the PlayroomKit SDK. The original game’s code didn’t agree - it was built solely for a single player. ### Hardcoding: The first step to a good experiment is dummy data - you can’t tightly couple yourself in long implementations unless you know what you’re doing. In our case, it meant adding a second hardcoded player. After some blood, sweat and tears, and adding comments wherever we broke stuff, we were able to add a second, albeit quite diseased, player to the game, and make it perform actions based on a second player (also hardcoded). ## Day 5 - Multiplayer Mayhem: If it works for 2, it should work for 20. We took a dive and replaced the hardcoded second player with some more generic logic which allowed an “array” of players to exist simultaneously, each with its own logic. This took multiple breaks of the code and a lot of overtime, but the results? Worth it. *## Day 6 - Field Test: It was time to put the guinea pigs up to the test. *The chaos which ensued was exactly what we were looking for. ## Day 7 - Deployment We decided we’d had enough of juggling two repositories - one for the cast screen in Phaser3, the other for the controller in React - so we built a Turbo monorepo to make things easier to deploy, manage and test. Installation was pretty straightforward - until we got the genius idea to standardise Node versions across the two projects. There went our day. Vercel’s got great support for Turborepo, so deployment was a breeze. ## A noob's overview Making games multiplayer has always been a hassle, and it's a huge barrier-to-entry for emerging game devs and studios. For Grayhat, PlayroomKit was the key for a rag-tag group of web developers to explore game dev at warp speeds - no need to worry about infra anymore, we could now focus on making games look appealing and engaging. That's the whole point. Apps can survive bad UI/UX to a certain extent. Games can't. If your game isn't fun, no one is going to even consider it twice. But that kind of craft takes time, and when you're spending hours figuring out why your networking code is sending corrupt data, you're either gonna spend big bucks, or a lot of hours. We have neither. Sure, PlayroomKit has its pitfalls - there's a huge roadmap ahead with tonnes of work to be done. But I understand that it's early stage tech and there's a lot of potential in it. The Playroom team already has a huge list of amazing features, like built-in lobbies and joysticks, and we love being part of the journey. I'd put it as simply as: **It's the Firebase of game development.## Parting words 🚀 Have you tried game dev? What are the challenges you've faced? Would you like to read more about stuff like this? DROP A COMMENT! *Disclaimer:* We do not own the rights over any characters or any resemblance of the characters depicted in the game. This experiment was purely for fun and to learn, and we do not have any commercial benefit from it.