So here we are — after three intense but awesome days of development, TriviaRush is officially alive and kicking (okay, maybe still getting its shoes tied, but definitely alive). What started as a basic Unity project quickly turned into a full-stack, fully dynamic, database-driven trivia game system — complete with a live leaderboard, admin interface, CSV-driven question pool, secure login, and enough cheeky sound effects to make any arcade jealous.
Let me break it all down for you, from game logic to server wizardry, in true behind-the-scenes fashion.

🎯 Core Game Logic (Unity + WebGL) – ~3 Days
From scratch, in Unity — I designed and built all the gameplay logic, wrote all the C# code, and created the UI and graphics. The game is a browser-based trivia experience, built with Unity 2022 LTS, targeting WebGL for compatibility across all modern browsers.
We’re talking:
- Smooth question transitions
- Bonus streaks (5 correct = double points 🔥)
- A dynamic timer that speeds up the music pitch when things get tense
- Particle FX, custom audio manager, scene fader, and full UX polish
- Modular design for maximum future flexibility
🔌 Server Setup – ~2 Hours
Deployed on my self-hosted dev environment running AlmaLinux 9, complete with Apache, PHP, and MariaDB. I’ve got Gitea self-hosted for version control and all commits are logged right there on my internal network.
Oh, and I run my own internal DNS — so no typing annoying IPs. Just https://triviarush.lab
, baby. 🔒💻


🧠 Dynamic Question & Answer System – ~1 Hour
Forget hardcoding your questions — I set up a CSV upload system where I can drop in a file, and the game immediately starts using the new data on the next load. No rebuild. No redeploy. Just upload and go. Admins rejoice.


Uses:
- PHP upload handler
- Server-side validation
- Unity’s
UnityWebRequest
to grab the CSV over HTTPS QuestionLoader.cs
parses the CSV and loads questions in real-time
🏆 Real-Time Leaderboard – ~1 Hour
- Player submits their name and score after finishing
- PHP saves it to a MariaDB table
- External Leaderboard.html page displays the top 10 scores live
All wired up via POST requests from Unity using UnityWebRequest
. There’s also anti-spam and duplicate protection on the PHP side to prevent score abuse (nice try, cheaters 😉).

🛠️ Admin Panel & Secure Login – ~1 Hour
My admin panel is clean, modern, and functional:
- Upload new questions (via CSV)
- Delete current question file
- Download the current question file for backup
- See total number of current questions
- Show last upload date and file size
- View logs of uploads, deletions, and logins
Secured with a basic but effective PHP login system using sessions and hash-verified credentials. (And yes, I’ll eventually move to hashed+salted passwords + 2FA for prod).


🚀 Hosting & Deployment
Currently hosted on my local home lab dev environment, but I’ll be pushing the full game to production soon — and it’ll be playable directly in your browser from the new “Games” section on DeclinedStudios.com (coming very soon).
Expect it to be sleek, secure, and responsive — playable from desktop and mobile browsers alike.
🧠 Future Upgrades Being Considered
- User accounts & persistent scoring
- Categories and difficulty filters
- Soundtrack selector 🎵
- Timed tournaments with prizes
- Full theming support (80s mode? Sci-fi mode? You got it.)
- Stats dashboard for players and admin
- Exporting results to CSV for analytics
- Multiplayer trivia battles 🤺
- Daily challenges with leaderboard resets
💼 Interested in Something Like This?
I offer custom development services — I can create and deploy systems like this for business, education, marketing, or just for fun. Whether it’s:
- WebGL games
- Interactive learning platforms
- Web applications
- Standalone Unity or Python/Java desktop apps
- PHP backends & databases
I can build it. I can host it. Or I can set it up on your equipment. Let’s make something epic together. Contact me here.
📬 Just reach out — I’m always open to discussing projects.
⚙️ Tech Stack Recap
- Unity 2022 LTS + WebGL
- PHP for backend scripting
- MariaDB for leaderboard database
- Apache + AlmaLinux 9 for hosting
- Self-hosted DNS + SSL via internal
.lab
domains - Gitea for version control
- JavaScript for interactive admin UI
- HTML/CSS for frontend polish
- Fully integrated AudioManager, SceneFader, and CSV parsing for runtime flexibility
🕹️ Play It Soon
Keep your eyes peeled at DeclinedStudios.com — TriviaRush will be going live soon under the Games section.
I’ll also be releasing the full system (Game + Admin + Leaderboard) for download or licensing, so if you’re looking for a head start on your own trivia empire — stay tuned.
1 thought on “How I Built a Full Trivia Game System with Unity WebGL, PHP, Leaderboards and an admin panel in 3 Days (and Why It’s So Much More Than Just a Game)”
Comments are closed.