I recently found a sweet, sweet solution to using Godot to create text-games for blind-friendly players. This matters because:
Running Godot games spawns a console window. By default, this window displays a lot of things we wouldn't want players to see or care about, such as:
Fortunately, the former displays on stdout
, and the latter on stderr
. This provides us with a simple way to run Godot and suppress all text:
Disable stderr
. This prevents warnings/errors from being printed.Flush stdout on Print debug
. This means every print statement gets immediately printed.All this leaves is a way to print output to the console; you can achieve this by creating a warpper method like so:
public static void Write(string message) {
System.Console.WriteLine(message);
Godot.GD.Print(message);
}
The first line prints only when the game is exported. The second prints only when the game is run in-editor (e.g. debugging). If the --no-header
argument is implemented, you can also add that to your shell/batch script for running your game to disable the Godot header output; --quiet
does the same thing.
Also, you can read player input with System.Console.ReadLine
and friends - but be warned that this freezes the main Godot game. Perhaps running it in a separate thread may work. This makes it simple to build an interactive text game.
Of course, there's no reason to stick just to text. You can use your main Godot game window to display relevant data, stats, scenes, whatever you like. You can even add buttons and allow users to input using buttons or console text as they see fit. Plus, fancy features like reverb!
While text games aren't the Bee's Knees any more, I would love to see more text-accessible games made in Godot using this approach. If you're interested, check out the Games for Blind Gamers 2 Jam, or follow along on Mastodon or Twitter as I build a blind-first game using this approach.
Liked our updates? Subscribe to our newsletter to get access to our game demos and exclusive insider updates!