Lumi Snake .io
Thank you for purchasing Lumi Snake .io! This premium documentation covers everything from basic server installation to advanced game modifications. Whether you are a beginner looking to host a game, or an advanced developer wanting to mod the AI, everything is explained in detail below.
Core Features Highlight
- State Machine AI Bots: Intelligent bots that evaluate threats, hunt weaker players, and forage for food.
- Real-Time Multiplayer: Fully integrated Firebase support for low-latency online room matchmaking.
- Kinematic Rope Physics: Beautiful procedural physics for pendants and accessories attached to the snakes.
- Secure Admin Dashboard: Encrypted backend panel using PHP BCRYPT to control the game configuration.
- Skin Creator PRO: Included standalone HTML tool to visually generate code for new snake skins and custom glowing text plates.
- Fully Commented Engine: Clean, un-minified JavaScript engine (game.js) for easy developer customization.
2. Server Installation
Lumi Snake .io requires a standard web hosting environment that supports PHP (like Hostinger, cPanel, or Plesk). No database (MySQL) is required for the installation!
- Download the `.zip` file from CodeCanyon and extract it to your computer.
- Locate the
Game_Filesfolder inside the extracted directory. - Log in to your hosting provider's File Manager (e.g., Hostinger hPanel or cPanel).
- Navigate to your public directory (usually
public_htmlor the folder of your specific domain). - Upload all the contents of the
Game_Filesfolder directly into this directory.
3. Security Setup (The Gateway)
For maximum security, the game configuration is locked completely until you generate an encrypted Master Password. Players cannot access the Admin panel until this step is complete.
- Open your web browser and navigate to your website's installation path:
https://your-domain.com/install.php - You will see the Setup Wizard screen.
- Type a secure password (minimum 6 characters) and confirm it.
- Solve the simple Anti-Bot Math CAPTCHA.
- Click Install & Create Password.
core_auth.php, and then permanently deletes the install.php file from your server to prevent hackers from resetting your password in the future.
4. Firebase Multiplayer Setup
To enable real-time multiplayer functionality, you need a free Google Firebase account. If the keys are left empty or default in the admin panel, the game will smartly fallback to "Solo Mode" with offline AI Bots.
- Go to the Firebase Console and log in with your Google account.
- Click Add Project, name it "Lumi Snake", and click Continue (you can disable Google Analytics for this project).
- Once the project is ready, go to the left sidebar and click Build > Realtime Database.
- Click Create Database. Choose your nearest server location and start in Test Mode.
- Go to the Rules tab in the database and ensure both read and write are set to true:
{ "rules": { ".read": true, ".write": true } } - Click Publish.
- Now, click the Gear Icon ⚙️ next to "Project Overview" in the top left and select Project settings.
- Scroll down to "Your apps", click the Web icon (
</>), register your app, and you will see your firebaseConfig keys block. - Copy these keys (apiKey, authDomain, databaseURL, etc.) and paste them into your Lumi Snake Admin Dashboard!
5. Using the Admin Dashboard
The Admin Dashboard is your central control hub. You can access it anytime by navigating to:
https://your-domain.com/admin.php
Log in using the password you created during Step 3. Inside the dashboard, you can edit:
- Firebase Settings: Paste the keys you got from the Firebase console here.
- Game Translations (i18n): Translate 100% of the game's UI buttons, alerts, and placeholders to any language (English, Spanish, Portuguese, etc.). The game updates instantly.
- AI Bot Names: Customize the names of the computer-controlled snakes. Separate them by commas.
- Copyright Footer: Add your company name to the bottom of the game menu.
Once you click "Save All Settings", the PHP engine securely writes the data to the protected settings.json file.
6. The Skin Creator PRO Tool
We included a powerful, standalone visual tool to help you design custom snake skins without writing complex Canvas vector code manually.
skin_generator.html. Double-click it to open it in your browser (no server needed).
- Use the graphical interface to mix and match up to 6 body colors.
- Select a Neon Glow color to create atmospheric lighting effects.
- Choose custom Eye Styles (e.g., Cyclops, Thug Life Sunglasses, Dead).
- Select from dozens of Pendants/Accessories (Crowns, Horns, Wings).
- Exclusive Feature: Select the "Gold Plate (Auto-Text)" pendant to create a custom floating text plate (e.g., "VIP", "PRO"). The tool automatically calculates the width to fit your text!
- Click the blue Copy Code button.
- Open
game.jsusing any text editor (like VS Code or Notepad++). Search for the variableconst skins = [. - Paste your generated code at the bottom of the array list, right before the closing bracket
];. Save the file and refresh your game!
7. Game Architecture & Modding Guide
For developers who wish to modify the gameplay, we have meticulously documented the core logic inside game.js. Here is a high-level overview of how the game operates:
The Finite State Machine (FSM) AI
The bots are not just random movers. They utilize a State Machine inside the updateBot() function to evaluate their surroundings mathematically every frame. They evaluate the distance (using Pythagorean theorem optimization Math.hypot) to the closest enemy and switch between states:
- DANGER: Triggers a hard evasion if an imminent head-on collision is predicted via look-ahead vectors.
- ATTACK: If the bot's segment length is greater than the enemy, it enters hunting mode and targets the enemy's head.
- FLEE: If smaller, it activates boost to escape.
- FOOD (Bloodlust Mode): If no threats are near, it scans for food. Food generated by a player's death (
isDeathDrop: true) is weighted 10,000x heavier in the AI's logic, causing bots to swarm dead bodies aggressively.
Deterministic Multiplayer Sync
To prevent intense server lag, the game uses a Host-Client Architecture coupled with a PRNG (Pseudo-Random Number Generator). When a room is created, the Host generates a random roomSeed. All clients use this exact seed to mathematically generate the map geometry and initial 350 food items locally on their device, requiring zero bandwidth.
The Host is the only entity permitted to calculate Bot deaths to prevent ghosting or desynchronization across clients. If the Host disconnects, Firebase handles an automatic Host Migration, seamlessly transitioning calculations to the next oldest surviving player in the room.
8. File Structure Explained
Here is an overview of the architecture. No code is obfuscated or minified.
├── 📄 index.php (Main game entry. Checks security and injects settings)
├── 📄 game.js (The core Canvas 2D engine, physics, and AI logic)
├── 📄 style.css (All visual styling, animations, and mobile responsiveness)
├── 📄 admin.php (The secure control panel GUI)
├── 📄 install.php (Initial setup wizard. Deletes itself after use)
├── 📄 settings.json (Database file modified by the admin panel)
├── 📄 skin_generator.html (Developer tool for creating custom skins)
└── 📄 .htaccess (Apache lock to prevent public URL access to settings)
.htaccess file on your live server. It prevents visitors from directly accessing your settings.json and stealing your Firebase API keys.
9. Support & Contact
We take immense pride in our code and our customer service. If you encounter any bugs, server compatibility issues, or need help understanding the architecture for a custom modification, we are here for you.
Technical Support:
- Email: elielbony61@gmail.com
- Response Time: Usually within 12-24 hours.
When requesting support, please provide your CodeCanyon purchase code and a link to your live game environment if possible.
© 2026 Soluções Pai e Filhos / APPS WISE Games. Authored by José Eliel R. Alves.