Thursday, March 4, 2021

Cut Lucky Hit Boards Resurrected in Shenmue 2 After 20 Years | Dragon & Phoenix Project Discoveries

 

Shenmue 2 was the first game in the series to introduce the game of Lucky Hit. A number of stands can be found throughout Hong Kong where Ryo may play to increase his savings, or take on a part-time job and pit his skills against passers-by.

Lucky Hit boards are scattered throughout Aberdeen, Wan Chai and Kowloon, and they offer plenty of variation: each game has its own board size, backing illustration, nail lay-out, payout ratio, rules and rewards. Many of these are easy to miss on a first play-through, being placed in little-used alleyways or sprinkled through the dilapidated buildings of Kowloon.

All these years after the game's release, renowned Shenmue modder and lead of the Dragon and Phoenix project LemonHaze has discovered the existence of a "master settings file" that defines the set-up of all the Lucky Hit boards in Shenmue 2.

Inside this file are several never-before-seen dormant Lucky Hit boards that were disabled before the game's release. LemonHaze has successfully brought these disabled Lucky Hit boards back to life, and they can even be played!

Not only that, but the discovery opens the way to allowing customization of all the Lucky Hit boards in the game.

Let's jump right in to gaze upon a slice of history in the form of the newly-uncovered Lucky Hit boards that were cut before release. For some video footage of the amazing discoveries described here, see the end of the post.


Cut Content Unearthed: New Lucky Hit Boards at the Thunder House

Our location of interest is the "Thunder House" in the Dim Sum Quarter of Kowloon and is the shell of a derelict building that has partially collapsed and is now used as an entertainment area by the locals. It is accessed down a steep set of steps (near the circular arrangement of boards known as the "Lucky Hit Museum").

Entrance to the grandly-named "Thunder House" in Kowloon

Normally, the interior contains three table-top Lucky Hit boards set up at one side of the room, on a long table. Apart from that, there is nothing much else of note apart from a jukebox on the other side of the room. But take special note of the empty space near the wall at the end of the room, past the Lucky Hit boards.

Interior of the Thunder House, with 3 Lucky Hit stands. Note the empty space (circled) towards the back.

This is where the magic begins: LemonHaze discovered that inside the Lucky Hit board control file are complete definitions for 3 additional Lucky Hit boards for the Thunder House that were once present during development but which were turned off before release of the game.

On making a small edit to the Lucky Hit control file to re-enable these settings, he succeeded in making the three brand-new Lucky Hit boards appear inside the Thunder House, in the space at the end of the room, just as they once would have long ago!

After enabling the newly-found entries in the configuration file, three new Lucky Hit tables appear!

The three new Lucky Hit tables

Looking at the new boards in more detail, they are all follow the "Take Two" rules and have Skull pockets: the player is given three balls and must drop the ball into a circle pocket at twice; if the ball hits a Skull pocket, the game is instantly over.

  • Left Board: $50 bet, x2 pay-out. 
  • Middle Board: $10 bet, x8 pay-out.
  • Right Board: $10 bet, x10 pay-out.

All the new boards are also fully playable! To do so, Ryo approaches the operator to play a game as usual, and the boards will be automatically included for selection.

Another interesting observation from the settings of the new tables is that they specify a completely different character in charge of their operation: the three tabletop boards are run by Zhaozhi Duan (character model ID "CHX"), but the newly-activated boards specify a different character (whose internal character model ID is "OD3") altogether - on consulting the Shenmue Dojo's Shenmue character expert, Miles Prower, it appears this character may in fact be one who is not to be found anywhere else in the game.

The existing Lucky Hit operator at the Thunder House (left) and the character specified to run the three new boards (right).

Even when the new boards have been enabled, if Ryo now applies for a part-time job at the stand, only the original three boards are ever selected by customers. Perhaps this may be related to the differing operator IDs specified in the file.

In any case, it is incredible to look back on history in this way and contemplate these tables that have been brought back to the Thunder House for the first time in over 20 years.


Super Size Me

The next piece of Lucky Hit cut content LemonHaze has discovered is something that have been an amusing easter egg while testing during the development stages of the game - a super-sized Lucky Hit board!

In the release game, there is nothing of particular interest to be found on the bottom floor of the God of Wealth Building - just an empty space.

The ground floor of the God of Wealth Building

However in fact this space was once hiding a huge secret - literally "huge," being a scaled-up Lucky Hit board about 10 times the scale of a usual board!

This too is a disabled entry in the present in the Lucky Hit settings file.

The configuration setting for this super-sized board gives the operator as character model ID "FD2" - this NPC would once have been lurking around in the gloom of the God of Wealth basement. He also has been removed from this location in the release version of the game, and appears to be another otherwise-unused character:
The operator of the super-sized Lucky Hit board

Enabling the board again has a slight complication is that the game's logic for Lucky Hit boards requires a Lucky Hit operator (such as the fellow shown above) to be nearby in order for the board to show. Since there is no longer any operator present where the board was originally located, the board is not immediately displayed there even after enabling it.

To get around this problem for now, LemonHaze edited the board's position coordinates in the configuration file to move it to an existing Lucky Hit stand elsewhere in the game - the one at the end of Queen's Street. Upon doing so, a huge board, or at least the lower part of it, appears there protruding from the building! 

Close-up of the pocket end of the super-sized board.  (Image: LemonHaze)

The image below shows the giant board making an appearance at the Thunder House - rather hilariously, a huge betting information sign can also be seen accompanying it to its right. The game follows the One Shot rules and has two winning pockets of four, with a bet of $100 and a x5 pay-out.

Bird's eye view of the giant board.

The giant board can even be played in the usual way, despite the presence of any scenery objects as these don't affect collisions. A couple of side effects of the large scale are that Ryo's arm when dropping the ball appears amusingly tiny in comparison to the ball, and the ball feels "sluggish" as it falls compared to the usual-scale boards.


One feature of the God of Wealth building is that it has one of the nefarious wooden plank crossings high up on the 5th Floor above the central void, and this huge Lucky Hit board would have been right underneath. If a player failed the plank crossing QTE they would have restarted exactly where the Lucky Hit board was placed.

Ryo loses his balance on the 5th floor of the God of Wealth building and plunges down... towards a giant Lucky Hit board?

However as there are no other examples of this size setting for Lucky Hit boards used anywhere in the game, so it seems most likely that this super-sized Lucky Hit board was a placeholder, or simply an office in-joke.

Now, having seen the result of enabling these dormant tables, let's have a brief look at how the Lucky Hit boards are configured in the game files.


The Lucky Hit Master Configuration File

As mentioned in the introduction, all the information needed to create and position a new Lucky Hit board is contained in a single master file that the game uses for all the Lucky Hit boards within Shenmue's world.

It is inside this file that the unused board entries discussed earlier in this post are located.

The file is in comma-separated text format, and is named PATI_TBL.BIN. It is located inside scene\xx\pack\pati.pks.

An excerpt of the first few lines of the file is illustrated below, with annotations for some of the values to indicate their meaning.

A sample excerpt from the Lucky Hit master configuration file

The file is divided into sections by Map ID; in the example above, the entry is under a Map ID of "AR03" which represents Queen's Street.

This is followed by pairs of lines, each defining a complete Lucky Hit Board with its own board ID (BDxx). 140 such board definitions can be found in the file.

The settings defined here are comprehensive and include:
  • Precise positional coordinates of the board in the world, and its rotation
  • Which NPC operates the stand
  • The Lucky Hit game variant (e.g. "IPPA"=One Shot, "TAK2=Take Two) and other special behaviors that may apply (e.g. "NORM"=normal/standard game, "DETH"=contains Sudden Death pockets, "KEIH" indicates that prizes will be won instead of cash, and so on).
  • Bet amount and pay-out
  • The board style ("M"=table-top size, "L"=full-standing, "X"=super-size)
  • The board's nail layout (as a texture image)
  • The illustration painted on the board's backing
  • The number and type of pockets.  These are simply defined as a text string such as "*&&  &*&" (where "*" is a winning pocket, a space is a losing pocket and "&" is a sudden-death pocket). The maximum number of pockets on a board is 10.
Thanks to the discovery of this file, god-like Lucky Hit powers have been brought within reach!

Nailing It


Shenmue uses a clever trick when displaying the nails on the Lucky Hit boards to reduce unneeded display effort. LemonHaze explains: "If you run past a Lucky Hit board and look at it, the nails are a flat texture, but when you interact with it, the game will create real 3D nails from X/Y coordinates stored in other files".

On-the-fly nail creation: before Ryo plays a game, the nails on the Lucky Hit board (left) are a flat pattern laid onto the board (center). When Ryo is about to play a game (right), the flat texture is replaced by three-dimensional nail objects.

So when Ryo is not directly interacting with a board, rendering effort is saved by simply laying a flat image of the nails over the board. It's only when Ryo is about to play a game on the board that a full set of three-dimensional nails is generated on the board.

View of three-dimensional nail layout for a Lucky Hit Board. (Image: LemonHaze)

Other Lucky Hit Secrets: Humidity Dependency

In a September 2018 PC Gamer interview with d3t's Noel Austin, technical director of the development studio behind Shenmue I & II, he mentioned the following when asked about interesting findings in the game's code:

Noel Austin: The Lucky Hit games adjust the physical behavior of the ball based on the weather and temperature, calculated by the time of day.

LemonHaze's analysis of the code has identified the specific piece of logic referred to, confirming that this is indeed the case! The ball's drop rate has a dependency on both the current weather conditions (Fine / Rain / Cloudy) and the temperature (as determined by a calculation based on the current date and time).

Logic for adjusting the Lucky Hit ball drop rate depending on weather and temperature. The d3t_assert messages are likely to be the original debugging messages that were inserted by AM2.


About the Development of Lucky Hit

It is evident that much effort must have been devoted to creating Lucky Hit for Shenmue 2, and this is confirmed by the developers themselves. Here is an extract from an interview with AM2's Shinichi Yoshino and Yoshihiro Okabayashi, published in October 2001 in Japan's Famitsu DC magazine:

Yoshino: Lucky Hit has a long history! A prototype already existed when I joined the project. We've built and refined it over almost 4 years. For some reason, it's proven to be really popular among people like Shenmue's scenario writers, voice actors and mocap actors, who have no direct connection with the game industry. They say it's fun just to watch the ball dropping. It's just a game where you either end up in the circle pocket or not though. [laughs]

Okabayashi:
 We were so apprehensive and anxious while we were building it. To be honest, I'm still not sure now that it's finished.... I find myself asking, is this really fun? [laughs] Everyone who tried it during development said it was, but as the ones who worked directly on making it, we became unable to tell. That shows how long we spent working on it.

AM2 developers Shinichi Yoshino (left) and Yoshihiro Okabayashi (right) interviewed in 2001.

Final Words

In this post we presented some amazing Lucky Hit cut content uncovered by LemonHaze, allowing them to see the light of day once more two decades later. Added to this is the underlying discovery of the configuration file that allows numerous aspects of Shenmue's Lucky Hit boards to be adjusted and extended, opening up all sorts of exciting possibilities. It is sure to lead to some fun projects and customizations!

Many thanks once again to LemonHaze for allowing us to share his findings on the blog. More Shenmue discoveries and secrets to come in future posts, courtesy LemonHaze and the Dragon & Phoenix team. (If you missed it, also check out our recent post on Early Shenmue UI Textures).

Video Footage


Mod File

A mod file to try the new boards out yourself can be found here on the Shenmue Dojo forums.

About the Shenmue Dragon & Phoenix Collection

The highly-anticipated Dragon & Phoenix Collection is a fan project to bring Shenmue I and II onto Unreal Engine. It is an engine replacement mod for the 2018 release of Shenmue I+II for PC that replaces the original engine with Unreal Engine 4, allowing for massive improvements across the board. 

Find out more about this exciting project!
Become a Patron!

5 comments:

  1. Wow! Dat massive Lucky Hit board needs to be conquered!

    ReplyDelete
    Replies
    1. Impressive ain't it! (Such a huge board needs to give a huge payout!)

      Delete
  2. It's amazing how many secrets these games hold inside their data. Who knows what else will be found. Thank you for sharing also the data/code behind these discoveries, this is very interesting.

    ReplyDelete
    Replies
    1. It feels like each time a layer is peeled back, more secrets are revealed. With the Dragon & Phoenix project analyzing the code and files so deeply I feel sure there will be even more to come.

      Delete
  3. switch I'm curious - are you aware of anything in the lucky hit code that shows the ball is influenced by tapping left or right? i'm like 99% sure that you *can* influence the ball but i've never heard it confirmed one way or another??

    ReplyDelete