Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Questions about Wine on Linux
Locked
User avatar
=CO= Windler
Level 2
Level 2
Posts: 34
Joined: Wed Apr 07, 2021 1:27 am

Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by =CO= Windler »

Visual Pinball is one of the most popular pinball simulations on PC, including an editor for creating own pinball games those can be connected to the PinMAME emulator of digital pinball machines. Version VP8 or earlier are strictly necessary to play many hobbyist pinball tables those are incompatible with VP9 and later. As a community driven open source platform with huge fanbase, Visual Pinball deserves to be properly supported by WINE.

Unfortunately a bug in WINE prevents it to initialize default constants of Visual Basic scripts, making lights not work and throw an error.

The editor loads ok. But trying to play a pinball table, it displays the playfield only in window mode and only works once; when I quit and restart the game or try fullscreen mode, there is only the empty background with the score counters but no playfield is drawn. I also tried VP6 on WINE, which behaves very similar but has an additional graphics bug (draws ugly intransparent box around ball). Some playfield objects have an ugly pixelish dark line around them (a minor cosmetic bug), which is particularly visible in semi-transparent textures those contain pixelated sections to approximate an alpha channel effect.

I have installed VP8.1.1 on WINE 8.10. I had to add the component wsh57 to make it recognize keypresses. I tried Xp and Win7 mode (Win2000 and Win98 truncated the screen?). The hardware has a Ryzen 2400G CPU with 16GB RAM, running WINE 8.10 through PlayOnLinux on Linux Mint 20.1 with KDE Plasma 5 desktop.


In 2002 I had programmed 2 very sophisticated emulated EM pinballs on VP6, those both fail on WINE with an "lightStateOff" error. On my real Win98SE system (VP6 and VP8) they still run fine.

see http://weltenschule.de/pinball.html

Boomerang v1.4

Code: Select all

"Play" in editor shows error:

Line: 2138
Variable is undefined: 'lightStateOff'
Jimmy das Gummipferd v0.9

Code: Select all

"Play" in editor shows error:

Line: 2768
Variable is undefined: 'lightStateOff'
Also the demo table TopSpeed.vpt in WINE switches all lights off when the game starts. This one contains the "LightStateOff" command but the VBScript does not throw that error.

workaround

Thanks to a tip on VPForums.org I got a workaround. Insert into the script of the .vpt file these lines (after "option explicit"​).

Code: Select all

option explicit
...
const lightStateOff = 0
const lightStateOn = 1
const lightStateBlinking = 2
https://www.vpforums.org/index.php?showtopic=51611

This makes the games play correctly with working lights and even fullscreen mode. But this can't be the intended solution to edit every .vpt file (pinball game) to make it run (which is anyway impossible with protected ones).

I suspect that some kind of internal include file with the constant definitions is not loaded by VP when running on WINE, which makes VBScripts fail. PlayOnLinux also warned not to install programs outside the Windows "programs" folder (mine is in the equivalent of "c:\Visual Pinball"), which however is necessary for Visual Pinball due to the program folder write protection of Windows.​ Also returning to editor and restarting the game still draws no playfield, so I have to quit and restart VP to play again e.g. after editing. I have also submitted the bug report and workaround to the WineHQ site.

- Is there a trick to make VP run without patching every pinball table?
User avatar
DarkShadow44
Level 9
Level 9
Posts: 1338
Joined: Tue Nov 22, 2016 5:39 pm

Re: Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by DarkShadow44 »

Mind linking the bug report you created?

Not sure what exactly you mean. I tried the Boomerang v1.4 with VP8.1.1 from https://archive.org/details/Visual_Pinball_2020-06-20, and after winetricks wsh57 it seems to work fine.
Keep in mind that wsh57 already install native vbscript, so the wine one doesn't get used anymore.
Or did I do something different?
User avatar
=CO= Windler
Level 2
Level 2
Posts: 34
Joined: Wed Apr 07, 2021 1:27 am

Re: Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by =CO= Windler »

I can play VisualPinball only when I patch the script inside each .vpt file (using the integrated editor of VP) to set those 3 lightState... constants.

Did you install VP8 in the "program files" (default) folder of WINE or outside. I installed it in "c:\Visual Pinball" folder because VP warns that it needs write access which fails if installed in "Program Files". However PlayOnLinux warns to only install software in "Program Files".

"/home/co_windler/.PlayOnLinux/wineprefix/VisualPinball8/drive_c/Visual Pinball/"

I need PlayOnLinux to keep multiple WINE versions installed simultaneously, because this is a production system that depends on several Windows programs (7zip etc.) those I installed on WINE 5.0.2 to avoid accelerated DirectX which several times had failed to start when Mesa/Vulkan graphics driver updates did not install properly.

Inside WINE 8.11 (current system version) I have also installed the libraries "dx8vb (Native)" and "vbscript (Native, Builtin)" (in menu "DLL-Überschreibungen").
User avatar
DarkShadow44
Level 9
Level 9
Posts: 1338
Joined: Tue Nov 22, 2016 5:39 pm

Re: Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by DarkShadow44 »

All I did was create new WINEPREFIX, install the program with default settings, and run "winetricks wsh57".
Then it just worked. And now it doesn't anymore, I suddenly have exactly the error you describe. Now if I only knew what I was doing differently...

EDIT: Can you try "winetricks oleaut32"? This seems to be it.

EDIT2: Turns out, it's bug 8780.
User avatar
=CO= Windler
Level 2
Level 2
Posts: 34
Joined: Wed Apr 07, 2021 1:27 am

Re: Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by =CO= Windler »

DarkShadow44 wrote: Fri Jun 30, 2023 1:05 pm EDIT: Can you try "winetricks oleaut32"? This seems to be it.

EDIT2: Turns out, it's bug 8780.
I have added in "DLL-Überschreibungen" of the WINE config menu the library "oleaut32 (Native, Builtin)" now, which indeed now runs my tables without modification.

But quitting to the Visual Pinball editor and returning to game (click Play or press F5) still only displays the screen background without table, which would make editing of pinball tables next to impossible.
User avatar
DarkShadow44
Level 9
Level 9
Posts: 1338
Joined: Tue Nov 22, 2016 5:39 pm

Re: Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by DarkShadow44 »

Can you attach a screenshot of the issues? And logs? It seems to work for me.

What I did in detail:

Program download: https://archive.org/download/Visual_Pin ... all811.zip
Table download: http://weltenschule.de/pinball/Boomerang1.4emu.zip
- Use wine-8.11
- Create new 32bit WINEPREFIX
- "winetricks whs57 oleaut32", work around bug 8780 and vbscript issues
- Run VPinball.exe
- File -> Open -> Select table
- Press F5
- Close the "Visual Pinball Player" window again
- Press F5 again

Does following those exact steps give the same issue?
User avatar
=CO= Windler
Level 2
Level 2
Posts: 34
Joined: Wed Apr 07, 2021 1:27 am

Re: Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by =CO= Windler »

These are the 2 screenshots when I return from editor into play mode (pressing F5) and when I have clicked the rules sheet popup away. Clicking then on that background or pressing keys after making a screenshot does nothing anymore. I had to press ALT-F4 to close VP8 to get back to the desktop.

It might be also a compositor issue of KDE Plasma 5. KDE control panel displays this system info:
Operating System: Linux Mint 20.1
KDE Plasma Version: 5.18.8
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Kernel Version: 5.4.0-104-lowlatency
OS Type: 64-bit
Processors: 8 × AMD Ryzen 5 2400G with Radeon Vega Graphics
Memory: 13,7 GiB
Attachments
VisualPinball8 bug2.jpg
VisualPinball8 bug1.jpg
User avatar
DarkShadow44
Level 9
Level 9
Posts: 1338
Joined: Tue Nov 22, 2016 5:39 pm

Re: Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by DarkShadow44 »

That's weird, I also have KDE and it works for me... Did you use the exact same steps as I did?
User avatar
=CO= Windler
Level 2
Level 2
Posts: 34
Joined: Wed Apr 07, 2021 1:27 am

Re: Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by =CO= Windler »

Yes. May it be that that the Ryzen 2400G APU makes graphics trouble? It looks like that only the 3D rendered part is not redrawn (or drawn behind the background layer by wrong order?).

I depend on using PlayOnLinux because this PC is a production system (not a toy) that depends on various other Windows programs running on an old but more stable WINE version without 3D acceleration.
User avatar
=CO= Windler
Level 2
Level 2
Posts: 34
Joined: Wed Apr 07, 2021 1:27 am

Re: Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by =CO= Windler »

I just discovered a crucial detail. The missing playfield bug on WINE (returning from editor) occurs only when in VP8 menu "Video Options" the item "Cache Rendered Table" is off. On my real Win98SE system this does not happen (and because its 550MHz CPU renders slow, I normally keep it turned on).

Here is another graphics bug. When I run VP8 in a window and minimize and restore it, roughly every 2nd time the window is not properly redrawn, but only moving/updated parts appear on black background with the ball painting a trail of redrawn stuff. (The missing playfield after returning from editor to play mode happens also when windowed. In windowed mode (1024*768) the lower rim of the screen is truncated, which however also happens on real Win98SE and so is no WINE bug.)

Also the VBScript popup window with game rules is not well formatted/has wrong size on WINE. It is too narrow and so shows ugly text line breaks where they don't happen on real Win98SE.
Attachments
VisualPinball8 bug3.jpg
User avatar
DarkShadow44
Level 9
Level 9
Posts: 1338
Joined: Tue Nov 22, 2016 5:39 pm

Re: Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by DarkShadow44 »

Thanks for the details, I created a bug report for you: https://bugs.winehq.org/show_bug.cgi?id=55186

Unfortunately I can't reproduce the minimize-redrawing issues, but feel free to add another bugreport. you can use mine as template, if you want.
User avatar
=CO= Windler
Level 2
Level 2
Posts: 34
Joined: Wed Apr 07, 2021 1:27 am

Re: Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by =CO= Windler »

The missing playfield when "Cache Rendered Table" is off is a major issue for editing/fixing pinball tables, particularly because this mode does not exist in VP6 and hence can not be simply turned on. VP6 also draws an ugly square around the balls and so is less usefull on WINE, but some pinball tables need it (e.g. HeavyHitterVP6 (HHVP6VL.zip) draws a black playfield background when run in VP8).

The window minimize bug is a small glitch and less problematic. Generally VP and other programs on WINE occasionally startin a black window (only some widgets visible) until they redraw. Perhaps it has to do with my very handtweaked KDE Plasma theme using "Se7en Aero", "Se7enAero Style" and application style "gtk2".
User avatar
DarkShadow44
Level 9
Level 9
Posts: 1338
Joined: Tue Nov 22, 2016 5:39 pm

Re: Bug/Workaround:Visual Pinball 8 error (VP8/VP6|VBScript constants undefined)

Post by DarkShadow44 »

I'm not sure. Did you already consider creating an issue yourself? Maybe the d3d devs can help with this one.
Locked