{"id":19267472,"url":"https://github.com/freakmangd/zentig_ecs","last_synced_at":"2025-06-14T08:38:20.375Z","repository":{"id":155344418,"uuid":"629710056","full_name":"freakmangd/zentig_ecs","owner":"freakmangd","description":"Zig ECS library","archived":false,"fork":false,"pushed_at":"2025-06-06T06:01:59.000Z","size":6392,"stargazers_count":20,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-06T07:18:55.847Z","etag":null,"topics":["ecs","game-development","gamedev","zig","zig-package"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/freakmangd.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,"zenodo":null}},"created_at":"2023-04-18T21:48:53.000Z","updated_at":"2025-06-06T06:02:02.000Z","dependencies_parsed_at":"2024-03-14T05:30:33.562Z","dependency_job_id":"486b5535-4736-4622-ab52-af407101dff8","html_url":"https://github.com/freakmangd/zentig_ecs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/freakmangd/zentig_ecs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freakmangd%2Fzentig_ecs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freakmangd%2Fzentig_ecs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freakmangd%2Fzentig_ecs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freakmangd%2Fzentig_ecs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/freakmangd","download_url":"https://codeload.github.com/freakmangd/zentig_ecs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/freakmangd%2Fzentig_ecs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259789069,"owners_count":22911499,"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":["ecs","game-development","gamedev","zig","zig-package"],"created_at":"2024-11-09T20:12:08.766Z","updated_at":"2025-06-14T08:38:20.367Z","avatar_url":"https://github.com/freakmangd.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zentig_ecs\nA Zig ECS library. \n\nZentig is designed for scalability and ease of use, while staying out of your way.\nIt's heavily inspired by everything that makes [bevy_ecs](https://github.com/bevyengine/bevy)\nso great and [Unity](https://unity.com/) so approachable.\n\n##### WARNING:\nIt is not recommended to use zentig for anything major in it's current state.\nWhile it is functional and I use it frequently, it is far from battle tested.\n\nThat being said, if you encounter any problems please feel free to open an issue!\n\n## Installation\nFetching for zig master:\n```\nzig fetch --save git+https://github.com/freakmangd/zentig_ecs\n```\n\nFetching for zig 0.14.0:\n```\nzig fetch --save https://github.com/freakmangd/zentig_ecs/archive/refs/tags/0.14.0.tar.gz\n```\n\nIn both cases, place this in your `build.zig`:\n```zig\nconst zentig = b.dependency(\"zentig_ecs\", .{});\nexe.root_module.addImport(\"ztg\", zentig.module(\"zentig\"));\n```\n\nAnd import it in your project:\n```zig\nconst ztg = @import(\"ztg\");\n```\n\n## Overview\nAn entity is just a `usize`:\n```zig\npub const Entity = usize;\n```\n\nA basic component:\n```zig\npub const Player = struct {\n  name: []const u8,\n};\n```\n\nA basic system:\n```zig\npub fn playerSpeak(q: ztg.Query(.{Player})) !void {\n  for (q.items(Player)) |plr| {\n    std.debug.print(\"My name is {s}\\n\", .{plr.name});\n  }\n}\n```\n\nRegistering systems/components into a world:\n```zig\nconst MyWorld = blk: {\n  var wb = ztg.WorldBuilder.init(\u0026.{});\n  wb.addComponents(\u0026.{Player});\n  wb.addSystemsToStage(.update, playerSpeak);\n  break :blk wb.Build();\n};\n```\n\nCalling systems is easily integratable into your game framework:\n```zig\ntest \"running systems\" {\n  var world = MyWorld.init(testing.allocator);\n  defer world.deinit();\n\n  try world.runStage(.load);\n  try world.runUpdateStages();\n  try world.runStage(.draw);\n  \n  // Support for user defined stages\n  try world.runStageList(\u0026.{ .post_process, .pre_reset, .post_mortem });\n}\n```\n\n## Scalability\nThe `.include()` function in `WorldBuilder` makes it easy to compartmentalize your game systems.\nAs well as integrate third party libraries with only one extra line!\n\n`main.zig`:\n```zig\n// .include() looks for a `pub fn include(comptime *WorldBuilder) (!)void` def \n// in each struct. If the function errors it's a compile error,\n// but the signature can return either `!void` or `void`\nwb.include(\u0026.{\n  ztg.base,\n  @import(\"player.zig\"),\n  @import(\"my_library\"),\n});\n```\n\n`player.zig`:\n```zig\npub fn include(comptime wb: *ztg.WorldBuilder) void {\n  wb.addComponents(.{ Player, PlayerGun, PlayerHUD });\n  wb.addSystemsToStage(.update, .{ update_player, update_gun, update_hud });\n}\n```\n\n`my_library/init.zig`:\n```zig\npub fn include(comptime wb: *ztg.WorldBuilder) void {\n  wb.include(\u0026.{\n      // Namespaces can be included more than once to \"ensure\" \n      // they are included if you depend on them\n      ztg.base, \n      //...\n  });\n}\n```\n\n## Getting Started\nSee this short tutorial on creating systems and components [here](https://github.com/freakmangd/zentig_ecs/tree/main/docs/hello_world.md)\n\n## Full Examples\nSee full examples in the [examples folder](https://github.com/freakmangd/zentig_ecs/tree/main/examples)\n\n## Framework Support\nzentig is framework agnostic, it doesn't include any drawing capabilities. For that you need something like Raylib, I've created a library that\nwraps common Raylib components and provides systems that act on those components [here](https://github.com/freakmangd/zentig_raylib).\n\nThat page provides installation instructions and usage examples.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreakmangd%2Fzentig_ecs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffreakmangd%2Fzentig_ecs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffreakmangd%2Fzentig_ecs/lists"}