Seals, where do without them
Hi, my name is Oleg, and I manage and own a company that develops and produces slot machines with a cash prize.
Since this topic is poorly covered on Habré / GT and I would like to tell you a lot, I’ll start with a general introductory article. I thought for a long time from which side to approach this topic: the standard autobiographical presentation “how I opened the casino ..” or talk about how the drums and bonuses in games are calculated, about the hardware platform used in our industry, about the architecture of programs, which we develop, about gambling, etc. But at the beginning, let it be a mini-review about everything, but I will try to make it interesting.
Immediately I would like to note that even though I am in Ukraine, where the gambling business is banned, but the development and export are quite legal. And even though we cover the full cycle (software development, game boards, graphics, sounds, enclosures, assembly, operation) - operating in countries where this business is legal, although it is strictly regulated.
A gaming machine with a cash gain (hereinafter - a gaming machine) is usually a video slot, as in the photo below.Apex gaming machine
It can also be
lottery terminal Lottery terminal of Zeus Play
bingo machine Zitro Bingo
Bingo is essentially the same lottery, this game is familiar to us by Soviet barrels in a bag, with cards, it was even called so - lotto. But nevertheless, this game is so popular among Latin American peoples that it is usually taken out in a separate class.Bingo game of own production
We are in this article, we will focus on the video slot, as the most interesting instance of gaming machines.
Technically, a standard gaming machine is a metal case, with a gaming board inside, 2-3 monitors, with a touch screen, and peripherals.There was no photo of the gaming machine in open form, in this image there is a gaming terminal of its own production. The compartment on the right with the door - for the bill acceptor
On the main (lower) monitor, a special program emulates the rotation of the reels, which contain game symbols. The drums are most often 5, each has a height of 3 characters, although, of course, there are many variations that would “distinguish”. The player's task is to catch a certain combination of symbols on the adjacent reels. Most often in a line, most often from left to right, but not always.In this game situation, 4 “10” symbols were drawn along line number 19. In this case, the “lion” symbol is a WILD symbol, which replaces any other.
Game rules are different, and usually rendered, on a separate additional monitor.Sample paytable
Interestingly, the additional monitors, which previously were just advertising glass, with information about the prizes, have grown in size so that they now exceed the main “working” area. The total number of monitors on one device can be up to five - a mini-touch control panel, a monitor with drums, 2 monitors with information on prizes / jackpots and the top monitor “topler” with the brand logo. The standard diagonal size is 24 ”.
Although some manufacturers do not stop: Gaming machines companies Arictocrat
Let's look inside the device.
The heart of the product is the game board. Previously, it was the most complex modular multilayer boards of its own production, which cost the manufacturer "a pretty penny".Novomatic Coolfire Fee
Proprietary boards had only one advantage - the complexity of manufacturing as copy protection, but this did not stop China and Taiwan. The price of the copy was very noticeable, for example, the cost of a bare copy (without firmware) of the Novomatic Coolfire gaming board reached $ 2,500.
Of course, 10 and 15 years ago, there were PC-based solutions. However, they were not very suitable for several reasons.
First of all, they did not cope well with the control of a huge number of peripherals, and with the preservation of the instantaneous state of the game with a sudden loss of power. In addition, not all regulatory and control authorities were ready for the metrology of such devices: a typical case of those times — an inspector with a programmer requires a ROM to remove the checksum of the firmware.
As a result, many PC-based products were buggy, lost data, or were generally built on the desktop version of Windows. All this created a bad reputation for PC-based devices, and even a well-functioning product was difficult to sell.
It should cancel that existed, and there are
symbiosis x86 platform, specially designed for the gaming machine.Advantech Innocore gaming platform
However, nowadays, most manufacturers use the PC platform. This was made possible thanks to technology - thanks to a capacious and reliable EEPROM, fast tires, dual-head video modules, and motherboard manufacturers who took a step towards the meeting of our industry. Moreover, both in the technical aspect and marketing. For example, it was worth ordering 200 motherboards, and Fujitsu’s development manager for Europe from Germany came to our production site.
As a result, now the standard solution for the device is an industrial motherboard, plus an interface gaming board that controls the periphery and stores financial and gaming information.
The “interesting fact” subheading: when using a PC, financial data and a gaming combination are usually stored in the game board in the EEPROM. Therefore, in order to eliminate the situation “nothing coincided on the first two reels - we pull out of the socket, and a new one”, after pressing the start button, you first have to generate a combination, recalculate finances, save a new machine state dump into the board, and only then turn the drums.
The “life stories” subheading: at the beginning of the two thousandths, one large English manufacturer producing mechanical devices sent us 5 proprietary video slot machines for testing, as a novelty. The devices were built on the basis of the PC, and that alerted immediately - based on Windows. Ok, set. On the third day - a call from the salon "we have an unrealistic big win, the player has already called the police, what would fix". Come: 99999999 hryvnia on the screen. From a zero, edinichka somehow lost in the guys in the program. Well, thanks for the BCD format, not WORD, otherwise it would be 4,294,967,294.
We use the industrial board Fujitsu D3313-S4
in conjunction with the "game" board of its own design, based on the STM32. The boards communicate with each other via Ethernet. We abandoned USB for a number of reasons, but because There are 2 ethernet connectors on the motherboard - it’s even more convenient for us.
Consider the periphery of a standard gaming machine.
"Just buttons" used earlier, were replaced by buttons with a programmable TFT-display inside. This is one of the fat advantages of our industry - you can "touch" interesting products for work purposes.Keyboard pad of Williams gaming
Now the LCD is in the trend of the touch panel, but they do not give a tactile sensation of pressing, so they are more often used in combination with the mechanical “START” button for which you can beat.Keyboard panel apparatus of the company IGT
The main element in semi-autonomous devices (there are cashless solutions, but more about them later). Typically, this is a complex electro-mechanical device, with a set of sensors and electro-mechanical actuators.JCM iVision bill acceptor model
Accepted bills are stacked in a cassette, in a stack. Standard cassette - 500 bills.
The “interesting fact” subheading : many people think about how a bill acceptor recognizes a bill. There is no optical scanner, like a computer. Naturally, there are developments based on image processing, but usually they are simply optical and ultraviolet sensors with a prism, which accumulate the integral components of colors, and are compared with the standard.
These sensors work in conjunction with magnetic sensors, and sensors of the physical presence of the bill. The principle of comparing the integral parameters allows you to filter defects on bills, as well as to cope with varying degrees of wear.
JCM iVision bill acceptor module
A subheading of "life stories": in the two thousandth, the devices of one major manufacturer, took 10 UAH, cut exactly across, with a glued leaf cut out of a notebook in a cell, and 5 UAH, with a glued leaf of a notebook in a line. If you paste on the contrary - it did not accept, it worked in this configuration. It was not clear how someone thought of this, but we suffered losses rather big, until the manufacturer released an update.
There are bill acceptors with the mechanism of payment of bills, but we will talk about them next time (if it will be).
Rarely used, usually relevant in conjunction with a coin dispenser (hopper).
Coin acceptors are stupid (we call them the coin comparator), which determine the size of the token, comparing it with the standard, and smart - which are able to distinguish between different coin values.Coin Acceptor Azkoyen Modular A
How to recognize a coin, which, unlike a bill, quickly flies down through mechanisms? Of course by the sound of hitting the ground. The main sensor of the coin receiver is an acoustic sensor. I do not think that we are talking about the frequency range of the human ear, but it is no less, the vibration parameters are measured. Also in the process of detecting a coin, a magnetic sensor is involved.
Anti-phishing locking mechanisms are always used to protect against “fishing”, a coin that has gone through sensors is never going back.
The “interesting fact” subheading : coin acceptors for gaming machines are theoretically compatible with vending machines, but as a rule, they are used only in the field of gaming. In vending machines another principle of storing and issuing coins. The dispenser of the vending device is plastic high tubes, with various coin values, calculated to give a certain amount of change. This is usually a few coins, which can be slowly poured into a shallow tray.
A gaming dispenser is a large container with one denomination (less often two containers with two). You have to pay quickly (5-10 coins per second), from one container. Therefore, there is usually no coin separator in the gaming machine (the device accepts only 1 denomination), and if it is present, it is rather specific. In vending - there are many integrated products where the coin acceptor is combined with a separator and a dispenser.
Coin payout device (hopper)
Happen with the tape mechanism and disk. This is a rather stupid device: the motor turns the disk, the optical sensor counts the number. As I wrote above, they are different from coin dispensers for coffee machines, and other equipment for paying change.Band Hopper MK IVDisk hopper Azkoyen MDP-10
Such devices are popular in countries where there is a coin with a high denomination, for example, 2 Euros.
In the gaming field, slightly different printers are used than in the payment terminals. These are also thermal printers, but they print on thick cardboard. The cost of the print goes higher - 0.5 cents.
Futire Logic GEN2 Printer
Why is the printer in the machine? No, fiscal checks are not accepted, this is the task of the cashier and the cashier. The printer is needed for the system TITO (ticket in, ticket out).
The point is this: the player has a desire to change the device, and continue the game, let's say $ 500 on the device’s account. He presses the "payout" button, the device informs the server, using a special gaming protocol, "I use the device id 23, payment 500 usd".
The server generates a unique token, and sends it to the machine. The gaming machine prints this token in the form of a bar code, on a dense cardboard. The player receives a printed ticket.
Further, he can go to the cashier and cash it, or sit down at the other machine, and enter this ticket into the bill acceptor. All bill acceptors can read 1D barcode, so the gaming machine, having received data from the bill acceptor “accepted a ticket with barcode xxxxxxxx”, sends this information to the server.
The server accepts the token, finds it in the database, and tells the device to charge 500 USD. The player continues the game.
Data interaction mechanism is possible in the halls equipped with a server that serves devices using the IGT SAS
gaming protocol (not to be confused with Serial Attached SCSI), and for us this is a pain because the old protocol (RS-232 with an additional 9th wake up bit, which is usually poorly supported by 16550 chips in a PC) and proprietary (hi IGT). The basic subscription to get the documentation is quite expensive.
Topology - 127 devices hang on a common bus, wake up bits in a byte - a sign that the next byte is the address of the device being accessed, and not the data byte.
The “interesting fact” subheading : there is a modern free communication protocol for gaming devices based on TCP / IP: Open G2S , but you can’t argue against the giants' lobby, and in our area legacy support is not just sound.
Used rarely. In essence, it performs the functions of reading bank cards for POS operations, as well as for identifying a player.
Personally, we do not apply, and if we start, we will limit ourselves to contactless readers, sufficient for paypass.The device company Bally with a card reader.
We all remember how difficult it is sometimes to press the virtual button of a payment terminal. The reason for this is acoustic taccrinas (Touch Screens on Surface Acoustic Waves - Surfactants). They are very sensitive to contamination (a foreign object completely blocks the operation of the device). They also do not like loud sound (or rather, vibration).
In the gaming industry used infrared touch screens and capacitive. Infrared screens are slightly more expensive than surfactants, but more reliable. They do not like direct sunlight, but in our area, this element is completely absent. But the vibrations from the sound - quite.
Structurally, the infrared screen is a frame with LEDs and photo sensors around the perimeter. The more of them - the more accurate. But the finger is thick, so do not need much.noname IR touch frame
The frame creates some depth between the outer surface of the case and the glass of the monitor, so it is not always suitable. Manufacturers whose design features are such that glass is not drowned, or common glass combines several monitors cannot use infrared screens (as do smartphone manufacturers), so they choose capacitive screens.
Subheading "interesting fact": in gaming machines, even with a touchscreen, at least one mechanical button is used - "Start" (Play). Players are so accustomed to beating on this button that stainless steel panels often bend over time. As a result, no one wants these Megajoules to be extinguished by the monitor screen, and the button is used.
Even in a modern apparatus, electromechanical counters are used. In essence, this is a subsystem of duplicating the integrity of financial information.
Electronic data may be damaged or compromised, and a sealed meter increases reliability. The game board is usually able to determine the fact of disconnection of the counters, and sealed connectors make it difficult to install the "plug".
“Interesting fact” subheading: In Romania, control authorities require online readings of mechanical meters. How can one read from the counter without a communication protocol data? They themselves do not know. Optical number recognition system can not be applied, because the counters should look out through the window in the housing.
Some manufacturers use 3D monitors, although the benefits of such solutions are questionable - my eyes get tired very much. But the depth of the 3D effect is adjustable, down to zero.The device of the IGT company with a 3D monitor that does not require glasses.
Those who have enough money - produce branded chairs with a keyboard, built-in acoustics, and vibration.The device of the company Novomatic "Novostar VIP"
As a rule, a modern gaming machine is based on the Linux OS, which runs software written in C ++. 3D engines are actively used, although the camera is fixed.
The companies that came to land-based from online, as well as those who initially attended to multiplatform support, use Unity or self-written web-engines, and in the desktop version just open the web canvas to full screen.
Subheading "interesting fact": gambling license for Unity costs 200 thousand dollars. There is no proof, but I read and heard it repeatedly.
At first glance, the video slot program seems simple, and the illusion of "we can do that too, let's dive into this monetary industry." In fact, many complex algorithms are implicitly “under the hood”, and some of the laws of the genre in design and mathematics are known only to those who have experience.
Speaking of design, the industry is quite conservative, we work with the principle of “the best enemy of the good” and “work — don't touch”. Therefore, some interfaces look like hello from the nineties. There is no place for thin fonts, not to mention the material design, and other modern trends. Drop shadow, stroke width = 10, inner bevel, gold color gradient - our everything. As in "99 francs": "With us, the sky is always blue, and the girls are always beautiful."
Let's go back to the software. We use Qt, with a self-written engine for OpenGL. I love the fact that I can build the code under Windows to work with graphics in Photoshop, and return to Linux to build the release.
In simple projects we use Qt3D in QML. The library is damp, but I like that you can attach an animation controller to any property of an object.
In the release, we use Ubuntu Linux, which removes all unnecessary, and installed Openbox. Naturally, all hotkeys, context menu, text consoles are blocked.
The program is a "multi game", i.e. loads a set of games into memory at once, and allows you to switch between them. Compression of textures helps to fit the graphics of 25-30 games in 4 GB of RAM.
We work with connected peripherals at the command protocol level. The driver disk is immediately sent to the trash, a letter is written to the manufacturer, the NDA is signed, and all the necessary information is obtained. Harder, but safer. Moreover, sometimes it is necessary to knock on the device with a small board, without an OS.
Sub-story "life stories": I assigned one programmer to finish the stack of communication with the printer. Well, did not keep up. The programmer saw that the printer is compatible with ESC / P, which is well supported in Ubuntu, and reworked everything under rasterization in QImage and the printing system. Well, it works. As a result, I remotely set up a non-printing CUPS server via ssh, trying to wean it from addressing to the device by a serial number, which naturally differs from the printer number in the developer’s office.
The calculation of the classic game for a mechanical device does not constitute any difficulty - there is a table of winnings for each combination, you must calculate the number of all possible combinations for each character, multiply the winning combinations by the value of the winnings, and get the total amount of money that the device will pay.
That is, the calculation is carried out to fully scroll all the reels in turn. If we draw an analogy with the odometer of a car, then combinations of rotating discs from 00,000 consecutively to 99999 are analyzed. It is much more efficient than rotating the reels randomly and accumulating win statistics (brute force). Each combination is equally probable, so it’s enough to analyze everything once.
With winning lines, too, everything is simple (in a modern gaming machine there are more than 1). The probability of combining any combination is equally probable along any line; therefore, it suffices to analyze combinations for one line, and this calculation will be correct for any number of lines that are active at the same time (with some rules of the game, this is not the case, for example, if there is a symbol in the game that swings open) rubbing a few cells).
Difficulties begin with the advent of WILD characters (jokers). Wild symbol polymorphic, and replaces any other character. Those. the LEMON WILD LEMON combination is accounted for by the machine software as LEMON LEMON LEMON.
As a result, it is necessary to solve the problem “There are 3 balls of two colors in the hat, and from them you can get 2 white or 2 black.” The classical theory of probability spreads his hands about polymorphic objects (correct if not so), you have to handle this situation - when the total number of combinations is greater than the product of all the elements.
It is also very boring to count bingo-type games, where more than the highest winning combination graphically excludes the younger, or draw poker games, where the result depends on the player’s strategy (which cards he changed, which ones he left).
“Interesting fact” subheading : the drums in the video slots, although virtual, but spinning honestly - here is the list of RNG tests that we are checked for during certification: Meta-testing, Confidence Level, Adjacency Blocks, Adjacency High-Low, Adjacency Max-Min , Count of Counts, Coupon Collector's Test, DieHard Battery of Tests, Duplicates Test, Interplay Correlation Test, Overlaps Test, Permutation Test, Position Interaction Test, Relative Frequency by Positions Test, Wald-Wolfowitz Runs Test, Serial Correlation Test, 3 Sigma Test , Total Distribution Test, Total Distribution by Position Test, Unequal Probabilities Test.
, , , .
– . – 37 , – 36. : 36*1/37=0.972.
– , .
25-75 . – , – . , .—
« »: - , , , . ( ).
? «virtual reels» — , . , , .
, , .
4 Logic area -Logic area -. , ..
2017- , , . , -. – , , «- , ».
( , ), – , – . , , , - . , . .
– , - . - , , -.
API, , . - , , ( API). – .
, , , – .
- , . API, .
– , , .
- . , , , .
, , – , . .
« »: « joycasino?» () – . joycasino.com : « , . , , firstname.lastname@example.org» . , , , .
« » : , , , .
186 , . 50 « », 2 50, ( -, .. 50), 36 ( ).
- ( NetEnt
, , , . , , Netent Entertament 2016
, HTML5.«Voodoo» Endorphina.
, 90%-96% . Those. 10% . , 300%.
, , .
, 2.5-3 ( ), 8%, 8%, 3*8=24% ( 25%). , 75% .
, 25%. ( ), . , ( ).
, , 13 . , , , , 52 – . .
, « », « ».
, , .. . , , , .
, – . , , .
, , , .
, «near-miss effect», , ( ) , . , 5 , , , .
( , — ), « , ».
, , , - - , . , , , .
« »: , , - (, , ) .
№3: « »
It's true. Well, in part. Techniques like "in such and such a game, press this and this button at the same time" of course do not work. But if you have physical access to the machine, you can buy a firmware with a bookmark, change it, come in a week, and activate the bookmark with a special key combination and actions - get a win.
This is usually practiced by collusion with the staff of the establishment. This works with old models of devices, and it is possible to protect against this only by sealing, logging the opening of doors, and control over copies of keys.
By the way, the industrial Fujitsu motherboard, which we use, is able to control the opening of the door contact circuit, even when turned off, and log itself in the CMOS memory.Finally, a mini FAQ:
Q: How much does a gaming machine cost?
A: From 4 to 12 thousand euros for a typical model.
Q: Is gambling dangerous?
A: Very. The dependence is 100% psychological, and you cannot erase your memory. Self-appraisal suffers in the beginning - losing money, which could be used more cleverly, develops self-hatred, and this is much worse than hating the government, the authorities, or neighbors. Then, household factors are included - the lack of money, combined with the desire to quickly win back, can include programs to “get money at any cost”.
Q: Did I play for money?
A: Yes, when it was legal, I played on each of the available gaming machines, all manufacturers. This happened in the institutions of competitors, and had to play for money. "To understand a woman you need to think like shoes." I could write “it was worth it, because gave invaluable experience in game development ", but in the end, despite the large number of games, I won a lot more than I lost (enough for a sports car).
Q: Does the ethical aspect of my work bother me?
A: No more than the owner of the confectionery factory, that buyers are obese, and fail to 60. Maybe I'm a bad person, but I do what I can do best. Today, several thousand people have redistributed their money among themselves, but it was not my choice.
Q: Were there any errors in our programs that lead to unplanned winnings?
A: Yes, it was a couple of times, you could enter the bonus game in an infinite loop. The reason was the incorrect synchronization of logic by the signals-slots, the keyboard event went into the logic of the bonus, which was already completed. For 4 years of active development and constant updates - this is a normal result, it happens. Usually, thanks to online monitoring of financial statistics, this is quickly noticed and corrected.
Q: What percentage of the code is covered by unit tests?
A: Zero. We are aware that the laws in the countries of our clients are such that they are obliged to pay any amount shown on the screen and no matter where it comes from. But I prefer to spend time moving forward, and low-paid people can manually test a fresh release. Perhaps this is wrong, but business is a risk.
Q: Familiar seals on CPDV.
A: All rights to use obtained;)
That's all, if there is a desire that I had illuminated some of the more affected by it in more detail - write in comments. We also develop lottery systems with automatic drawing every 5 minutes, and smart optical client-server turnstiles for schools.
Thanks for attention!Pathetic photo of the author of the article with his own products, at the exhibition Romania Arena Expo