{"id":23338215,"url":"https://github.com/sta-ger/pokie","last_synced_at":"2025-04-08T03:11:27.321Z","repository":{"id":32971632,"uuid":"147924236","full_name":"sta-ger/pokie","owner":"sta-ger","description":"A server-side video slot game logic framework in JavaScript.","archived":false,"fork":false,"pushed_at":"2025-02-03T10:23:48.000Z","size":896,"stargazers_count":48,"open_issues_count":2,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T13:17:48.979Z","etag":null,"topics":["casino","game","game-server","javascript","nodejs","return-to-player","rtp","simulation","slot","typescript","video-slot"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sta-ger.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-08T10:34:39.000Z","updated_at":"2025-03-11T05:02:52.000Z","dependencies_parsed_at":"2023-07-30T10:58:36.720Z","dependency_job_id":"6138c27e-789e-444b-99b0-d036f7417ce6","html_url":"https://github.com/sta-ger/pokie","commit_stats":null,"previous_names":["sta-ger/pokie","sta-ger/slotify.js"],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sta-ger%2Fpokie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sta-ger%2Fpokie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sta-ger%2Fpokie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sta-ger%2Fpokie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sta-ger","download_url":"https://codeload.github.com/sta-ger/pokie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247767236,"owners_count":20992548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["casino","game","game-server","javascript","nodejs","return-to-player","rtp","simulation","slot","typescript","video-slot"],"created_at":"2024-12-21T03:12:47.397Z","updated_at":"2025-04-08T03:11:27.300Z","avatar_url":"https://github.com/sta-ger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# POKIE\n\n[![npm version](https://badge.fury.io/js/pokie.svg)](https://badge.fury.io/js/pokie)\n\n_In Australia, they call slot machines \"pokies\"._\n\nIntroducing **POKIE**, a server-side video slot game logic framework for JavaScript and TypeScript.\n\n`npm install pokie`\n\n## Use cases\n\n### Back-End\n\nUtilize **POKIE** to implement the video slot game mechanics on the Back-End. Create and manage game sessions, serialize\nthem, and transfer the payload to the game client through your API.\n\n### Front-End\n\nWhen playing for fun, you can implement the standalone game logic on the client-side, relieving the servers from\nunnecessary load. Utilize simulations to showcase specific game features for demonstration purposes.\n\n### Math\n\n**POKIE** also serves as an essential tool for balancing the parameters of the slot game's math model, ensuring an immersive\ngaming experience. Configure the game session and run Monte Carlo simulations to guarantee that the model meets all\nnecessary requirements.\n\n## Examples\n\nSee the [examples](https://github.com/sta-ger/pokie-examples) of various video slot game mechanics implemented with\n**POKIE**.\n\n### Simple video slot game [[Demo](https://sta-ger.github.io/pokie-examples/simple-slot.html)] [[Code](https://github.com/sta-ger/pokie-examples/tree/main/src/games/simple-slot)]\n\nAn example of a simple 5x4 video slot game with 8 winning lines.\n\nFeatures:\n- Winning lines are counted from right to left. A line of minimum 3 winning symbols pays out.\n- \"Wild\" is a wild symbol that substitutes any other symbol on a winning line.\n- \"Scatter1\" is a scatter symbol that pays out 10x, 20x, or 30x the bet if 3 or more symbols appear on any positions. Only one \"Scatter1\" can appear on any reel.\n- \"Scatter2\" is a stacked scatter symbol that can appear on the 3 middle reels. If all 3 middle reels are covered with \"Scatter2\" symbols, the game pays 100x the bet.\n\n### Video slot with free spins [[Demo](https://sta-ger.github.io/pokie-examples/slot-with-free-games.html)] [[Code](https://github.com/sta-ger/pokie-examples/tree/main/src/games/slot-with-free-games)]\n\nAn example of a 5x3 video slot game with free spins.\n\nFeatures:\n- A minimum of 2 winning symbols on a winning line or scattered across all reels pays out.\n- During free spins, symbols on a winning line are counted not only from left to right but can also be scattered across the winning line definition.\n- During free spins, symbol sequences are different from the base game's ones. Sequences during free spins do not contain scatter symbols, so free spins cannot be re-triggered.\n- During free spins, all wins are multiplied by x2.\n- This example also demonstrates the usage of Simulation to obtain the desired game outcomes.\n\n### Video slot with sticky re-spin [[Demo](https://sta-ger.github.io/pokie-examples/slot-with-sticky-respin.html)] [[Code](https://github.com/sta-ger/pokie-examples/tree/main/src/games/slot-with-sticky-respin)]\n\nAn example of a 5x3 video slot game with sticky re-spin feature. Every winning combination triggers the re-spin during which all the winning symbols are held on their places. The re-spins continue as long as there are new wins.\n\n### Exploring Video Slot Math with POKIE\n\nA [Medium](https://medium.com/@sta-ger/exploring-video-slot-math-with-pokie-3bc7191b72a0) article about how POKIE can be utilized for slot game math modelling.\n\n## Usage\n\n### Session\n\nVideo slot game logic.\n\n```js\nimport {VideoSlotSession} from \"pokie\";\n\nconst session = new VideoSlotSession();\n\nsession.play();\n\nsession.getSymbolsCombination(); // symbols combination\nsession.getWinAmount(); // total round win amount\nsession.getWinningLines(); // winning lines data\nsession.getWinningScatters(); // winning scatters data\n```\n\n### Simulation\n\nRunning a certain number of game rounds and calculating RTP.\n\n```js\nimport {SimulationConfig, Simulation} from \"pokie\";\n\nconst simulationConfig = new SimulationConfig();\nsimulationConfig.setNumberOfRounds(10000);\nconst simulation = new Simulation(session, simulationConfig);\n\n// set the callbacks if you want to control the session manually\nsimulation.beforePlayCallback = () =\u003e {\n    console.log(\"Before play\");\n};\nsimulation.afterPlayCallback = () =\u003e {\n    console.log(\"After play\");\n};\nsimulation.onFinishedCallback = () =\u003e {\n    console.log(\"Simulation finished\");\n};\n\nsimulation.run(); // 10000 rounds will be played\n\nsimulation.getRtp(); // RTP of the current session\n```\n\nCapturing specific game features.\n\n```js\nconst simulationConfig = new SimulationConfig();\nsimulationConfig.setNumberOfRounds(Infinity);\nsimulationConfig.setPlayStrategy(new PlayUntilSymbolWinStrategy(\"A\"));\n\nconst simulation = new Simulation(session, simulationConfig);\nsimulation.run(); // the simulation will be stopped on any winning combination with symbol \"A\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsta-ger%2Fpokie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsta-ger%2Fpokie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsta-ger%2Fpokie/lists"}