Westworld

B2S Server - new feature - aspect ratio

20 posts in this topic

modifications compared to last official version (based on trunk 14 https://sourceforge.net/projects/b2s-backglass/):

1) Bug fix: Alternate tablename.res (replacing screenres.txt) failed for Server running as EXE
2) Bug fix/feature: support alternative ways to find direct2BS based on gamename
3) feature: proportional aspect ratio for backglass as option per table


1) Bug open for long (such as in http://www.vpforums.org/index.php?showtopic=23072&page=8)
B2SServer, running as DLL, allows to overwrite screenres.txt with tablename.res to use alternative backglass settings. This never worked if running as EXE. Fixed.

2) exe mode fails on some computers for some tables in exclusive mode called via Pinballx

If this happens, you get an error message saying "File 'C:\Games\Visual Pinball\Tables\.Direct2BS' not found. Please rename...". 
The error happens because the server cannot detect the table name, so cannot find the file.

To solve this, the direct2BS file search path was changed, new rule:

try to find tablename.direct2BS. 
If not existing, try to find gamename.direct2BS  (=ROM name)
If not existing, continue with Hyperpin/PinballX XML file and:
find in XML tablename, if found try to find description.direct2BS (like "Charlie's Angels (Gottlieb 1978).direct2BS")
If not existing, find in XML inside <game> the node <rom> with gamename. If found try to find description.direct2BS
If not existing, find in XML inside <game> the node <gamename> with gamename. If found try to find description.direct2BS

Node <rom> is already existing in some PinballX database files, which will solve the issue without any manual option. If not, just enter the ROM name (=gamename). If you do not want to use the <rom> setting for other reasons (as it might trigger different PinballX behavior), you can enter the new node "gamename".

Example:
    <game name="The Machine - Bride Of Pinbot (Williams 1991)_rev1.1">
        <description>The Machine - Bride Of Pin-Bot (Williams 1991)</description>
        <rom>bop_L8</rom>
        
Example 2:
    <game name="The Machine - Bride Of Pinbot (Williams 1991)_rev1.1">
        <description>The Machine - Bride Of Pin-Bot (Williams 1991)</description>
        <gamename>bop_L8</gamename>
        
In both cases, if used gamename = bop_L8, it will try to launch The Machine - Bride Of Pin-Bot (Williams 1991).direct2BS

Just in case, if the search still fails, you can enable a debug log.
Open file B2STableSettings.xml (in folder tables)
Check for entry:   <LogPath>C:\Users\Flipper\Desktop\log</LogPath>
If the entry is missing, add it, define a valid path, like to a folder on your desktop
Insert:   <IsBackglassSearchLogOn>1</IsBackglassSearchLogOn>
Now launch the table from PinballX. Wait for the error message, confirm and quit PinballX. In your log folder you find a file named BackglassSearchPath.txt.
If the content does not help you to understand the issue, post the content here.

3) New Feature - proportional backglass

While most of us are using 16:9 screens to display the backglass, pinballs of the 70's or 80's used more a 1:1 glass. As result of the stretching we get fat faces and weird looking design. Similar as watching an old TV Show, made for 4:3 television on a 16:9 LCD TV.

Goal is to make it easy to get a better display for these older tables.

How to setup:
Open your ScreenRes.txt file
It should have 12 lines.
Add 5 more:
x
x
xx
xx
C:\path

The first two defines the position of the alternative scaled picture, starting by 0/0.
For a Full HD (1920x1080) screen, a good value is 250/0
The next two values defines the size of the alternative scaled picture.
For a Full HD (1920x1080) screen, a good value is 1420/1080
(500 pixel smaller, with 1420/1080 we get closer to 1:1, even it is still slightly stretched. Of course you can adapt the values as you prefer. As it is 500 smaller, we used a starting position of 250 in the first pair).
The last value is a path to a background picture, used to have a frame around the scaled image.
If you keep this line empty the frame will be black.

Everything else unchanged. As the first 12 lines stays unchanged, ever other tool will continue to work, such as PinballX or PBXRecorder.

Last step: Run PinballX setup, turn off "Auto Position DirectB2S" in Display Settings. Alternativ write lock ScreenRes.txt file, else PinballX will overwrite it.

How it works:
(repeat this for every table)
start your table as normally, click on the backglass screen, press "S" on your keyboard to get the settings dialog.
Click the "Small" button. Click Save Settings.
Restart your table.

Tip:
Sometimes you might want an exception. A special table with another background/color - or different size.
Easy. Duplicate your ScreenRes.txt file and rename it as tablename.res.
Note: .res, not .txt!
Modify the values as you like, different scaling, different background picture.
When a .res file with the same name as the table exists, it will automatically replace the default screenres.txt

BackglassServer.exe and example background.png, as well as modified source code is enclosed. Also a backglass using the enclosed background as example.

 

Charlie's Angels (Gottlieb 1978).png

 

 

 

b2sbackglassserverexe_source.zip

B2SBackglassServerEXE.zip

Edited by Westworld
new Server.exe and new Source, with debug feature to analyze search path.

Share this post


Link to post

Hey that's pretty cool, no more wacky stretched stuff!  

Now if Charlie's Angels only had blue displays instead of red :( as all system 1s did, yeah I know easy enough to change.

Share this post


Link to post
6 hours ago, BorgDog said:

Hey that's pretty cool, no more wacky stretched stuff!  

Now if Charlie's Angels only had blue displays instead of red :( as all system 1s did, yeah I know easy enough to change.

B)

Share this post


Link to post

Even if you are not using any of the listed features, please give the updated B2S a try.   We'll commit the change to the main repo once we know everyone finds it to be stable.     

Share this post


Link to post

For this section:

2) exe mode fails on some computers for some tables in exclusive mode called via Pinballx

If this happens, you get an error message saying "File 'C:\Games\Visual Pinball\Tables\.Direct2BS' not found. Please rename...". 
The error happens because the server cannot detect the table name, so cannot find the file.

To solve this, the direct2BS file search path was changed, new rule:

try to find tablename.direct2BS. 
If not existing, try to find gamename.direct2BS  (=ROM name)
If not existing, continue with Hyperpin/PinballX XML file and:
find in XML tablename, if found try to find description.direct2BS (like "Charlie's Angels (Gottlieb 1978).direct2BS")
If not existing, find in XML inside <game> the node <rom> with gamename. If found try to find description.direct2BS
If not existing, find in XML inside <game> the node <gamename> with gamename. If found try to find description.direct2BS

Node <rom> is already existing in some PinballX database files, which will solve the issue without any manual option. If not, just enter the ROM name (=gamename). If you do not want to use the <rom> setting for other reasons (as it might trigger different PinballX behavior), you can enter the new node "gamename".

Example:
    <game name="The Machine - Bride Of Pinbot (Williams 1991)_rev1.1">
        <description>The Machine - Bride Of Pin-Bot (Williams 1991)</description>
        <rom>bop_L8</rom>
        
Example 2:
    <game name="The Machine - Bride Of Pinbot (Williams 1991)_rev1.1">
        <description>The Machine - Bride Of Pin-Bot (Williams 1991)</description>
        <gamename>bop_L8</gamename>

In both cases, if used gamename = bop_L8, it will try to launch The Machine - Bride Of Pin-Bot (Williams 1991).direct2BS

I just tested with Metallica through PinballX and it seems like the search stops after trying to use gamename.directB2S.  In my PinballX.xml for Visual Pinball X, I have the description set to Metallica, so from your example I would expect the B2S server to look for tablename.directB2S, then gamename.directB2S, and then, in my case, Metallica.directB2s, which is what I have my backglass named as.  What is actually happening is that I'm getting an error saying that mtl_117.directB2S (game name) can't be found.

I did notice that the rom name element is blank for this XML entry (and all XML entries created through the game manager) which might be the issue? 

EDIT: I edited the PinballX.xml and added the rom name, but still get the same error.

Share this post


Link to post

> What is actually happening is that I'm getting an error saying that mtl_117.directB2S (game name) can't be found.

yes, this is exactly the problem. The B2SServer is not able to detect the tablename, normally it fails here. The original version reports ".directB2S can't be found" (no name, just .directB2S).

As it does not know the table name, it cannot look for tablename.directB2S. As alternative it tries to see if mtl_117.directB2S is available and uses that, if existing - not in your case.

Next it checks for an entry "<gamename>mtl_117</gamename>" - and if that's not found, it will check for "<rom>mtl_117</rom>"

And that was supposed to work and failed because of a bug, stupid last minute change.

I fixed it and uploaded a new version of the server.exe (in the first post). Please download and replace it. Thanks for the report. Please let me know if it works for you now.

Share this post


Link to post

Thanks again for another update.  

So if I wanted to have a feature added to b2sserver where would be a good place to ask for such a thing?  Hopefully at some point VP will handle multiple screens itself, but in the mean time it would be really handy if we had some alphanumeric display ability built in, basically an extension of the current reels maybe? or something. Or is there something already there that I don't know about?

 

Share this post


Link to post

Just create a new thread here at VPU. DJRobX and toxie both have write access to the code. The code is open-source now, so nothing stopping you from messing around with it too.

I've only just started playing around with the designer myself, but I did notice a place to import LED images. I just haven't gotten around to trying it out. But I know what you are talking about. The built-in Dream 7 display looks good in certain designs and looks really bad in others. I was interested in seeing if this could be improved as well. It may be as easy as importing an alternative set.

Share this post


Link to post

Thanks Carny, about the only messing around with the code I could possibly do is mess it up,:o  But I'll start another thread.  I've made a few b2s for a few tables I've done and did see the part about importing your own images, but if i remember right you can only do 0-9, and I would also like A-Z.... maybe I'll look at it again before posting.

Share this post


Link to post
On 1/1/2017 at 7:57 AM, Westworld said:

> What is actually happening is that I'm getting an error saying that mtl_117.directB2S (game name) can't be found.

yes, this is exactly the problem. The B2SServer is not able to detect the tablename, normally it fails here. The original version reports ".directB2S can't be found" (no name, just .directB2S).

As it does not know the table name, it cannot look for tablename.directB2S. As alternative it tries to see if mtl_117.directB2S is available and uses that, if existing - not in your case.

Next it checks for an entry "<gamename>mtl_117</gamename>" - and if that's not found, it will check for "<rom>mtl_117</rom>"

And that was supposed to work and failed because of a bug, stupid last minute change.

I fixed it and uploaded a new version of the server.exe (in the first post). Please download and replace it. Thanks for the report. Please let me know if it works for you now.

I tried over the weekend and was still getting the same error.  Here is the Metallica table entry in my PinballX xml file:

<game name="metallica 122315b">
<description>Metallica</description>
<rom>mtl_117</rom>
<manufacturer>Stern</manufacturer>
<year>2013</year>
<type>SS</type>
<hidedmd>True</hidedmd>
<hidebackglass>True</hidebackglass>
<enabled>True</enabled>
<rating>5</rating>
</game>
 
My backglass file is Metallica.directB2s
 
From the way I understand it, the way it should work is the following:
 
- Since the code cannot detect the tablename it should be looking for mtl_117.directB2S.
- Because that file is not there there it should be looking in the xml for a 'game' where the rom entry = mtl_117
- Finding that it should use the description from the 'game' which in this case is Metallica
- So the code should be looking for Metallica.directB2S
 
I'm still getting an error saying "mtl_117.directB2S can't be found"
 
As far as I know, I have the latest version of your B2SBackglassServeEXE code.
 
 

Share this post


Link to post
1 hour ago, ArkMalmeida said:

I'm still getting an error saying "mtl_117.directB2S can't be found"

Your XML file looks perfect, I cannot see an error.

On my cabinet I was not using this Metallica version (I had still an older PM5 version - and the issue only happens with VPX10.2). It should not matter, as all other Stern tables works fine, but to be sure, I'll install it tomorrow for testing.

Just to be sure, I have added the "right" Server version again. Should be the same, but I cannot imagine another reason.

If it still fails with that one, only for testing, could you duplicate your backglass Metallica.directB2S and name it mtl_117.directB2S. Will it run like that? Of course not the solution, but maybe a workaround for you till we found the real issue behind.

B2SBackglassServerEXE.zip

Share this post


Link to post
On 9.1.2017 at 8:04 PM, ArkMalmeida said:

I'm still getting an error saying "mtl_117.directB2S can't be found"

thanks again for reporting it. I confirm that Metallica did not worked...
I corrected the issue and uploaded (see first post) a new version of the compiled Server.exe, as well as the source.

The new version also contains a new debug feature (see first post), just in case there is another table failing. This will at least help to understand why...

Share this post


Link to post

fist wow: I totally appreciate your efforts, it is really working by renaming the dB2S files with the ROM names using your derivate.

But, second wow: now things get really complicated and this means really a lot of work for those having the problem. It is not only renaming the files, but before we have to check, which ones make problems, then go into the script of each table to find the ROM used here (I like others sometimes have different ROMs for each table). This is like setting up your cab from scretch.

so, wouldn't it be better to contact Tom Spiers (the maker of PinballX) to address this problem? As far as I understood (yes, I understood only half of what was written here) and from what I experience it is a problem of PinballX...

Please don't get my comment as ranting, what you do here is great. Thanks!

Share this post


Link to post

Can always consider the DOFconfigtool way where configurations are identified on the basis of the parent rom name prefix rather than the full rom name. But I guess that depends on how many people run different b2s and different vpt/vpx for the same table. I just tend to pick one set for each table.

I never thought that the VPX fullscreen issue about file names. If I run Task Manager in the background then I never have a problem with VPX/PinballX loading the correct db2s. (Why that works, I don't know. But that's why I don't think it is a naming issue but perhaps a timing issue). It has not been a problem for me to simply name the db2s identically to the table file name. I'm not sure what we're trying to solve here unless it's just someone's housekeeping issue. But that's my opinion. I also think that simply editing xml in Notepad is easier/faster than using Game Manager.

Aspect ratio will be very much welcome by some people. But then you will have to live with letterboxing. There's no free lunch!

Share this post


Link to post

I have 2 questions:

1. Just out of curiosity, when parsing the PinballX xml, why does it not just try to find "game name" and search for the same named .directB2s and use it? This is exactly what's given anyways for most users: the diectB2s file has the same name as in "game name" in the xml file. Wouldn't this be the easiest way?

2. As it is now, can I just fill the "rom" tag with the same as is written into "game name"? Like this:

    <game name="VPX - Demolition Man 1.2 (Williams1994)">
        <description>Demolition Man (Williams 1994)</description>
        <rom>VPX - Demolition Man 1.2 (Williams1994)</rom>
        <manufacturer>Williams</manufacturer>
        <year>1994</year>
        <type>SS</type>
        <hidedmd>True</hidedmd>
        <hidebackglass>True</hidebackglass>
        <enabled>True</enabled>
        <rating>0</rating>
        <alternateexe>VPinballX.exe</alternateexe>
    </game>

I really don't want to mess with renaming all 189 directB2s files and this would be the easiest way to make it work.

Sorry, if I misunderstood something basic, not sure about that

Edit: I think my second question was answered with a comment from you at vpforum:

" The Pinballx XML file (or Hyperpin xml file) can contain a <rom> tag, just enter the game name/rom name, and it uses that to find the description name. "

So the answer is: yes, I can :)

Edit 2: no it does not work (shouldn't it from the desription above?)

<gamename>VPX - Demolition Man 1.2 (Williams1994)</gamename>
also does not work

and a third question: how can it parse the xml, when it doesn't know the tablename, which is the main problem?

 

From comments over at vpforum I have the impression, that you consider the description from the xml as the correct name for the dirctB2s file? This is not true. the correct name is only in the name="bla bla bla". The desription can be something like "Demolition Man VPX version from person XY and I got it in 2016" whereas the directB2s is VPX - Demolition Man 1.2 (Williams1994).directB2s.

Share this post


Link to post
21 hours ago, vogliadicane said:

so, wouldn't it be better to contact Tom Spiers (the maker of PinballX) to address this problem?

This was done in the gamex forum - but as it is not reproducible and happens only on some machines, how should he debug it?

CarnyPriest's trick with running Task manager worked for me, 9 of 10 tables run suddenly. Still some did not - and that's why I started to try to find a reason. Of course on my notebook, with Visual Studio (so debugger) everything worked, it happens only on my cabinet and I don't want to install too much software there. That system should run pinball fast and nothing else...

I tried to debug by writing logfiles. Doing so I realized that the code fails to read the window title, but I did not understand why. If I would be a professional developer, I would start debugging VPinball 10.2 next, as this application sets the window title. PinballX is not doing so, it calls VPinball with option -play and the table name. That's I do not really think it is pinballx...

23 hours ago, vogliadicane said:

but before we have to check, which ones make problems, then go into the script of each table to find the ROM used here

not so difficult. Just launch all tables from PinballX. I took it as good reason to play though my game list and try each.

If one fails, it shows in the error message the ROM name. Then I open the XML file, look for that table (based on the description name displayed in PinballX) and entered the displayed rom name in the <rom> tag. Done.

Share this post


Link to post
2 hours ago, vogliadicane said:

    <game name="VPX - Demolition Man 1.2 (Williams1994)">
        <description>Demolition Man (Williams 1994)</description>
        <rom>VPX - Demolition Man 1.2 (Williams1994)</rom>
        <manufacturer>Williams</manufacturer>
        <year>1994</year>
        <type>SS</type>
        <hidedmd>True</hidedmd>
        <hidebackglass>True</hidebackglass>
        <enabled>True</enabled>
        <rating>0</rating>
        <alternateexe>VPinballX.exe</alternateexe>
    </game>

no, that list is wrong. I assume the rom name is something like "dm_lx4" or so (don't remember the rom name).

When you try to launch from PinballX, the error message shows either the table name (here VPX - Demolition Man 1.2 (Williams1994)) or - if you run into the issue that the name is not found - the Rom name, so dm_lx4.direct2bs not found.

In that case, change the xml to:

<rom>dm_lx4</rom>

Save the XML. Now it will loop through the XML, find dm_lx4, and search for:

dm_lx4.direct2bs

OR

Demolition Man (Williams 1994).direct2bs

The name is identified based on the ROM name. 

 

Additional info:

the naming convention for a direct2bs is normally:

tablename.direct2bs (like in your case VPX - Demolition Man 1.2 (Williams1994).direct2bs)

OR

description.direct2bs (in your case Demolition Man (Williams 1994).direct2bs)

tablename is not working in this case! Only romname or description name works. 

The benefit from using description as name is that you can have several tables using the same backglass and if you replace/update your table you do not need to rename the backglass. That was the original idea and it is still followed here.

 

Share this post


Link to post

Well I get it now, thanks a lot for your detailed explanations!!

So you use the ROM name (from the error) to find the correct entry within the xml.

Isn't it possible that  you parse UP until you are at the "game" level, read the name="..." and then look for the apropriate directB2s file, because

"Additional info: the naming convention for a direct2bs is normally: tablename.direct2bs (like in your case VPX - Demolition Man 1.2 (Williams1994).direct2bs)"

that's what most if not all people (including me) use atm*. Then we would not have to change anything at all.

 

*OR description.direct2bs (in your case Demolition Man (Williams 1994).direct2bs)"... I never eard of this one before.

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now