Wesnoth: Invisible Units Bug On Linux - Troubleshooting

Alex Johnson
-
Wesnoth: Invisible Units Bug On Linux - Troubleshooting

Having trouble with invisible units in The Battle for Wesnoth? This is a frustrating issue, especially when you're eager to dive into a new campaign. Let's break down the problem, understand potential causes, and explore solutions to get your game running smoothly again on your Linux system.

Game and System Information

Before we dive into troubleshooting, let's acknowledge the user's system setup. The user is running The Battle for Wesnoth version 1.18.5 on CachyOS, a Linux distribution. They've also tested it on Arch Linux, encountering the same problem. The system uses an AMD Ryzen™ 7 7730U with Radeon™ Graphics integrated GPU. This information is crucial because the issue might be related to specific drivers or configurations on these systems.

The Battle for Wesnoth version 1.18.5 x86_64
Running on CachyOS x86_64
Distribution channel: Linux repository

Game paths
==========

Data dir:        /usr/share/wesnoth
User config dir: /home/USER/.config/wesnoth
User data dir:   /home/USER/.local/share/wesnoth/1.18
Saves dir:       /home/USER/.local/share/wesnoth/1.18/saves
Add-ons dir:     /home/USER/.local/share/wesnoth/1.18/data/add-ons
Cache dir:       /home/USER/.cache/wesnoth
Logs dir:        /home/USER/.local/share/wesnoth/1.18/logs

Libraries
=========

Boost:             1.89
Lua:               5.4.8
OpenSSL/libcrypto: 3.6.0-dev (runtime 3.6.0-dev)
libcurl:           8.16.0 (runtime 8.17.0)
Cairo:             1.18.4 (runtime 1.18.4)
Pango:             1.57.0 (runtime 1.57.0)
SDL:               2.32.56 (runtime 2.32.58)
SDL_image:         2.8.8 (runtime 2.8.8)
SDL_mixer:         2.8.1 (runtime 2.8.1)

Features
========

Lua console completion:       yes
D-Bus notifications back end: yes

Current video settings
======================

SDL video drivers:        [wayland] x11 KMSDRM offscreen dummy evdev
Window size:              1920x1080
Game canvas size:         1920x1080
Final render target size: 1920x1080
Screen refresh rate:      60
Screen dpi:               96.00x96.00
Renderer:                 opengl (hw)
Maximum texture size:     16384x16384
VSync:                    off

Current audio settings
======================

SDL audio drivers:  [pipewire] pulseaudio alsa sndio jack disk
Number of channels: 2
Output rate:        44100 Hz
Sample format:      signed 16 bit little-endian
Sample size:        1024 bytes

Installed add-ons
=================

Era_of_Magic:           4.8.3
Era_of_Magic_Resources: 3.1.2

Description of the Bug: Invisible Units

The core issue is that all units in the game are invisible. This makes it impossible to play, as you can't see your forces or the enemy. This problem appears immediately upon starting the first campaign, indicating a fundamental rendering issue. This is a critical game-breaking bug that prevents any meaningful gameplay. Addressing this requires a systematic approach to identify the underlying cause. Let's explore possible reasons for this graphical glitch and offer some debugging steps that might help resolve this issue. Remember that graphics-related issues can stem from a variety of factors, including driver incompatibilities, rendering settings, or even corrupted game files. We will investigate each of these possibilities.

Steps to Reproduce the Behavior

The steps to reproduce the bug are simple: start the first campaign. This indicates the issue is not triggered by specific in-game actions or events but is present from the very beginning of the gameplay experience. This straightforward reproduction step helps narrow down the scope of the problem. It suggests the issue arises from either the initial game loading process, rendering initialization, or a fundamental incompatibility with the system's graphics configuration. To ensure the integrity of this reproduction step, it might be beneficial to test with different campaigns or scenarios to confirm if the problem persists universally across all game modes. This wider testing could further pinpoint whether the issue is tied to specific campaign assets or is a consistent, system-wide problem.

Potential Causes and Solutions for invisible units.

  1. Graphics Driver Issues: The most common cause for rendering problems in games is related to graphics drivers. Outdated, corrupted, or incompatible drivers can lead to various visual glitches, including invisible units. Given that the user is on an AMD Ryzen™ 7 7730U with Radeon™ Graphics, it's essential to ensure the latest drivers are installed. Here's how to address this:

    • Update Drivers: Use the official AMD drivers from the AMD website or through your distribution's package manager. For CachyOS or Arch, you can use pacman. For example, sudo pacman -Syu mesa might update relevant drivers. Also, consider installing xf86-video-amdgpu if it's not already installed.
    • Test Different Drivers: Sometimes, the latest drivers might have introduced new bugs. If the issue started after a driver update, try reverting to a previous version to see if it resolves the problem. You can usually find older drivers on the AMD support website.
    • Check Compatibility: Verify that your graphics card and drivers are compatible with the version of Wesnoth you are running. Check the Wesnoth forums or documentation for any known compatibility issues.
  2. SDL Configuration: Wesnoth uses SDL (Simple DirectMedia Layer) for handling graphics and input. Issues with SDL configuration can sometimes cause rendering problems. The provided system information shows that Wesnoth is using the wayland SDL video driver. Try switching to x11 to see if that resolves the issue.

    • Edit Wesnoth Configuration: You can try forcing Wesnoth to use the X11 driver by editing the Wesnoth configuration file. The file is usually located in /home/USER/.config/wesnoth/1.18/preferences. Open this file in a text editor and look for the sdl_driver option. If it's set to wayland, change it to x11. Save the file and restart Wesnoth.
    • Command-Line Option: You can also try running Wesnoth with the SDL_VIDEODRIVER environment variable set to x11. Open a terminal and run: SDL_VIDEODRIVER=x11 wesnoth.
  3. OpenGL Issues: The game uses OpenGL for rendering. Problems with OpenGL can also lead to visual glitches. Ensure that your system has proper OpenGL support.

    • Verify OpenGL Installation: You can verify that OpenGL is properly installed by running `glxinfo | grep

You may also like