SoapboxRaceWorld/soapbox-race-core

Fix stock vinyl related issues

Closed this issue · 6 comments

Some presets include "stock" vinyls that are not available in the shop (usually, at least). That by itself is not an issue. However, there appears to be an internal inconsistency in data, since attempting to perform any customization will usually result in a "Invalid Basket" error.

Cannot reproduce locally, even after re-introducing the "invalid basket" code. More testing is necessary.

Closing this for now, further testing is pending.

when i am trying to restore the mr2 gymkhana's stock vinyls SPECIFICALLY using vinylmanager.exe game crashes when hitting confirm, i believe that is kinda relevant to this case.

The game crashes because vinyl manager is unable to locate one of the vinyls. Most servers do not have the stock vinyls in the shop.

This issue has been resolved. A technical explanation:

When a car is purchased, the game assumes that the server is in sync with the client regarding presets, and that the server is able to handle customization. Normally that assumption is true. However, presets with full-body vinyls present an interesting difference: although the raw data indicates a scale of (0, 0) [1], the game client makes a change:
(pseudocode for reader understanding)

  if ( this->ScaleX == 0 )
    this->ScaleX = 3277;
  if ( this->ScaleY == 0 )
    this->ScaleY = 3277;

When customization requests were submitted to the server, the server didn't recognize the meaning of 3277, and assumed the vinyl was added. This caused the server to reject any attempt at customization, because it didn't recognize the apparently-added vinyl.

This has been resolved with 2 steps:

  1. Updating the server so that it correctly handles 3277 scale.
  2. Updating server-side basket definitions to be in sync with decoded client presets (there was another issue that I encountered during testing; this second step has resolved that issue)

This was certainly very interesting to debug and resolve. Updated basket data will be published at some point.

[1]: (x, y); ScaleX, ScaleY

this looks very in-depth solved, i like it. We are waiting for sbrw wiki to be updated :D