Incorrect rendering for Gorched terminal-based game. #8681

Closed
opened 2026-01-31 01:35:22 +00:00 by claunia · 5 comments
Owner

Originally created by @oising on GitHub (May 30, 2020).

Another render canary for you, @miniksa: Gorched (scorched earth game, terminal version.) It even has a Windows installer, so I'm guessing it was tested on alacritty or something.

From: https://github.com/zladovan/gorched

It should look like:

Attract Screen

But actually looks like (with default options):

image

When I run with "safe" options, gorched --low-color --ascii-only I see:

image

No matter what width I set, I couldn't get it to align. Additionally, it seems there's some persistent glitching after the game is quit (ctrl+c) with margins and wrapping.

Originally created by @oising on GitHub (May 30, 2020). Another render canary for you, @miniksa: Gorched (scorched earth game, terminal version.) It even has a Windows installer, so I'm guessing it was tested on alacritty or something. From: https://github.com/zladovan/gorched It should look like: ![Attract Screen](https://github.com/zladovan/gorched/raw/master/showcase.gif) But actually looks like (with default options): ![image](https://user-images.githubusercontent.com/1844001/83318226-b21a7700-a200-11ea-94da-57b033cfaf22.png) When I run with "safe" options, `gorched --low-color --ascii-only` I see: ![image](https://user-images.githubusercontent.com/1844001/83318284-3967ea80-a201-11ea-94b1-b97f13ed2d47.png) No matter what width I set, I couldn't get it to align. Additionally, it seems there's some persistent glitching after the game is quit (ctrl+c) with margins and wrapping.
Author
Owner

@oising commented on GitHub (May 30, 2020):

I had a look at the underlying go library that the game is built on, termloop. It seems none of the examples there render correctly either, but they are significantly simpler. Maybe that would be easier to debug. I set up the environment like so:

scoop install go
go get -u github.com/JoelOtter/termloop
git clone https://github.com/JoelOtter/termloop

Then I ran some of the examples in: /tree/master/_examples -- they all render messed up, or don't work at all. I wonder what it's doing that's so wacky.

@oising commented on GitHub (May 30, 2020): I had a look at the underlying go library that the game is built on, `termloop`. It seems none of the examples there render correctly either, but they are significantly simpler. Maybe that would be easier to debug. I set up the environment like so: ``` scoop install go go get -u github.com/JoelOtter/termloop git clone https://github.com/JoelOtter/termloop ``` Then I ran some of the examples in: /tree/master/_examples -- they all render messed up, or don't work at all. I wonder what it's doing that's so wacky.
Author
Owner

@DHowett commented on GitHub (May 30, 2020):

Termbox, the library Termloop builds on, notoriously (at least, they're notorious to me 😄) tries to be clever about interacting with the Windows console instead of using our VT support. I wonder what they're doing.

This is probably something "conhost recording" would help with. . . 😄

Thanks for looking at this, @oising!

@DHowett commented on GitHub (May 30, 2020): Termbox, the library Termloop builds on, notoriously (at least, they're notorious to me :smile:) tries to be clever about interacting with the Windows console instead of using our VT support. I wonder what _they're_ doing. This is probably something "[conhost recording](https://github.com/microsoft/terminal/tree/dev/duhowett/hax/conhost_dump_replay)" would help with. . . :smile: Thanks for looking at this, @oising!
Author
Owner

@j4james commented on GitHub (May 30, 2020):

This is essentially a duplicate of #4363. The game uses console API calls to write to the screen buffer, and it looks like a lot of the blank areas of the background are actually the zero codepoint. Ideally conpty should be translating those to something like a space or non-breaking space, but it's just passing them through as a null control, which then ends up getting ignored.

@j4james commented on GitHub (May 30, 2020): This is essentially a duplicate of #4363. The game uses console API calls to write to the screen buffer, and it looks like a lot of the blank areas of the background are actually the zero codepoint. Ideally conpty should be translating those to something like a space or non-breaking space, but it's just passing them through as a null control, which then ends up getting ignored.
Author
Owner

@oising commented on GitHub (May 30, 2020):

Oh, lordy. I didn't look that closely. I just presumed it was VT all the way ... look what I've become! Close as a dup if you see fit, guys.

@oising commented on GitHub (May 30, 2020): Oh, lordy. I didn't look _that_ closely. I just presumed it was VT all the way ... look what I've become! Close as a dup if you see fit, guys.
Author
Owner

@j4james commented on GitHub (May 30, 2020):

I should mention the colors also don't work (i.e. some elements will be invisible) unless you've used the --low-color option, because obviously the console APIs can only handle 16 colors.

That said, you can actually run the Linux build in WSL, and that works perfectly (as far as I can tell), because it's then using actual VT sequences.

@j4james commented on GitHub (May 30, 2020): I should mention the colors also don't work (i.e. some elements will be invisible) unless you've used the `--low-color` option, because obviously the console APIs can only handle 16 colors. That said, you can actually run the Linux build in WSL, and that works perfectly (as far as I can tell), because it's then using actual VT sequences.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8681