Troubleshooting

Common issues and their solutions for SSOEngine development

āš ļø 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:

  1. Download from winlibs.com
  2. Choose the latest version with GCC and UCRT
  3. Extract to C:\mingw64
  4. Add C:\mingw64\bin to PATH
Solution 2: Add to PATH

To add MinGW-w64 to Windows PATH:

  1. Press Windows key, type "Environment Variables"
  2. Click "Edit the system environment variables"
  3. Click "Environment Variables..."
  4. Under "System variables", find "Path"
  5. Click "Edit..." then "New"
  6. Add C:\mingw64\bin (or your install path)
  7. Click OK on all windows
  8. 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.h in 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
  1. Go to your graphics card manufacturer website
  2. Download latest drivers (NVIDIA, AMD, or Intel)
  3. Install and restart your computer
  4. Try running the game again
Solution 2: Run as Administrator
  1. Right-click the game executable
  2. Select "Run as administrator"
  3. If it works, add permanent admin rights
Solution 3: Check Antivirus
  1. Temporarily disable antivirus
  2. Try running the game
  3. If it works, add exception to antivirus
  4. 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.png vs player.png
  • āŒ shoot.WAV vs shoot.wav
  • āœ… Use consistent lowercase naming
  • āœ… Avoid spaces and special characters
Solution 3: Rebuild Assets

If asset packing failed:

  1. Delete assets.sso file
  2. Delete assets_data.h file
  3. Run build.bat again
  4. 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
strata.tech.dev@gmail.com

šŸ› Bug Reports

Report bugs on GitHub:

  • • Search existing issues first
  • • Use appropriate labels
  • • Provide minimal reproduction case
  • • Include system information
GitHub Issues

šŸ’” 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