{"id":16846789,"url":"https://github.com/gjtorikian/earthbound-battle-backgrounds-js","last_synced_at":"2025-04-09T06:10:13.091Z","repository":{"id":6869472,"uuid":"8118464","full_name":"gjtorikian/Earthbound-Battle-Backgrounds-JS","owner":"gjtorikian","description":"A JavaScript project that generates all the Earthbound/Mother 2 backgrounds.","archived":false,"fork":false,"pushed_at":"2024-09-18T15:58:38.000Z","size":6161,"stargazers_count":370,"open_issues_count":1,"forks_count":27,"subscribers_count":13,"default_branch":"gh-pages","last_synced_at":"2024-10-13T13:05:42.744Z","etag":null,"topics":["canvas","earthbound","javascript","snes","super-nintendo"],"latest_commit_sha":null,"homepage":"http://gjtorikian.github.io/Earthbound-Battle-Backgrounds-JS/","language":"JavaScript","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/gjtorikian.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2013-02-10T03:10:09.000Z","updated_at":"2024-10-04T20:58:42.000Z","dependencies_parsed_at":"2023-01-11T17:04:31.393Z","dependency_job_id":"0d87f6bf-3d53-4459-b49e-18cbcea08aa8","html_url":"https://github.com/gjtorikian/Earthbound-Battle-Backgrounds-JS","commit_stats":{"total_commits":171,"total_committers":7,"mean_commits":"24.428571428571427","dds":0.543859649122807,"last_synced_commit":"77be48aa430232f1a948fa503f3224934ddb1e5a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjtorikian%2FEarthbound-Battle-Backgrounds-JS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjtorikian%2FEarthbound-Battle-Backgrounds-JS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjtorikian%2FEarthbound-Battle-Backgrounds-JS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gjtorikian%2FEarthbound-Battle-Backgrounds-JS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gjtorikian","download_url":"https://codeload.github.com/gjtorikian/Earthbound-Battle-Backgrounds-JS/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247987285,"owners_count":21028895,"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":["canvas","earthbound","javascript","snes","super-nintendo"],"created_at":"2024-10-13T13:04:52.882Z","updated_at":"2025-04-09T06:10:13.073Z","avatar_url":"https://github.com/gjtorikian.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Earthbound Battle Backgrounds JS\n============================================\n\nEarthbound Battle Background JS is exactly what its name implies: the battle\nbackgrounds from the SNES RPG Earthbound/Mother 2, rendered entirely in client-side\nJavaScript.\n\nIf you like this project, you might also like the [Earthbound Battle\nBackgrounds Live\nWallpaper](https://github.com/gjtorikian/Earthbound-Battle-Backgrounds/), which\nis a Java/Android implementation.\n\n## How it works\n\nEvery battle background is composed of two layers, each with 327 possible\nstyles (including \"blank\"/zero). The layer styles can be interchanged, such that\n[Layer 1: 50 and Layer 2: 300](https://gjtorikian.com/Earthbound-Battle-Backgrounds-JS/?layer1=50\u0026layer2=300)\nis the same as [Layer 1: 300 and Layer 2: 50](https://gjtorikian.com/Earthbound-Battle-Backgrounds-JS/?layer1=300\u0026layer2=50).\nThus, there are C(n,r) = 52,650 possible different background combinations. Obviously,\nthis many don't exist in the game--the SNES's graphical capabilities only allow it to\nproperly render 3,176 of these combinations, and of those, only 225 are ever used.\n\nThe data for each of the 327 styles is bundled within the SNES cartridge.\nTiles are\nconstructed from various memory addresses in Earthbound game data. To create\nthe distortion effect, the following function is used:\n\n```\nOffset (y, t) = A sin ( F*y + S*t )\n```\n\nwhere:\n\n*  _y_ is the vertical coordinate being transformed\n*  _t_ is time that's elapsed\n*  _A_ is the amplitude\n*  _F_ is the frequency\n*  _S_ is the speed or frameskip of the transformation\n\nOffest refers to the _y_ direction of the shift at a given time _t_.\n\nThere are also three types of distortions that use the result of the Offset\nfunction:\n\n*  Horizontal translations, where each line is shifted left by the given number\nof pixels\n*  Horizontal interlaced translations, where every other line is shifted right\nby the given number of pixels\n*  Vertical compression translations, where each line is shifted up or down by\nthe given number of pixels\n\nDifferent backgrounds use different distortion effects.\n\n## List of backgrounds\n\nIt's pretty damn hard to find out which battle backgrounds correspond to which\nenemies. You can review the list of enemies matched with known battle\nbackgrounds to try and get your favorite on the **Suggested Layers** option. If\nyou discover a new one, please, email me and I'll add it to the list, giving\nyou full credit!\n\n## Running locally\n\nMake sure you have Node.js and NPM on your system. Then:\n\n``` bash\nnpm install\nnpm run watch\nnpm start\nopen http://localhost:8888\n```\n\nNote that this code runs entirely in the browser! Node is only used to start an\nExpress server.\n\n## License\n\nThis app is in no way endorsed or affiliated by Nintendo, Ape, HAL Laboratory,\nShigesato Itoi, etc. It's licensed under MIT.\n\n## Credits\n\nI am entirely indebted to Mr. Accident of forum.starmen.net for the original\nbattle background generation code, which was a C# project that uses the battle\nbackgrounds as Windows screensavers. He also provided me with help along the\nway, and as far as I'm aware, he discovered the math behind it all, including\nthe entire Offset function calculation. *This port would be nothing without\nhim.*\n\nIn 2016, @kdex [rewrote](https://github.com/kdex/earthbound-battle-backgrounds) much of my shitty JS into nice and clean ES2016 code, for which I am grateful. As of [`dc877f33`](https://github.com/gjtorikian/Earthbound-Battle-Backgrounds-JS/commit/dc877f33e5637291c7aa93c75dd1e5d615aca567), the entirety of his modifications have been brought over here.\n\nAdditionally, everyone who worked on PK Hack or was even associated with the\nproject. It's incredible to witness such a powerful community of fans who have\nturned a wonderful game inside-out over and over again.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjtorikian%2Fearthbound-battle-backgrounds-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgjtorikian%2Fearthbound-battle-backgrounds-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgjtorikian%2Fearthbound-battle-backgrounds-js/lists"}