Jump to content

B2S Server 2.0 pre-release, Call for testers!


jarr3

Recommended Posts

Another round of beta testing for 2.0.3 coming up!

 

A small feature request which might not be for everyone:

In B2SBackglassServerEXE For activated background pictures, it is possible to enter a path with placeholders for "keys" in the table name.

  The keys are extracted using regular expressions (currently hardcoded)      e.g. From a table name "Blood Machines (VPW 2022) V1.21" it would extract as "{name} ({manufactor} {year}) {extra}"

 

So if the background picture path is entered like "c:\vPinball\B2SServer\backgrounds\Grill{manufactor}.png" in the res file, it will be replaced with "c:\vPinball\B2SServer\backgrounds\GrillVPW.png"

 

If no keys can be extracted from the table name, all combinations {name}, {year}... are replaced with an empty string and would become "c:\vPinball\B2SServer\backgrounds\Grill.png" in the example above.


This way only one res file is needed for many tables, but can have certain design or logos depending on the manufactor, name or even year. (and gamename = rom and tablename is available as well)

 

UPDATE: if the background picture cannot be found after key replacement, (you do not have GrillVPW.png) it will do another round replacing ALL keys with empty string and use Grill.png instead.

Edited by jarr3
Added default behaviour if picture not found
Link to comment
Share on other sites

3 hours ago, jarr3 said:

Another round of beta testing for 2.0.3 coming up!

 

A small feature request which might not be for everyone:

In B2SBackglassServerEXE For activated background pictures, it is possible to enter a path with placeholders for "keys" in the table name.

  The keys are extracted using regular expressions (currently hardcoded)      e.g. From a table name "Blood Machines (VPW 2022) V1.21" it would extract as "{name} ({manufactor} {year}) {extra}"

 

So if the background picture path is entered like "c:\vPinball\B2SServer\backgrounds\Grill{manufactor}.png" in the res file, it will be replaced with "c:\vPinball\B2SServer\backgrounds\GrillVPW.png"

 

If no keys can be extracted from the table name, all combinations {name}, {year}... are replaced with an empty string and would become "c:\vPinball\B2SServer\backgrounds\Grill.png" in the example above.


This way only one res file is needed for many tables, but can have certain design or logos depending on the manufactor, name or even year.

So I'm guessing similar to an xml? One file with all tables like the b2stablesettings.xml?

Link to comment
Share on other sites

2 hours ago, Cliffy said:

So I'm guessing similar to an xml? One file with all tables like the b2stablesettings.xml?

it is for the TableName.res files, where you have a path to the background picture.

It can take ONE line like "c:\vPinball\B2SServer\backgrounds\Grill{manufactor}.png" and generate GrillVPW.png, GrillStern.png, GrillBally.png and so on.

 

So you can have different (similar) pictures depending on the name of the table file.

Link to comment
Share on other sites

Got a question elsewhere,  if this means I can have a default grill.png to be used with a b2s if non is supplied with b2s?

The background feature (used to be called the "small" button) was initially a idea to solve backglasses which had a different aspect ratio than your screen.

If this is the case you can add a picture (or just leave the picture path empty to get a black background) to fill out the areas left and right. See https://www.nailbuster.com/wikipinup/doku.php?id=b2s_dimension_location

or the video in the wiki here: https://github.com/vpinball/b2s-backglass/wiki/Backgrounds

image.png.ca00092eed8a04d9fd7abf483f50d465.png

 

But the feature can be used for more things than this. Since it is just adding a png or jpg picture behind the backglass, it can be put underneath as a grill, see https://github.com/vpinball/b2s-backglass/wiki/Dual-Screen-examples

 

image.png.e2391c4fe2087c26967299b093db0ae4.png

 

So if I take the res file from the link above:

 

Quote

# V2.0.0-c311a21
# File is saved with B2S_ScreenResIdentifier release 2.0.0 adding the first line means it will not flip the Backglass & Background size and position
# Playfield Screen resolution width/height
1920
1080
# width/height of the Backglass
1280
655
# Define Backglass using the screen index (=x) -> **It is always the second screen from left**
=2
# Backglass x/y position relative to the upper left corner Of the screen selected
0
0
# width/height Of the B2S (or Full) DMD area In pixels
676
320
# X/Y position Of the DMD area relative To the upper left corner of the backglass screen
303
681
# Y-flip, flips the LED display upside down
0
# X/Y position of the background
0
655
# width/height of the background
1280
369
# path to the background image (C:\path\Frame)
C:\Visual Pinball\B2SServer\Backgrounds\SpikeTypeGrill{manufactor}.png

 

and change the last line to include the "key" from the table, it will now use SpikeTypeGrillStern.png, SpikeTypeGrillBally.png, SpikeTypeGrillWilliams.png depending on the table using the res file. And ONLY if the SpikeTypeGrillNamed.png is found, otherwise it will search for SpikeTypeGrill.png instead. 

And of course this could be adopted to a 3 screen setup where the grill is replaced with the full DMD picture for all tables not yet remade by @hauntfreaks to include the full DMD.

 

Link to comment
Share on other sites

  • 3 weeks later...
On 5/7/2023 at 4:01 PM, jarr3 said:

Another round of beta testing for 2.0.3 coming up!

 

A small feature request which might not be for everyone:

In B2SBackglassServerEXE For activated background pictures, it is possible to enter a path with placeholders for "keys" in the table name.

  The keys are extracted using regular expressions (currently hardcoded)      e.g. From a table name "Blood Machines (VPW 2022) V1.21" it would extract as "{name} ({manufactor} {year}) {extra}"

 

So if the background picture path is entered like "c:\vPinball\B2SServer\backgrounds\Grill{manufactor}.png" in the res file, it will be replaced with "c:\vPinball\B2SServer\backgrounds\GrillVPW.png"

 

If no keys can be extracted from the table name, all combinations {name}, {year}... are replaced with an empty string and would become "c:\vPinball\B2SServer\backgrounds\Grill.png" in the example above.


This way only one res file is needed for many tables, but can have certain design or logos depending on the manufactor, name or even year. (and gamename = rom and tablename is available as well)

 

UPDATE: if the background picture cannot be found after key replacement, (you do not have GrillVPW.png) it will do another round replacing ALL keys with empty string and use Grill.png instead.

Hi,

did a small change: it will try to replace all these placeholder names (tablename, gamename, name, manufactor, year, extra) ONE at a time in this order and replacing all others with blank.

 

so now it should be possible to add a path like this:

D:\vPinball\B2SServer\Backgrounds\SpikeGrillNoBackglass {tablename}{name}{manufactor}{year}{extra}.png

 

The placeholder names are extracted using regular expressions (currently hardcoded)      e.g. From a table name "Blood Machines (VPW 2022) V1.21" it would extract as {name}="Blood Machines" ({manufactor}="VPW" {year}="2022" {extra}="V1.21"

Additionally two hardcoded placeholders are used: {tablename}="Blood Machines (VPW 2022) V1.21" and {gamename}="the rom name"

 

which means it could find 

 

  • D:\vPinball\B2SServer\Backgrounds\SpikeGrillNoBackglass Blood Machines (VPW 2022) V1.21.png  or
  • D:\vPinball\B2SServer\Backgrounds\SpikeGrillNoBackglass Blood Machines.png  or
  • D:\vPinball\B2SServer\Backgrounds\SpikeGrillNoBackglass VPW.png  or
  • D:\vPinball\B2SServer\Backgrounds\SpikeGrillNoBackglass 2022.png  and so on.

First found, first taken!

BUT it will NOT do all permutations combining more than one placeholder!

Link to comment
Share on other sites

  • 1 month later...

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
×
  • Create New...