An Architecture of the Slot Games Platform
- 4. Slot Machine
• 3 columns, 1 row
• One payline
• A few different different
symbols
Image: https://www.flickr.com/photos/kubina
- 6. Video Slot Machine
• X columns, Y rows
• 1-243 lines, different direction
• Wild symbol
• Scatter symbol
• Free Spins
• Respin
• Sticky symbols
• Bonus Game
• Collectibles
• Jackpots
• And much, much more…
Image: https://www.flickr.com/photos/garryknight/
- 7. … + really rich multimedia experience
• High quality graphics
• 3D content
• Complex animations
• Videos
• Particles
• Sounds
Image: https://www.flickr.com/photos/garryknight/
- 11. Event Dispatcher
function updateBalance() {
//update text field
}
function playAnimation() {
//explosion
}
msg.on("spinning/stopped", updateBalance);
msg.on("spinning/stopped", playAnimation);
msg.emit("spinning/stopped");
- 12. Event Priorities
function updateBalance() {
//update text field
}
function playAnimation() {
//explosion
}
msg.on("spinning/stopped", updateBalance);
msg.on("spinning/stopped", playAnimation, msg.PRIORITY.HIGH);
msg.emit("spinning/stopped");
- 13. Async events
function updateBalance() {
//update text field
}
function playAnimation(done) {
//explosion
setTimeout(done, 1000);
}
msg.on("spinning/stopped", updateBalance);
msg.on("spinning/stopped", playAnimation, msg.PRIORITY.HIGH, true);
msg.emit("spinning/stopped");
- 14. Pros and dos
• Easy to plug in new behavior
• Independent, separated components
• Encourages proper code encapsulation
Cons and don’ts
• Priorities hell
• Hard to follow non-linear code
- 17. Pros and dos
• Clear separation of concerns
• Model is easily testable
• Easy to have multi-views
Cons and don’ts
• Hard to debug when a view gets out of sync with data
- 21. Overriding assets
var image = new Image("background.jpg");
var sound = new Sound("click.mp3");
Vanilla Slot
assets
src
click.mp3
Symbol.js
Game.js
background.jpg
- 22. Overriding assets
var image = new Image("background.jpg");
var sound = new Sound("click.mp3");
Vanilla Slot
assets
src
background.jpg
click.mp3
Symbol.js
Game.js
My Magic Slot
assets
background.jpg
- 23. Overriding code
import Symbol from ”Symbol";
Vanilla Slot
assets
src
background.jpg
click.mp3
Game.js
src
Symbol.js
Vanilla Slot
assets
background.jpg
Symbol.js
- 24. export default class Symbol {
play() {
//explosion animation
}
}
import VanillaSymbol from "vanilla/Symbol";
export default class Symbol extends VanillaSymbol
{
play() {
//explote animation
}
Symbol.jssrcVanilla Slot Symbol.jssrcMy Magic Slot
- 25. Pros and dos
• Easier to maintain multiple games at once
• Start new game in no time
• Quick to implement new game with custom features
• Write once, benefit in all games
• Convention over configuration
Cons and don’ts
• Easy to break all games at once
- 28. Pros and dos
• Fully automated process of scaling assets
• Use smaller assets on mobile
• Optimization saves 75% of asset size (!)
Cons and don’ts
• Automatically scaled assets can be a bit blurred sometime
- 31. It all worked out
• EGR award
• Fastest loading slots
• Best mobile UI
• Best Slot Provider in 2016
- 32. Pros and dos
• Invest time in automated testing
• Follow good engineering practices
• Keep it simple – ability to say „no”
• Standardize everything
Cons and don’ts
• Avoid freestyle/last minute/ad hoc changes