{"id":19056846,"url":"https://github.com/polygenelubricants/derby-simulator","last_synced_at":"2026-05-12T23:33:25.075Z","repository":{"id":213847463,"uuid":"692475631","full_name":"PolygeneLubricants/derby-simulator","owner":"PolygeneLubricants","description":"Simulator and engine for the board game Derby also known as Jägersro and Sport of Kings","archived":false,"fork":false,"pushed_at":"2023-12-26T09:55:13.000Z","size":150,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T01:30:25.980Z","etag":null,"topics":["blazor","blazor-webassembly","board-game","derby","engine","net7","sport-of-kings"],"latest_commit_sha":null,"homepage":"https://www.derbyapp.dk/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PolygeneLubricants.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-09-16T15:40:28.000Z","updated_at":"2023-12-23T14:31:04.000Z","dependencies_parsed_at":"2023-12-23T17:26:15.898Z","dependency_job_id":"6fecb61d-02d7-4926-a51e-db5deaac2778","html_url":"https://github.com/PolygeneLubricants/derby-simulator","commit_stats":null,"previous_names":["polygenelubricants/derby-simulator"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/PolygeneLubricants/derby-simulator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolygeneLubricants%2Fderby-simulator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolygeneLubricants%2Fderby-simulator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolygeneLubricants%2Fderby-simulator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolygeneLubricants%2Fderby-simulator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PolygeneLubricants","download_url":"https://codeload.github.com/PolygeneLubricants/derby-simulator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PolygeneLubricants%2Fderby-simulator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32961782,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T23:30:32.555Z","status":"ssl_error","status_checked_at":"2026-05-12T23:30:18.191Z","response_time":102,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["blazor","blazor-webassembly","board-game","derby","engine","net7","sport-of-kings"],"created_at":"2024-11-08T23:52:04.594Z","updated_at":"2026-05-12T23:33:25.052Z","avatar_url":"https://github.com/PolygeneLubricants.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# derby-simulator\nSimulator and engine for the board game Derby also known as Jägersro and Sport of Kings. \nThe simulator is able to simulate the race-part of the Derby game, and not the\nbetting, or management-parts between each race.\n\nThe engine, however, has been designed in a way that makes it possible to extend with\nthese parts.\n\n## Mobile friendly web-app\nTo calculate odds for a given race, see the online version of this engine at [derbyapp.dk](https://www.derbyapp.dk/).\n\n## Pre-calculated static rankings\nThe pre-calculated statistics for static rankings for both game versions (and a version for the original rules),\ncan be found here: [docs/static-rankings](docs/static-rankings.md).\n\n## How to run\n1. Compile the project and locate the exe output in the bin folder.\n\n2. The engine can be run from the command line:\n```\nDescription:\n  Run the derby simulator, to play through one or multiple Derby games\n\nUsage:\n  Derby.Simulator [command] [options]\n\nOptions:\n  --version       Show version information\n  -?, -h, --help  Show help and usage information\n\nCommands:\n  single  Run a single Derby race and show the log for each movement.\n  random  Run a Derby race, where horses are chosen at random, and show the log for each movement.\n  many    Run many Derby races and collect results for all games.\n  odds    Calculates the odds of the specified group of horses running i races.\n```\n\n### Single\n```\nDescription:\n  Run a single Derby race and show the log for each movement.\n\nUsage:\n  Derby.Simulator single [options]\n\nOptions:\n  --p1 \u003cp1\u003e                                        The stable of the first player. Indicate horse name. E.g. --p1 Avalon Isolde\n  --p2 \u003cp2\u003e                                        The stable of the second player. Indicate horse name. E.g. --p2 Avalon Isolde\n  --p3 \u003cp3\u003e                                        The stable of the third player. Indicate horse name. E.g. --p3 Avalon Isolde\n  --p4 \u003cp4\u003e                                        The stable of the fourth player. Indicate horse name. E.g. --p4 Avalon Isolde\n  --p5 \u003cp5\u003e                                        The stable of the fifth player. Indicate horse name. E.g. --p5 Avalon Isolde\n  --r \u003cDerby2023Traditional|Drechsler\u003e (REQUIRED)  Specify the ruleset/version of the board-game to run the simulation\n```\n\n### Random\n```\nDescription:\n  Run a Derby race, where horses are chosen at random, and show the log for each movement.\n\nUsage:\n  Derby.Simulator random [options]\n\nOptions:\n  --c \u003cc\u003e (REQUIRED)                               Number of horses to race. The horses will be equally distributed\n                                                   amongst the players 1 to 5.\n  --r \u003cDerby2023Traditional|Drechsler\u003e (REQUIRED)  Specify the ruleset/version of the board-game to run the simulation\n                                                   against.\n```\n\n### Many\n```\nDescription:\n  Run many Derby races and collect results for all games.\n\nUsage:\n  Derby.Simulator many [options]\n\nOptions:\n  --mode \u003cAll|FiveYears|FourYears|ThreeYears|TwoYears\u003e  Combination mode to run many games.\n  --size \u003csize\u003e (REQUIRED)                              Race size. Number of horses in each race. From 1 to 5.\n  --i \u003ci\u003e                                               Number of iterations (times) to run the race for the specified\n                                                        combination. [default: 1]\n  --r \u003cDerby2023Traditional|Drechsler\u003e (REQUIRED)       Specify the ruleset/version of the board-game to run the\n                                                        simulation against.\n```\n\n### Odds\n```\nDescription:\n  Calculates the odds of the specified group of horses running i races.\n\nUsage:\n  Derby.Simulator odds [options]\n\nOptions:\n  --horses \u003chorses\u003e (REQUIRED)                     Names of the horses in the race. Indicate horses' names. E.g.\n                                                   --horses Avalon Isolde Whispering\n  --i \u003ci\u003e                                          Number of iterations to run to calculate odds. Defaults to 1.000.\n                                                   [default: 1000]\n  --r \u003cDerby2023Traditional|Drechsler\u003e (REQUIRED)  Specify the ruleset/version of the board-game to run the simulation\n                                                   against.\n```\n\n## Command examples\n### Run a single game\n\nRun a 2-player race where player 1 has Comet and Avalon, and player 2 has Rapid.\n```\nDerby.Simulator single --p1 Comet Avalon --p2 Rapid\n```\n\n### Run a random game\nRun a random game with 5 players, each having 1 horse. Random will distribute horses equally amongst players 1 to 5.\n```\nDerby.Simulator random --c 5\n```\n\n### Run many games for all horses in heats of 5\nRun a game with all horses, in heat-sizes of n, i times. The number of games will \nbe the cartesian product of the set size, excluding duplicates.\n\n5 horses amongst all 20 horses for 1 iteration will run 20!/15! = 1.860.480 times.\n```\nDerby.Simulator many --mode all --size 5 --i 1\n```\n\n### Run many games for all 2-years in heats of 3, 1000 times\n5 horses amongst all 5 2-years for 1000 iterations will run 5!/2! * 1000 = 60.000 times.\n```\nDerby.Simulator many --mode twoyears --size 3 --i 1000\n```\n\n## Rulesets / Board-game versions\nThe simulator currently supports the two rulesets below.\n\n### Alga/Drechsler (1st edition Jägersro)\nThe original Drechsler board-game (1st edition Jägersro).\n\n\n### Derby 2023 by Gameplay Publishing (2nd edition Jägersro), Traditional\nThe 2023 Derby edition by Gameplay Publishing (2nd edition Jägersro) \nin their game mode 'Tradition'. \n\nThe game mode, 'Modern' is *not* supported, as this game version has re-worded many\nGallop cards to include _may_ instead of _must_, which adds an element of skill\nto the outcome of a given race. As such, the statistical variance will increase with\nthis variable, and the outcome will be less predictable.\n\nThe difference between the two game versions are few, but very significant:\n1. Derby 2023 has changed the Chance card, 'Hesten er halt' to a Gallop card. This\nchange makes it much more likely to draw this card in general, from 1 in 30 to 1 in 20. \nIt also has an impact on horses that predominantly land on \neither gallop fields (these will be eliminated more often or chance fields (these will be eliminated less).\nThis makes a horse like Figaro even stronger, as it is, by far, the horse that lands on chance fields the most,\nwhere it can no longer get eliminated.\n\n2. Derby 2023 has removed the card 'Hesten falder tilbage'. This decision puts a winning bias\non horses that gets an early head start, which would previously be punished more often.\n\n3. Derby 2023 has changed the wording on 'Stærkt tempo!', to repeat the horse's move if it's not in the lead,\nas opposed to the Drechsler phrasing, which moves the horse on-par with the leading horse.\nThis is a very significant change, that heavily favors horses with a good program score-card\n(the total number of moves the horse has), over horses that often land on Gallop cards, such as \nCaruso, Whispering and Castor.\n\n## Rule interpretations\nThis section is dedicated to the interpretations for rules which are \nwritten ambiguously in the rulebook.\n\n### Curvature\nThe rulebook states that horses in different lanes can be compared to each other\nby observing the forward-most facing field between the lanes.\n\nThis can translate to the programmatic game, by associating each lane-field\nwith a tie-breaker value, that indicates how this relates to the other 3 lanes.\n\nBecause of lane curvature in the original game,\nsome lanes with fewer fields are ahead of lanes with more fields,\neven though the lane with more fields are further from start.\n\nFor example, in the first curve, field 7 in lane 2 is ahead of\nfield 7 in lane 3, 4 and 5.\nField 8 in lane 3, however, is ahead of field 8 in lane 4 and 5 (but behind field 8 in lane 2).\n\n### Steady-pace and home stretch gallop cards\nThe steady pace card states, that a horse will move 4 fields from next turn and onwards,\nand will not pick up any gallop cards.\n\nThis has been interpreted as gallop cards via gallop card fields, and not the card picked up when \nthe horse is in home stretch, which the horse will still draw.\n\nAlternatively, this could be interpreted as all gallop cards, including the home stretch gallop cards.\nThis interpretation has not been used.\n\n### Await next and last horse\n\nMultiple gallop cards state, that the horse must wait for the following\nor last horse to be on-par with the current horse, before the current horse\nmay move again.\n\nThis has been interpreted as when *any* horse and not a specific horse:\n\nIf the card states, await the horse behind, the horse will resume running\nonce *any* horse behind the current horse is on-par with the current horse.\n\nIf the card states, await the last horse, the horse will resume running\nonce *all* horses behind the current horse is on-par with the current horse.\n\nAlternatively, the await-effect could be interpreted as await a _specific_ horse.\nI.e. if the card states, await the horse behind, this specific horse would be noted,\nand if another horse overtakes the current horse, it would not resumt moving.\nThis interpretation has not been used.\n\n### Horses on the same field in the same lane\nIf two or more horses are on the same field in the same lane,\nthe rulebook states during scoring, that whichever horse is first in turn\nis considered ahead of the other horse(s).\n\nThis interpretation has also been applied on the await-cards, when a horse has\nto await the next or last horse.\n\n### Awaiting a horse which is then eliminated\nIt can occur, that a horse is awaiting another horse, which is then eliminated\nbefore it overtakes the awaiting horse. In this case, the awaiting horse\nis effectively soft-locked from the game.\n\nIt has been interpreted as the awaiting horse may resume movement, \nshould the horse awaited horse be eliminated.\n\n### Repeated movement\nIn the traditional Derby 2023 (2nd Edition Jägersro), \nthe rulebook states for card 'Stærkt tempo!', that if a horse is not in the lead,\nit moves the same number of moves that it previously moved.\n\nThis has been interpreted as the same number moves that it moved in the previous turn,\nbased on its race program, and *not* the same number of moves it moved most recently,\nbased on any factor, such as gallop card effects like 'Fin galop'.\n\nThis interpretation has been chosen, as it is unlikely that players in the \nover-the-board game would be able to keep track of all previous movement \nwhen the card is drawn.\nIt also opens up for complicated scenarios, if a gallop card states that\nthe horse moves to the leader position. Would this then count as a previous movement,\nand the number of moves between its original position and the leader is repeated?","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolygenelubricants%2Fderby-simulator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolygenelubricants%2Fderby-simulator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolygenelubricants%2Fderby-simulator/lists"}