{"id":25883091,"url":"https://github.com/o-x-l/opensimplex","last_synced_at":"2025-07-05T23:32:59.982Z","repository":{"id":272349701,"uuid":"916273733","full_name":"O-X-L/opensimplex","owner":"O-X-L","description":"Simple Python3 wrapper for the opensimplex-go module","archived":false,"fork":false,"pushed_at":"2025-01-30T15:04:01.000Z","size":90,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"latest","last_synced_at":"2025-01-30T15:39:37.978Z","etag":null,"topics":["game","game-dev","game-development","noise","noise-generator","noise-maps","opensimplex","terrain-generation"],"latest_commit_sha":null,"homepage":"","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/O-X-L.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":"2025-01-13T19:28:42.000Z","updated_at":"2025-01-30T15:04:05.000Z","dependencies_parsed_at":"2025-01-14T23:26:27.044Z","dependency_job_id":null,"html_url":"https://github.com/O-X-L/opensimplex","commit_stats":null,"previous_names":["o-x-l/python-opensimplex","o-x-l/opensimplex"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/O-X-L%2Fopensimplex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/O-X-L%2Fopensimplex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/O-X-L%2Fopensimplex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/O-X-L%2Fopensimplex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/O-X-L","download_url":"https://codeload.github.com/O-X-L/opensimplex/tar.gz/refs/heads/latest","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241537061,"owners_count":19978456,"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":["game","game-dev","game-development","noise","noise-generator","noise-maps","opensimplex","terrain-generation"],"created_at":"2025-03-02T16:31:13.652Z","updated_at":"2025-03-02T16:31:14.466Z","avatar_url":"https://github.com/O-X-L.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenSimplex Noise\n\n[![Lint](https://github.com/O-X-L/opensimplex/actions/workflows/lint.yml/badge.svg)](https://github.com/O-X-L/opensimplex/actions/workflows/lint.yml)\n[![Test](https://github.com/O-X-L/opensimplex/actions/workflows/test.yml/badge.svg)](https://github.com/O-X-L/opensimplex/actions/workflows/test.yml)\n\nThis repository contains a simple Python3-wrapper around the [opensimplex-go](https://github.com/ojrac/opensimplex-go) module.\n\nIt should be an alternative to the full [Python3-implementation of opensimplex](https://pypi.org/project/opensimplex/).\n\n----\n\n## Benchmarks\n\n### 50 x 50\n\n|Implementation|Time|\n|---|---|\n|[opensimplex-go CLI](https://github.com/O-X-L/opensimplex/blob/latest/examples/generate_map_cli.py)|0.047|\n|[opensimplex python](https://github.com/O-X-L/opensimplex/blob/latest/examples/generate_map_compare.py)|0.673|\n|[opensimplex-go CGO](https://github.com/O-X-L/opensimplex/blob/latest/examples/generate_map_cgo.py)|8.371|\n\n### 200 x 200\n\n|Implementation|Time|\n|---|---|\n|[opensimplex-go CLI](https://github.com/O-X-L/opensimplex/blob/latest/examples/generate_map_cli.py)|0.209|\n|[opensimplex python](https://github.com/O-X-L/opensimplex/blob/latest/examples/generate_map_compare.py)|10.808|\n|[opensimplex-go CGO](https://github.com/O-X-L/opensimplex/blob/latest/examples/generate_map_cgo.py)|139.539|\n\n### 1000 x 1000\n\n|Implementation|Time|\n|---|---|\n|[opensimplex-go CLI](https://github.com/O-X-L/opensimplex/blob/latest/examples/generate_map_cli.py)|3.535|\n|[opensimplex python](https://github.com/O-X-L/opensimplex/blob/latest/examples/generate_map_compare.py)|248.498|\n|[opensimplex-go CGO](https://github.com/O-X-L/opensimplex/blob/latest/examples/generate_map_cgo.py)|LOOONG...|\n\n----\n\n\u003cimg alt=\"Example Map\" src=\"https://raw.githubusercontent.com/O-X-L/opensimplex/refs/heads/latest/examples/map_1000x1000.webp\" width=\"70%\" /\u003e\n\n----\n\n## Usage\n\nYou first need to either [download](https://github.com/O-X-L/opensimplex/releases) or build the golang binaries.\n\n### Build\n\n1.  [Golang download/install](https://go.dev/doc/install)\n\n2. Build them: `bash scripts/build_cli.sh` and/or `bash scripts/build_cgo.sh`\n\n----\n\n### CLI Implementation\n\n1. Install example requirements: `pip install -r examples/requirements.txt`\n\n2. Test it: `python3 examples/generate_map_cli.py`\n\n3. How to use it: [Example](https://github.com/O-X-L/opensimplex/blob/latest/examples/generate_map_cli.py) | [Practical Example of Terrain-Generation](https://github.com/superstes/strategy-browser-game/tree/main/src/backend/map_generator)\n\nThis way it basically calls the standalone golang binary in a subprocess and loads the resulting data from a temporary file.\n\nIt currently only supports generating whole **2D** noise-maps.\n\n#### Raw CLI Usage\n\nExport data example:\n\n```json\n{\n  \"data\": [0, 0, 43.49935, 0, 1, 39.84343],  // x, y, height\n  \"max\": 43.49935,\n  \"min\": 39.84343\n}\n```\n\nUsage:\n\n```bash\nUsage of noise_cli:\n  -size int\n        Map size (default 1000)\n  -x float\n        Map offset dimension-X\n  -y float\n        Map offset dimension-Y\n  -out string\n        Map output file (default \"/tmp/map.json\")\n  -dimensions int\n        Dimensions (default 2)\n  -seed int\n        Seed\n  -exponentiation float\n        Exponentiation (default 5)\n  -height float\n        Height (default 135)\n  -lacunarity float\n        Lacunarity (default 1.5)\n  -octaves int\n        Octaves (default 10)\n  -persistence float\n        Persistence (default 0.7)\n  -scale float\n        Scale (default 50)\n  -silent\n        Do not show output\n  -no-coords\n        If enabled the coords will be omitted from the data-export\n  -sink\n        If the whole noise-map should be sunk-down so the lowest point is 0\n  -lower float\n        Lower each height by this value - negatives are clamped to 0\n  -mirror string\n        To mirror the values set this to one of: 'x', 'y', 'xy', 'reverse'\n  -rotate string\n        To rotate the values set this to one of: '90cw', '90ccw', '180'\n```\n\n----\n\n### CGO Implementation\n\n1. Install example requirements: `pip install -r examples/requirements.txt`\n\n2. Test it: `python3 examples/minimal_cgo.py` or `python3 examples/generate_map_cgo.py`\n\n3. How to use it: [Example](https://github.com/O-X-L/opensimplex/blob/latest/examples/generate_map_cgo.py)\n\nThe CGO implementation is very slow. Not yet sure why that is..\n\n----\n\n## Credits\n\nThanks to [@ojrac for the golang module](https://github.com/ojrac/opensimplex-go), to [@KdotJPG for the original OpenSimplex](https://github.com/KdotJPG) and to [@simondevyoutube for the implementation-example](https://github.com/simondevyoutube/ProceduralTerrain_Part10).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo-x-l%2Fopensimplex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fo-x-l%2Fopensimplex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fo-x-l%2Fopensimplex/lists"}