{"id":14713084,"url":"https://github.com/glassesneo/saohime","last_synced_at":"2025-07-25T21:38:14.383Z","repository":{"id":247368041,"uuid":"825570476","full_name":"glassesneo/saohime","owner":"glassesneo","description":"An extensible 2D game engine for Nim, inspired by Bevy Engine","archived":false,"fork":false,"pushed_at":"2024-10-04T11:20:29.000Z","size":14556,"stargazers_count":12,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-03-23T18:46:44.697Z","etag":null,"topics":["entity-component-system","game-development","game-engine","game-engine-2d","nim","saohime"],"latest_commit_sha":null,"homepage":"","language":"Nim","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/glassesneo.png","metadata":{"files":{"readme":".github/README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2024-07-08T05:22:22.000Z","updated_at":"2025-01-24T23:01:47.000Z","dependencies_parsed_at":"2025-01-05T06:01:42.584Z","dependency_job_id":null,"html_url":"https://github.com/glassesneo/saohime","commit_stats":null,"previous_names":["glassesneo/saohime"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glassesneo%2Fsaohime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glassesneo%2Fsaohime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glassesneo%2Fsaohime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glassesneo%2Fsaohime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glassesneo","download_url":"https://codeload.github.com/glassesneo/saohime/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248065943,"owners_count":21042006,"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":["entity-component-system","game-development","game-engine","game-engine-2d","nim","saohime"],"created_at":"2024-09-13T17:01:14.795Z","updated_at":"2025-04-09T16:23:45.952Z","avatar_url":"https://github.com/glassesneo.png","language":"Nim","funding_links":[],"categories":["Game Development"],"sub_categories":["Game Engines"],"readme":"\u003cdiv align='center'\u003e\n\n\u003cimg src='./assets/header.png' alt='header'\u003e\n\n\u003c/div\u003e\n\n\u003cbr /\u003e\n\n\u003cdiv align='center'\u003e\n\nSaohime Engine is a Data-Oriented 2D game engine for Nim Programming Language.\n\n\u003c/div\u003e\n\n\u003e [!NOTE]\n\u003e This project is under heavy development and **NOT** ready for practical use. Some features have not yet been implemented. See Roadmap for more details.\n\n## Supported platforms\n- MacOS\n- Linux (Ubuntu, NixOS)\n- Windows (Haven't tested yet, but should work on it)\n\n## Requirement\n- SDL, SDL_image, SDL_ttf (2.x)\n\n## Installation\n```sh\nnimble install https://github.com/glassesneo/saohime\n```\n\n## Usage\n```nim\nimport\n  std/[random],\n  saohime,\n  saohime/default_plugins\n\nproc setup(renderer: Resource[Renderer]) {.system.} =\n  # Get the resource of type `Renderer`\n  # It's a syntax sugar for `let renderer = commands.getResource(Renderer)`\n  randomize()\n  renderer.setDrawBlendMode(BlendModeBlend)\n\nproc pollEvent(appEvent: Event[ApplicationEvent]) {.system.} =\n  # Receive `ApplicationEvent` which deals with the application's start/stop\n  for event in appEvent:\n    if event.eventType == Quit:\n      # `Application` itself is a resource.\n      let app = commands.getResource(Application)\n      app.terminate()\n\nproc randomCircles(fpsManager: Resource[FPSManager]) {.system.} =\n  if fpsManager.frameCount mod 20 == 0:\n    let color = SaohimeColor.new(\n      r = rand(255),\n      g = rand(255),\n      b = 255,\n      a = rand(127),\n    )\n    # Create an entity\n    commands.create()\n      # Attach a component\n      .attach(Circle.new(radius = 1))\n      .attach(\n        Transform.new(x = rand(640f), y = rand(480f), scale = Vector.new(1, 1)),\n      )\n      .attach(Material.new(color = color))\n\nproc increaseRadius(\n    # Get the entities which have `Circle` component\n    circleQuery: [All[Circle]]\n) {.system.} =\n  for entity, circle in circleQuery[Circle]:\n    circle.radius += 1\n    if circle.radius \u003e 150:\n      entity.delete()\n\n# Create an instance of `Application`\nlet app = Application.new()\n\n# Load the default plugins --------- it's necessary to create a window!\napp.loadPluginGroup(DefaultPlugins)\n\n# Start the app\napp.start:\n  # In the block of `start`, you can use a special variable `world`\n  # to add or register what you need for your app.\n  world.registerStartupSystems(setup)\n  world.registerSystems(pollEvent, randomCircles, increaseRadius)\n```\n\n\u003cdiv align='center'\u003e\n\n\u003cimg src='./assets/demo.jpg' alt='demo' width='80%' height='80%'\u003e\n\n\u003c/div\u003e\n\nSee `examples/` for more practical examples.\n\n## Features/Roadmap\n### Basic features\n- [x] Entity Component System integration with [ecslib](https://github.com/glassesneo/ecslib)\n- [x] GPU rendering with SDL2\n- [x] Instant rendering with z-order\n- [x] Flexible API for image, sprite and tile map\n- [x] 2D camera implementation\n- [x] 3D Audio operations with OpenAL via [slappy](https://github.com/treeform/slappy)\n- [x] Efficient asset management\n- [x] Event queue implementation well-integrated with ECS\n- [x] General input device support including game controller\n- [x] Simple FPS management\n- [x] Hierarchical structure between entities\n- [ ] Particle implementation\n- [ ] GUI implementation built on ECS\n- [ ] Support for TUI\n- [ ] Timer implementation\n- [ ] Command line tool\n- [ ] Save/Load implementation\n\n### Extra features\n- [x] Extensible plugin architecture\n- [x] Lua integration via [spellua](https://github.com/glassesneo/spellua)\n- [ ] Resource embedding\n- [ ] Test and debug tool\n- [ ] WebAssembly support\n- [ ] OpenGL integration\n- [ ] cairo integration\n- [ ] Hot reload\n\n## Documentation\nPlease go see [ecslib](https://github.com/glassesneo/ecslib) for Entity Component System API.\nThe core application API reference can be seen [here](../docs/API.md). Every default plugin will soon have its own API.md.\n\n## Plugins\n### Official\n- [Audio Plugin](https://github.com/glassesneo/saohime_audio)\n- [Lua Plugin](https://github.com/glassesneo/saohime_lua)\n\u003cbr\u003e\n\nThe reference for the plugin architecture in Saohime can be seen [here](../docs/plugin.md).\n\n## License\nSaohime Engine is licensed under the MIT license. See COPYING for details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglassesneo%2Fsaohime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglassesneo%2Fsaohime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglassesneo%2Fsaohime/lists"}