Troubleshooting
Common issues and their solutions for SSOEngine development
š Find Your Issue
Click on an issue below to jump to the solution:
ā ļø Compiler Issues
"'g++' is not recognized as an internal or external command"
šØ Symptoms
- build.bat fails immediately
- Command prompt shows "g++ is not recognized"
- Cannot compile any C++ code
š Causes
- MinGW-w64 is not installed
- Compiler is not in Windows PATH
- Wrong compiler version or architecture
- PATH not updated after installation
ā Solutions
Solution 1: Install MinGW-w64
If you haven't installed MinGW-w64:
- Download from winlibs.com
- Choose the latest version with GCC and UCRT
- Extract to
C:\mingw64 - Add
C:\mingw64\binto PATH
Solution 2: Add to PATH
To add MinGW-w64 to Windows PATH:
- Press Windows key, type "Environment Variables"
- Click "Edit the system environment variables"
- Click "Environment Variables..."
- Under "System variables", find "Path"
- Click "Edit..." then "New"
- Add
C:\mingw64\bin(or your install path) - Click OK on all windows
- Restart Command Prompt
Solution 3: Verify Installation
Test your installation:
g++ --version
mingw32-make --version
You should see version information for both commands.
"Build Failed" or Compilation Errors
šØ Symptoms
- build.bat shows "Build Failed" message
- Compiler errors about missing files
- Linker errors about undefined references
- No executable created in build/ folder
š Common Causes
- Missing Raylib libraries in lib/ folder
- Syntax errors in your code
- Missing header files
- Incorrect project structure
- Asset packing errors
ā Solutions
Solution 1: Check Project Structure
Verify you have the correct folder structure:
SSOEngine/
āāā 01_Core/
ā āāā build.bat
ā āāā main.cpp
ā āāā game.h
ā āāā tools/
ā āāā scripts/
ā āāā assets/
āāā include/
āāā lib/
Solution 2: Check Raylib Libraries
Ensure lib/ folder contains:
libraylib.a(static library)raylib.hin include/ folder
If missing, re-download SSOEngine or get Raylib from raylib.com
Solution 3: Fix Code Errors
Common syntax errors to check:
- Missing semicolons (;)
- Unmatched braces ({ })
- Missing include statements
- Typos in variable names
- Incorrect function signatures
š® Runtime Issues
Game Window Won't Open or Crashes Immediately
šØ Symptoms
- Double-clicking .exe does nothing
- Window flashes and closes immediately
- Command window shows error messages
- "Failed to initialize graphics" error
š Causes
- Missing OpenGL support
- Outdated graphics drivers
- Missing DLL files
- Antivirus blocking the executable
- Insufficient permissions
ā Solutions
Solution 1: Update Graphics Drivers
- Go to your graphics card manufacturer website
- Download latest drivers (NVIDIA, AMD, or Intel)
- Install and restart your computer
- Try running the game again
Solution 2: Run as Administrator
- Right-click the game executable
- Select "Run as administrator"
- If it works, add permanent admin rights
Solution 3: Check Antivirus
- Temporarily disable antivirus
- Try running the game
- If it works, add exception to antivirus
- Re-enable antivirus protection
Game Shows Black Screen or Doesn't Render
šØ Symptoms
- Window opens but shows only black
- No game objects visible
- UI elements not showing
- Camera not working
š Common Causes
- Missing BeginDrawing/EndDrawing calls
- Camera not properly set up
- Objects outside camera view
- ClearBackground covering everything
- Rendering order issues
ā Solutions
Check Your Rendering Loop
Ensure you have the correct structure:
while (!WindowShouldClose()) {
// Update game logic
Update(deltaTime);
// Rendering
BeginDrawing();
ClearBackground(RAYWHITE);
// Draw game objects
DrawPlayer();
DrawEnemies();
EndDrawing();
}
š¦ Asset Issues
"Asset Not Found" or Loading Errors
šØ Symptoms
- Textures show as white squares
- Sounds don't play
- Fonts don't load
- Build fails during asset packing
š Causes
- Assets not in assets/ folder
- Incorrect file names (case-sensitive)
- Unsupported file formats
- File path issues
- Asset packing failed
ā Solutions
Solution 1: Check Asset Location
Ensure assets are in the correct folder:
SSOEngine/01_Core/assets/
āāā images/
ā āāā player.png
ā āāā enemy.png
āāā sounds/
ā āāā shoot.wav
ā āāā explosion.wav
āāā fonts/
āāā main.ttf
Solution 2: Check File Names
File names are case-sensitive and must match exactly:
- ā
Player.pngvsplayer.png - ā
shoot.WAVvsshoot.wav - ā Use consistent lowercase naming
- ā Avoid spaces and special characters
Solution 3: Rebuild Assets
If asset packing failed:
- Delete
assets.ssofile - Delete
assets_data.hfile - Run
build.batagain - Check for asset packing errors
Embedded Assets Not Working
šØ Symptoms
- Compiler errors about asset variables
- assets_data.h not found
- Asset variables undefined
ā Solutions
Check Asset Loading Code
Ensure you're using the correct variable names:
#include "assets_data.h"
// Correct usage
Texture2D playerTexture = LoadTextureFromMemory(
asset_player_png, // Variable name (file name with underscores)
asset_player_png_size // Size variable
);
// Incorrect usage
Texture2D bad = LoadTextureFromMemory(
"player.png", // String instead of variable
12345 // Wrong size
);
Note: File names with spaces and special characters are converted to underscores.
ā” Performance Issues
Low FPS or Stuttering
šØ Symptoms
- Game feels sluggish or slow
- Frame rate drops below 60 FPS
- Stuttering during gameplay
- Input lag or delayed response
š Common Causes
- Too many objects being rendered
- Inefficient collision detection
- Loading assets during gameplay
- Memory leaks
- Complex calculations every frame
ā Solutions
Solution 1: Optimize Rendering
// Bad: Drawing everything every frame
for (auto& enemy : allEnemies) {
if (enemy.active) {
DrawEnemy(enemy); // Even if off-screen
}
}
// Good: Only draw visible objects
for (auto& enemy : allEnemies) {
if (enemy.active && IsOnScreen(enemy.position)) {
DrawEnemy(enemy);
}
}
Solution 2: Optimize Collision Detection
// Bad: Check everything against everything
for (auto& bullet : bullets) {
for (auto& enemy : enemies) {
CheckCollision(bullet, enemy); // O(n²)
}
}
// Good: Spatial partitioning or early outs
for (auto& bullet : bullets) {
if (!bullet.active) continue;
for (auto& enemy : enemies) {
if (!enemy.active) continue;
if (Distance(bullet.pos, enemy.pos) > 100) continue; // Early out
CheckCollision(bullet, enemy);
}
}
Solution 3: Monitor Performance
Add FPS counter to your game:
void DrawFPS() {
DrawFPS(10, 10); // Raylib built-in FPS counter
// Or custom FPS display
static double lastTime = 0;
static int frameCount = 0;
static int fps = 0;
double currentTime = GetTime();
frameCount++;
if (currentTime - lastTime >= 1.0) {
fps = frameCount;
frameCount = 0;
lastTime = currentTime;
}
DrawText(TextFormat("FPS: %d", fps), 10, 40, 20, GREEN);
}
Memory Leaks or High Memory Usage
šØ Symptoms
- Memory usage increases over time
- Game eventually crashes
- System becomes slow
- Out of memory errors
š Common Causes
- Not unloading textures/sounds
- Creating objects without deleting
- Inefficient object pooling
- Large asset files
ā Solutions
Proper Resource Management
// Load resources once at startup
Texture2D playerTexture;
Sound shootSound;
void LoadAssets() {
playerTexture = LoadTexture("assets/player.png");
shootSound = LoadSound("assets/shoot.wav");
}
// Unload when done
void UnloadAssets() {
UnloadTexture(playerTexture);
UnloadSound(shootSound);
}
// For dynamic objects, use object pooling
class BulletPool {
private:
std::vector pool;
int nextAvailable = 0;
public:
Bullet& GetBullet() {
Bullet& bullet = pool[nextAvailable];
nextAvailable = (nextAvailable + 1) % pool.size();
return bullet;
}
};
š Debug Mode and Diagnostics
Enable Debug Mode
Add debug information to help identify issues:
// In game.h, add debug variables
inline bool debugMode = false;
inline Vector2 debugMousePos = {0, 0};
// Toggle debug mode with F1 key
if (IsKeyPressed(KEY_F1)) {
debugMode = !debugMode;
}
// Debug rendering
if (debugMode) {
// Draw debug info
DrawText(TextFormat("Player: %.1f, %.1f", player.position.x, player.position.y), 10, 100, 20, GREEN);
DrawText(TextFormat("FPS: %d", GetFPS()), 10, 130, 20, GREEN);
DrawText(TextFormat("Objects: %d", gameObjectCount), 10, 160, 20, GREEN);
// Draw collision boxes
DrawRectangleLines(playerRect.x, playerRect.y, playerRect.width, playerRect.height, RED);
// Draw mouse position
debugMousePos = GetMousePosition();
DrawCircleV(debugMousePos, 5, YELLOW);
}
Debug Commands to Add
- F1: Toggle debug mode
- F2: Reset game state
- F3: Spawn test objects
- F4: Toggle collision boxes
- F5: Performance monitor
š Still Need Help?
If you've tried all the solutions above and still have issues, don't hesitate to reach out:
š§ Email Support
Send detailed information about your issue:
- ⢠Error messages (full text)
- ⢠Steps to reproduce
- ⢠Your system specs
- ⢠SSOEngine version
š Bug Reports
Report bugs on GitHub:
- ⢠Search existing issues first
- ⢠Use appropriate labels
- ⢠Provide minimal reproduction case
- ⢠Include system information
š” Pro Tips
- ⢠Always include the exact error message
- ⢠Provide steps to reproduce the issue
- ⢠Mention what you've already tried
- ⢠Include your Windows version and MinGW setup
- ⢠Screenshots can be very helpful