Art and UI tile corruption + slow performance on a particular user configuration

Issue #24 on hold
Nnamdi Kohn
created an issue

Hi and thanks for your interesting videos and insights into your work !!!

Currently, I am not able to start any of the program versions which are provided for Windows system

(1) Starting the current executables on a Windows 7 and a Windows XP computer both just flashes a screen and immediately ends operation (without any error message).

(2) Downloading the current "source" version from the download section, installing the packages as described in your overview text (this works fine) and doing a

python playscii.py

from within the appropriate virtual environment just outputs

(ENV_python35) C:\_TEMP\playscii>python playscii.py
Traceback (most recent call last):
  File "C:\Users\nnako\ENV_python35\lib\site-packages\sdl2\dll.py", line 111, in <module>
    dll = DLL("SDL2", ["SDL2", "SDL2-2.0"], os.getenv("PYSDL2_DLL_PATH"))
  File "C:\Users\nnako\ENV_python35\lib\site-packages\sdl2\dll.py", line 53, in __init__
    (libinfo, dllmsg))
RuntimeError: could not find any library for SDL2 (PYSDL2_DLL_PATH: .)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "playscii.py", line 17, in <module>
    import sdl2
  File "C:\Users\nnako\ENV_python35\lib\site-packages\sdl2\__init__.py", line 2, in <module>
    from .dll import get_dll_file, _bind
  File "C:\Users\nnako\ENV_python35\lib\site-packages\sdl2\dll.py", line 113, in <module>
    raise ImportError(exc)
ImportError: could not find any library for SDL2 (PYSDL2_DLL_PATH: .)

Any hints to make your source (or the executable) run on my machine?

Thanks.

Comments (11)

  1. JP LeBreton repo owner

    Ah, sorry, if you're running from source on Windows then you'll need to find a version of SDL2.dll and copy / symlink it to the dir you're running Playscii from.

    If the EXE build crashes immediately on start, would you mind attaching the log file? It's called "console.log" and you can find it in your user dir, in a path sort of like C:\Users\username\AppData\Local\Playscii\ where "username" is your username.

  2. Nnamdi Kohn reporter

    Here the contents of the console.log file:

    Playscii v0.7.2
    Loaded config from C:\Users\nnako\AppData\Local\Playscii/playscii.cfg
    OS: Windows-7-6.1.7601-SP1
    CPU: AMD64 Family 21 Model 1 Stepping 2, AuthenticAMD
    Python: 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)]
    Detected screen resolution: 1680 x 1050, using: 1280 x 720
    GPU: ATI Technologies Inc. - AMD 760G
    OpenGL detected: 2.1.8787
    GLSL detected: 1.30
    Vertex Array Object support found.
    

    nothing special, I guess.

    When first going into the folder where playscii was extracted in (the file SDL2.dll is situated within the current directory) and then starting playscii, the console says this:

    Playscii v0.7.2
    Loaded config from C:\Users\nnako\AppData\Local\Playscii/playscii.cfg
    OS: Windows-7-6.1.7601-SP1
    CPU: AMD64 Family 21 Model 1 Stepping 2, AuthenticAMD
    Python: 3.4.2 (v3.4.2:ab2c023a9432, Oct  6 2014, 22:15:05) [MSC v.1600 32 bit (Intel)]
    Detected screen resolution: 1680 x 1050, using: 1280 x 720
    GPU: ATI Technologies Inc. - AMD 760G
    OpenGL detected: 2.1.8787
    GLSL detected: 1.30
    Vertex Array Object support found.
    Traceback (most recent call last):
      File "<string>", line 807, in <module>
      File "<string>", line 217, in __init__
      File "<string>", line 360, in load_art_for_edit
      File "C:\playscii\renderable.py", line 59, in __init__
      File "C:\playscii\shader.py", line 23, in new_shader
      File "C:\playscii\shader.py", line 54, in __init__
      File "C:\Python34\lib\site-packages\OpenGL\GL\shaders.py", line 226, in compileShader
    RuntimeError: ('Shader compile failure (0): b"Fragment shader failed to compile with the following errors:
    ERROR: 0:6: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:7: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:8: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:9: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:11: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:12: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:13: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:15: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:17: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:22: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:22: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:25: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:25: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:28: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:34: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR: 0:39: \'\' : Declaration must include a precision qualifier or the default precision must have been previously declared.
    ERROR:  compilation errors.  No code generated.
    "', [b'#version 130
    uniform sampler2D charset;
    uniform sampler2D palette;
    uniform sampler2D grain;
    // width of the generated palette texture, iepalette.MAX_COLORS
    uniform float palTextureWidth;
    uniform float grainStrength;
    uniform float bgColorAlpha;
    uniform float alpha;
    
    in vec2 texCoords;
    in float theFgColorIndex;
    in float theBgColorIndex;
    
    const float grainSize = 0.0075;
    
    out vec4 outColor;
    
    void main()
    {
        // add tiny offsets to UVs to account for sampling imprecision
        vec2 nudge = vec2(0.000001, 0.000001);
        outColor = texture(charset, texCoords + nudge);
        // look up fg/bg colors from palette texture
        vec2 colorUV = vec2(0.0, 0.0);
        // offset U coord slightly so we\'re not sampling from pixel boundary
        colorUV.x = (theFgColorIndex + 0.01) / palTextureWidth;
        vec4 fgColor = texture(palette, colorUV);
        // multiple charset pixel value by FG color
        // tinting >1 color charsets isn\'t officially supported but hey
        outColor.rgb *= fgColor.rgb;
        // any totally transparent pixels get the BG color
        colorUV.x = (theBgColorIndex + 0.01) / palTextureWidth;
        vec4 bgColor = texture(palette, colorUV);
        bgColor.a *= bgColorAlpha;
        // thanks Mark Wonnacott for tip on how to do this w/o a branch
        outColor = mix(bgColor, fgColor, outColor.a);
        // apply "grain" for eg UI elements
        vec4 grainColor = texture(grain, gl_FragCoord.xy * grainSize);
        outColor.rgb += (0.5 - grainColor.rgb) * grainStrength;
        // overall alpha
        outColor.a *= alpha;
    }
    '], GL_FRAGMENT_SHADER)
    playscii returned -1
    
  3. JP LeBreton repo owner

    Aha, that shader compile error must be the issue. I don't have easy access to an AMD GPU but I'll bet I can fix that ("precision mediump float;"?), thanks for the log!

  4. Nnamdi Kohn reporter

    Hi. Thanks for trying to fix the problem. Unfortunately, this v0.7.3 does not work on my Windows computers, although it proceeds further than the last try with v0.7.2. Here is log.

    THE CONSOLE SAYS

    Playscii v0.7.3
    Loaded config from C:\Users\nnako\AppData\Local\Playscii/playscii.cfg
    OS: Windows-7-6.1.7601-SP1
    CPU: AMD64 Family 21 Model 1 Stepping 2, AuthenticAMD
    Python: 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)]
    Detected screen resolution: 1680 x 1050, using: 1280 x 720
    GPU: ATI Technologies Inc. - AMD 760G
    OpenGL detected: 2.1.8787
    GLSL detected: 1.30
    Vertex Array Object support found.
    Traceback (most recent call last):
      File "<string>", line 810, in <module>
      File "<string>", line 217, in __init__
      File "<string>", line 360, in load_art_for_edit
      File "renderable.py", line 59, in __init__
      File "shader.py", line 23, in new_shader
      File "shader.py", line 55, in __init__
      File "site-packages\OpenGL\GL\shaders.py", line 196, in compileProgram
      File "site-packages\OpenGL\GL\shaders.py", line 108, in check_validate
    RuntimeError: Validation failure (0): b'Fragment shader(s) failed to link,  vertex shader(s) failed to link.
      ERROR: Symbol texCoords is defined with 2 different types in vertex and fragment shaders.
      ERROR: Symbol theBgColorIndex is defined with 2 different types in vertex and fragment shaders.
      ERROR: Symbol theFgColorIndex is defined with 2 different types in vertex and fragment shaders.
      ERROR: Symbol texCoords is defined with 2 different types in vertex and fragment shaders.
      ERROR: Symbol theBgColorIndex is defined with 2 different types in vertex and fragment shaders.
      ERROR: Symbol theFgColorIndex is defined with 2 different types in vertex and fragment shaders.'
    playscii returned -1
    

    THE LOG SAYS

    Playscii v0.7.3
    Loaded config from C:\Users\nnako\AppData\Local\Playscii/playscii.cfg
    OS: Windows-7-6.1.7601-SP1
    CPU: AMD64 Family 21 Model 1 Stepping 2, AuthenticAMD
    Python: 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)]
    Detected screen resolution: 1680 x 1050, using: 1280 x 720
    GPU: ATI Technologies Inc. - AMD 760G
    OpenGL detected: 2.1.8787
    GLSL detected: 1.30
    Vertex Array Object support found.
    
  5. JP LeBreton repo owner

    Thanks for trying it out. I just realized the shaders are not bundled into the executable, so if you don't mind trying something I may have a fix: go into the shaders\ subdirectory beneath where the playscii.exe file is, and open all the files that end with "_v.glsl", eg "cursor_v.glsl". Add this line to the top of each of those files:

    precision mediump float;
    

    Then try relauching Playscii. Let me know if that works, or if you get a new error. Thanks for your patience!

  6. Nnamdi Kohn reporter

    now, it is kind of working (at least it does not end operation immediately) on my Windows 7 machine.

    All I see is a (kind of distorted) ASCII character screen:

    PIC__ screenshot.png

    • no menus are readable
    • every mouse movement on top of the screen takes three seconds to finish
    • after that, the blinking "cursor" stops below the mouse pointer
    • the whole operating system is slow as long as playscii is running

    THE CONSOLE SAYS

    Playscii v0.7.3
    Loaded config from C:\Users\Nnamdi\AppData\Local\Playscii/playscii.cfg
    OS: Windows-7-6.1.7601-SP1
    CPU: AMD64 Family 21 Model 1 Stepping 2, AuthenticAMD
    Python: 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)]
    Detected screen resolution: 1680 x 1050, using: 1280 x 720
    GPU: ATI Technologies Inc. - AMD 760G
    OpenGL detected: 2.1.8787
    GLSL detected: 1.30
    Vertex Array Object support found.
    c:\_TEMP\playscii_v0_7_3__exe\playscii\art.py:481: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
    c:\_TEMP\playscii_v0_7_3__exe\playscii\art.py:470: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future
    Loaded key binds from C:\Users\nnako\AppData\Local\Playscii/binds.cfg
    init done.
    Thank you for using Playscii!  <3
    

    THE LOG SAYS

  7. JP LeBreton repo owner

    Hmm, never seen that particular kind of error before! I have something to try, it might not fix the corruption but maybe at least speed things up.

    Find the file C:\Users\Nnamdi\AppData\Local\Playscii/playscii.cfg, open it in a text editor eg Notepad and look for these two lines:

    # CRT shader starts off
    #Framebuffer.start_crt_enabled = False
    # disable CRT shader entirely - use this if playscii starts up really slowly
    #Framebuffer.disable_crt = True
    

    Remove the # from the start of the two lines that start with "Framebuffer". Let me know if that improves anything. Thanks again for your patience.

  8. Log in to comment