{"id":20495613,"url":"https://github.com/tambeta/juice","last_synced_at":"2026-04-09T02:02:34.698Z","repository":{"id":182839031,"uuid":"85969098","full_name":"tambeta/juice","owner":"tambeta","description":"Terrain generator + a simple top-down scrolling engine skeleton","archived":false,"fork":false,"pushed_at":"2017-03-23T16:12:55.000Z","size":592,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-01T09:13:24.741Z","etag":null,"topics":["numpy","opengl","pyglet","python","python3","scipy","terrain","terrain-generation","top-down"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tambeta.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}},"created_at":"2017-03-23T15:57:49.000Z","updated_at":"2023-02-16T19:53:53.000Z","dependencies_parsed_at":"2023-07-21T18:33:09.113Z","dependency_job_id":null,"html_url":"https://github.com/tambeta/juice","commit_stats":null,"previous_names":["tambeta/juice"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tambeta/juice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambeta%2Fjuice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambeta%2Fjuice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambeta%2Fjuice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambeta%2Fjuice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tambeta","download_url":"https://codeload.github.com/tambeta/juice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tambeta%2Fjuice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31581864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["numpy","opengl","pyglet","python","python3","scipy","terrain","terrain-generation","top-down"],"created_at":"2024-11-15T17:46:36.869Z","updated_at":"2026-04-09T02:02:34.679Z","avatar_url":"https://github.com/tambeta.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Juice\n\nJuice is an experiment in terrain generation algorithms and the beginnings of\na top-down scolling engine built on Python 3, [NumPy /\nSciPy](https://scipy.org/), \n[pyglet](https://bitbucket.org/pyglet/pyglet/wiki/Home) (and OpenGL,\ntransitively).\n\n![Screenshot](http://i.imgur.com/eBnm5sB.png)\n\n## Terrain generation\n\nTerrain generation is relatively feature-complete, including:\n\n* An underlying heightmap for various purposes, e.g. river and sea generation.\n* Various terrain layers generated on top of the heightmap (seas, rivers,\n  biomes, roads and city locations).\n* Normalization of the terrain layers so their elements would be presentable\n  with a standard tile set (four straight edges, four convex corners, four\n  concave corners and a solid tile).\n\nThis is mostly isolated into the Terrain, TerrainLayer (and subclasses\nthereof) and HeightMap classes. Juice was initially envisoned as a standalone\ngame, hence there has been no effort to package this functionality into a\nlibrary, but the codebase could be a solid starting point for a game utilizing\na 2D terrain. The resulting map can be visualized by passing the `-m` flag to\n`juice.py`.\n\n## Scrolling engine\n\nThis project also includes basic final rendering of the game world onto a\nscrollable pyglet / OpenGL viewport. The [LPC Tile\nAtlas](http://lpc.opengameart.org/) is utilized (see LICENSE for details), but\nas this is missing some graphics (rivers, roads,\ncities), these features are represented by runtime-generated mock tiles. For a\ndemo, simply run `juice.py` without arguments.\n\n## Usage\n\nEnsure `scipy`, `numpy`, `pyglet` and `PIL`\n([Pillow](http://pillow.readthedocs.io/)) are installed and available in the\nenvironment before attempting to run `juice.py`. The most convenient way to\nachieve this is to use a [virtual\nenvironment](https://python-docs.readthedocs.io/en/latest/dev/virtualenvs.html).\n\n```\n$ ./juice.py --help\nusage: juice.py [-h] [-r RANDOM_SEED] [-d DIMENSION] [-t] [-L LOG_LEVEL] [-m]\n                [-s SAVE] [-l LOAD]\n\nJuice: the power grid game\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -r RANDOM_SEED, --random-seed RANDOM_SEED\n                        Specify random seed\n  -d DIMENSION, --dimension DIMENSION\n                        Game field side length\n  -t, --timing          Timing / profiling mode, exit after terrain generation\n  -L LOG_LEVEL, --log-level LOG_LEVEL\n                        Log level, one of CRITICAL, ERROR, WARNING, INFO,\n                        DEBUG.\n  -m, --map             Display overview map instead of entering the game\n  -s SAVE, --save SAVE  Save a map to file\n  -l LOAD, --load LOAD  Load a saved map\n```\n\n## Notes\n\nThere is no documentation besides the commented source. This project is not\nunder active development. It was imported to GitHub mainly in the hope of\npossibly becoming a somewhat rough building block for a game needing terrain\ngeneration and possibly a rough skeleton of a scrollable game world rendering.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftambeta%2Fjuice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftambeta%2Fjuice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftambeta%2Fjuice/lists"}