You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to benchmark the Windows Command Prompt/Windows Terminal, and no matter which I choose it seems to think the screen is much smaller than it is (I have it set to 120x30, it thinks it's running at 30x2), and the rendering is completely broken. The README states that it works on Windows, but while it can technically compile and run on Windows, it doesn't actually run properly, so I feel that is a little misleading.
After further testing, this seems to be a general issue on Windows for whatever reason, regardless of terminal emulator. VSCode exhibits the same behavior, while the README says it has been tested and should work well.
I will be committing a partial Windows fix sometime in the next 2-3 days so that at least the test operates. For whatever reason a prior MR is trying to calculate the H + W vs polling the terminal directly via WinAPI.
That is simple enough, however - CMD.EXE and Win VSCode both are unhappy w/ANSI sequences; CMD.EXE refuses to acknowledge them, at all, and VSCode is rendering odd font characters in the flame portion. I will have to experiment a bit to determine what CMD.EXE expects vs OSX/Linux. This may take a bit more time but that is part of the fun!
With this: mode con and "Screen size: 198w x 58h" match
Tested with Wezterm and Windows Terminal
edit: using bisect:
git bisect bad
342c47eb1ba371d37b9cbd1a1db85f7bbe3b6adf is the first bad commit
commit 342c47eb1ba371d37b9cbd1a1db85f7bbe3b6adf
Author: Sylvain Rabot <[email protected]>
Date: Fri Nov 15 14:19:22 2024 +0100
Which is weird, b/c this commit only changed a bunch of u16 to u32; still need to understand why some cast fail???
edit2: the bad commit "works" when resetting CONSOLE_SCREEN_BUFFER_INFO.wAttributes to be u16 which it is supposed to be cf windows-data-types
but that is still (probably) not the best way to compute .height and .width on Win32
I have managed to make it sort of run with a small patch (ChatGPT 🫣):
Thank you for the patch! This is perfect. I am retooling the windows portion in "win32" so we can find/replace without mangling how windows terminal works.
Almost there :)
Time is of course in short supply for us all, so thank you for sharing your findings...just what is needed!
Merged into main. VS Code works, ish, however CMD and Powershell do not. Will need more research to understand why CMD.EXE doesn't just "work" with the ANSI commands that function with no issues in OSX, and maybe no issues with Linux.
What are you testing with on Windows? Wezterm is working, Windows Terminal+CMD is OK(but really slow) and Windows Terminal+Powershell seems to work-ish [the setup looks weird but it renders fine].
Note that I have not tried on Linux or Mac, so I don't really have a reference for how it supposed to look like.
Yes; testing on Windows, CMD, Stock Terminal and VSCode.
The output is broken, no question. It's better--code compiles + runs, we get colors...and it usually does something...but it doesn't do it correctly.
There are two modes - the first is a really basic "terminal test". When it works properly, you see:
Terminal Size
16 colors
216 colors
Grayscale
Animation test - various quotes fade in and out from view.
Press return, and the actual fire begins.
With CMD and Powershell, the Animation test fails - instead of repainting quotes with more visible, then less visible, text, the terminal is scrolling each quote.
The windows build is now 100% win32 API driven; no "boilerplate" zig is in the loop. So one would think, DOOM-fire-zig should work OTB. However, I suspect something in the text output is causing the more stock Windows terminals to ignore the ANSI commands. I am wondering if it is newline.
When running from inside VS Code, you get a better representation (most of the time).
In contrast, on MacOS, on alacrity, a full screen fire (221 x 56) pushes 180kb per frame at 250+ fps.
MacOS stock Terminal performs terribly (<24fps); so terrible performance in stock Windows is expected. However, the Animation test should animate vs scroll! After that, performance is a function of the terminal.
Digging more deeply, one bug is the below - CONSOLE_SCREEN_BUFFER_INFO.dwSize is the buffer size, which is HUGE compared to the window size. For height, it is reporting over 9000 lines!!!! Or whatever buffer value we happen to have for our windows console / terminal...which for me, 9k lines is NOT ENOUGH!
I expect out of memory errors before I run out of vertical buffer :)
The win-fix branch appears to function 99% in windows - need to test MacOS before it goes into main. All are welcome to try it out - zig 0.13, VS Code, and Windows 10 - CMD + Powershell + VS Terminal, all worked...20 fps?
Windows fixes have been merged into the main branch; if you find issues, feel free to reopen this issue or create a new one. I did not intend to close issue #17, but maybe it's okay. Hopefully, DOOM-fire-zig.exe functions for all!
Activity
wisplite commentedon Dec 25, 2024
After further testing, this seems to be a general issue on Windows for whatever reason, regardless of terminal emulator. VSCode exhibits the same behavior, while the README says it has been tested and should work well.
lucyyyyyyy commentedon Jan 1, 2025
Alacritty on Windows also exhibits the same behaviour
const-void commentedon Jan 1, 2025
Interesting... what happens if we use a backlevel release, say
https://github.com/const-void/DOOM-fire-zig/releases/tag/2024
const-void commentedon Jan 1, 2025
Looking into the issue, Windows was reportedly compatible at one point. No doubt something snapped loose along the way. Stand by!
const-void commentedon Jan 3, 2025
I will be committing a partial Windows fix sometime in the next 2-3 days so that at least the test operates. For whatever reason a prior MR is trying to calculate the H + W vs polling the terminal directly via WinAPI.
That is simple enough, however - CMD.EXE and Win VSCode both are unhappy w/ANSI sequences; CMD.EXE refuses to acknowledge them, at all, and VSCode is rendering odd font characters in the flame portion. I will have to experiment a bit to determine what CMD.EXE expects vs OSX/Linux. This may take a bit more time but that is part of the fun!
n-prat commentedon Jan 13, 2025
I have managed to make it sort of run with a small patch (ChatGPT 🫣):
With this:
mode conand "Screen size: 198w x 58h" matchTested with Wezterm and Windows Terminal
edit: using
bisect:Which is weird, b/c this commit only changed a bunch of
u16tou32; still need to understand why some cast fail???edit2: the bad commit "works" when resetting
CONSOLE_SCREEN_BUFFER_INFO.wAttributesto beu16which it is supposed to becf windows-data-types
but that is still (probably) not the best way to compute
.heightand.widthon Win32const-void commentedon Feb 1, 2025
Thank you for the patch! This is perfect. I am retooling the windows portion in "win32" so we can find/replace without mangling how windows terminal works.
Almost there :)
Time is of course in short supply for us all, so thank you for sharing your findings...just what is needed!
const-void commentedon Feb 1, 2025
Merged into main. VS Code works, ish, however CMD and Powershell do not. Will need more research to understand why CMD.EXE doesn't just "work" with the ANSI commands that function with no issues in OSX, and maybe no issues with Linux.
Leaving open, more is needed!
n-prat commentedon Feb 1, 2025
Thanks for that!
What are you testing with on Windows? Wezterm is working, Windows Terminal+CMD is OK(but really slow) and Windows Terminal+Powershell seems to work-ish [the setup looks weird but it renders fine].
Note that I have not tried on Linux or Mac, so I don't really have a reference for how it supposed to look like.
const-void commentedon Feb 8, 2025
Yes; testing on Windows, CMD, Stock Terminal and VSCode.
The output is broken, no question. It's better--code compiles + runs, we get colors...and it usually does something...but it doesn't do it correctly.
There are two modes - the first is a really basic "terminal test". When it works properly, you see:
Press return, and the actual fire begins.
With CMD and Powershell, the Animation test fails - instead of repainting quotes with more visible, then less visible, text, the terminal is scrolling each quote.
The windows build is now 100% win32 API driven; no "boilerplate" zig is in the loop. So one would think, DOOM-fire-zig should work OTB. However, I suspect something in the text output is causing the more stock Windows terminals to ignore the ANSI commands. I am wondering if it is newline.
When running from inside VS Code, you get a better representation (most of the time).
In contrast, on MacOS, on alacrity, a full screen fire (221 x 56) pushes 180kb per frame at 250+ fps.
MacOS stock Terminal performs terribly (<24fps); so terrible performance in stock Windows is expected. However, the Animation test should animate vs scroll! After that, performance is a function of the terminal.
const-void commentedon Feb 8, 2025
Digging more deeply, one bug is the below -
CONSOLE_SCREEN_BUFFER_INFO.dwSizeis the buffer size, which is HUGE compared to the window size. For height, it is reporting over 9000 lines!!!! Or whatever buffer value we happen to have for our windows console / terminal...which for me, 9k lines is NOT ENOUGH!I expect out of memory errors before I run out of vertical buffer :)
Bug:
I will be reverting back to the prior calculation, where the viewable portion of the buffer can be used to calculate the "terminal" dimensions.
const-void commentedon Feb 8, 2025
The win-fix branch appears to function 99% in windows - need to test MacOS before it goes into main. All are welcome to try it out - zig 0.13, VS Code, and Windows 10 - CMD + Powershell + VS Terminal, all worked...20 fps?
https://github.com/const-void/DOOM-fire-zig/tree/win-fix
The missing component right now appears to be UTF-8 glyphs, which is very odd.
const-void commentedon Feb 9, 2025
Windows fixes have been merged into the main branch; if you find issues, feel free to reopen this issue or create a new one. I did not intend to close issue #17, but maybe it's okay. Hopefully, DOOM-fire-zig.exe functions for all!