Skip to content

Highscores

martenschukkink edited this page Feb 3, 2025 · 23 revisions

The term "frontend" in this section is used for PinUP Popper, PinballX for PinballY.

Dealing with highscores is one of the core features of the VPin Studio. If you want to learn more about Visual Pinball Tables and highscores take a look on this video: https://www.youtube.com/watch?v=Nv5CwiXmnEQ&t=9s&ab_channel=VPinStudio

This section describes when and how new highscores are detected and processed. Let's start with an overview what highscore types are available for VPin tables:

Configuring Highscores

The VPin Studio supports three different highscore types: text files, nvrams and the VPReg.stg file. To configure the highscore settings for a table, either double-click the table in the table overview or use the toolbar button for it. Next, select the tab Score Data.

You see two sections there:

Score Data

The score data values display the primary configuration that is read of the frontend database (Popper, PinballX). For every table, these three fields values will be read to check if either a nvram, text file or VPReg.stg entry exists.

Scanned Values

The section Scanned Values shows you the values extracted from the Visual Basic script that is part of the vpx file. This information is stored by the VPin Studio and used as fallback (grey-ish text!) for the fields shown in the Score Data section.

Always ensure that at least one of the ROM fields have a value set!!!.

You can apply every value of the table scan to the frontend database by hitting the "Apply" button

Text Highscores

The scores for EM tables are stored in plain text files that are located in the VisualPinball\User folder. The name of the actual text file is defined in the VPX script of the table and often differs from the cGameName value. The VPin Studio does detect this name during the (initial) table scan, so it knows which file to parse when looking for a highscore update.

It may always happen that this scan fails. But you can select on of the existing text files from the available combo-box. Only use this option when you know that this text file was generated by the corresponding table.

The green check icon indicator shows if the exists, indicating that the configuration is probably right.

NVRam Highscores

nvram files are stored in the folder VisualPinball\VPinMAME\nvram and their filename always match with the ROM name a table is using - either the scanned value or the value set for the field "ROM Name". The fields "(Scanned) Alt. ROM Name" are used as fallback, if the nvram file is not found for the existing ROM name.

The VPin Studio utilizes PINemHi to extract the highscores from these files. If the ROM is not supported by pinemhi, you will see a red error indicator. There is nothing wrong in this case, but we will have to see if the highscore extraction will be supported in future releases of pinemhi.

VPReg.stg Highscores

The VPReg.stg file is located in the VisualPinball\User folder. The file is Windows storage file which can be understood as a filesystem within a file. This encapsulated file system stores miscellaneous metadata of VPX tables, including highscores or number of plays. The lookup works the same way as for nvram highscores.

Unsupported Highscores

If the highscore can't be resolved you should see one of the two messages shown below.

Before troubleshooting, make sure that you have played the table at least once!

You can try to fix the highscore by first checking if the ROM name of the table is set correctly. You can also invoke the script editor and take a look into the table script to search for it. If the ROM is correct, you can check if a matching entry was written in the VPReg.stg file or check if a text highscore file was generated tha matches with the table name. Updates the Score Data in the Table Data Manager dialog accordingly and rescan the highscore.

If a matching nvram file was found, but is not supported by pinemhi, you should see the following message:

Right now there is no way to support the highscore extraction for these tables.

Highscore Updates

When a game is exited from the frontend (PinUP Popper, PinballX or PinballY), a so called REST calls to VPin Studio will execute to update the highscore of the table. The call includes the name of the table that has been exited and triggers the highscore extraction with a delay of a few seconds (to avoid concurrent write access to highscore files). After the highscore has been extracted, the current score is stored into the database. If the player has created a new highscore, the current score is compared with the one in the database and corresponding change events (Discord Notifications) are "fired". Additionally, the "old" highscore is versioned.

Highscore Versioning

Everytime a new highscore has been created, a new highscore version entry is recorded in the database. This highscore history is used to create highscore graphs to see the progress of highscores and competitions.

Highscore Filtering

Usually only a few people or maybe only you are playing on your cabinet. If you don't want to see any highscores from the existing ROM default highscores, create a local player in the player section and make sure that the highscore filtering is enabled in the settings. This way, you only see the scores of your users on Discord notifications and the dashboard.

Highscore Reset and Backup

The VPin Studio allows to reset highscores and even requires it for online competitions on Discord. Of course, no one wants to loose their highscores, that's why the VPin Studio backups of highscores.

You can find the backed up highscore files in the resources folder of your VPin-Studio server installation.

Frontend REST calls to VPin Studio

There are three REST calls from the frontends to VPin Studio:

  • When the frontend is started ("frontendLaunch")
  • When a VP/FP game is started ("gameLaunch")
  • When a VP/FP game is exited ("gameExit")

Each frontend has it's own way of calling these:

  • PinUP Popper: The "Startup script", and the "Launch script" and "Close script" for VP/FP emulators
  • PinballX: The "Startup program", and the "Launch Before" and "Launch After" sections for Visual Pinball
  • PinballY: The "Startup command", and the "Run Before (2)" and "Run after (1)" fields for Visual Pinball Systems
Clone this wiki locally