{"id":40153820,"url":"https://github.com/efskap/warcrumb","last_synced_at":"2026-01-19T15:33:08.220Z","repository":{"id":57576001,"uuid":"239222935","full_name":"efskap/warcrumb","owner":"efskap","description":"⚔️ Warcraft 3 Replay Parser in Go (supports Reforged; WIP... much like Reforged)","archived":false,"fork":false,"pushed_at":"2020-11-17T23:23:01.000Z","size":7771,"stargazers_count":6,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-17T14:56:37.706Z","etag":null,"topics":["parser-library","warcraft","warcraft3"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/efskap.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}},"created_at":"2020-02-09T00:10:27.000Z","updated_at":"2024-03-25T16:00:29.000Z","dependencies_parsed_at":"2022-08-29T00:51:00.209Z","dependency_job_id":null,"html_url":"https://github.com/efskap/warcrumb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/efskap/warcrumb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efskap%2Fwarcrumb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efskap%2Fwarcrumb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efskap%2Fwarcrumb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efskap%2Fwarcrumb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/efskap","download_url":"https://codeload.github.com/efskap/warcrumb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/efskap%2Fwarcrumb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28573017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T14:39:55.009Z","status":"ssl_error","status_checked_at":"2026-01-19T14:39:01.217Z","response_time":67,"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":["parser-library","warcraft","warcraft3"],"created_at":"2026-01-19T15:33:08.151Z","updated_at":"2026-01-19T15:33:08.215Z","avatar_url":"https://github.com/efskap.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# warcrumb\n## Warcraft 3 Replay Parser in Go\n\n![Go](https://github.com/efskap/warcrumb/workflows/Go/badge.svg)\n\nA work in progress, much like WC3 Reforged.\n\nPulls out metadata, chat, and game events (to some extent).\n\nSupports all versions of the game, including Reforged.\n\nBased on http://w3g.deepnode.de/files/w3g_format.txt, with my own research into the Reforged format (e.g. Battle.net 2.0 integration).\n\n## A word on what is encoded\n\nPlease note that a WC3 replay does not record what _happened_, but rather what inputs the human players sent. The game (inc. AI) is deterministic, so it can be recreated from this.\n\nThis means you can't really know:\n\n- what the AI did\n- combat stuff like which units died (at best you can infer this from selections), resources at a given moment, etc \n- what _actually happened_ (e.g. you can have a \"build tower\" ability encoded, even if it was cancelled thereafter)\n\n\n## Loading a replay\n\n```go\nf, err := os.Open(\"LastReplay.w3g\")\nif err != nil {\n    log.Fatal(err)\n}\nreplay, err := warcrumb.ParseReplay(f)\nif err != nil {\n    log.Fatal(\"error parsing replay: \", err)\n}\n```\n\n### Example: Actions\n\n```go\nfor _, action := range replay.Actions {\n    if ability, ok := action.Ability.(warcrumb.BasicAbility); ok {\n        fmt.Println(fmtTimestamp(action.Time), action.Player, ability.ItemId.String())\n    } else if ability, ok := action.Ability.(warcrumb.TargetedAbility); ok {\n        fmt.Println(fmtTimestamp(action.Time), action.Player, ability.ItemId.String(), ability.Target)\n    }\n}\n\n// ---\n\nfunc fmtTimestamp(duration time.Duration) string {\n\tmins := duration.Truncate(time.Minute)\n\tsecs := (duration - mins).Truncate(time.Second).Seconds()\n\treturn fmt.Sprintf(\"%02d:%02d\", int(mins.Minutes()), int(secs))\n}\n\n```\n\nPrints stuff like:\n```\n13:34 LeoLaporte Train Raider\n13:38 Ghostridah. Build Beastiary (-6592.0,-2240.0)\n13:40 Ghostridah. Train Wind Rider \n```\n\n### Example: Sportsmanship Chat Analyzer\n\n```go\nsportsmanTerms := []string{\"gg\", \"glhf\"}\nisSportsmanlike := make(map[*warcrumb.Player]bool)\n\nfor _, msg := range replay.ChatMessages {\n    for _, term := range sportsmanTerms {\n        if strings.Contains(strings.ToLower(msg.Body), term) {\n            isSportsmanlike[msg.Author.Player] = true\n        }\n    }\n}\n\nfor _, player := range replay.Players {\n    if isSportsmanlike[player] {\n        fmt.Println(player, \"has demonstrated sportsmanship! Well done!\")\n    } else {\n        fmt.Println(player, \"has NOT been sportsmanlike this game. BOOOOO!\")\n        fmt.Printf(\"Typical %s player...\\n\", replay.Slots[player.SlotId].Race)\n    }\n}\n```\n\nSee [`/examples`](examples) for the full programs and other examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefskap%2Fwarcrumb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fefskap%2Fwarcrumb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fefskap%2Fwarcrumb/lists"}