{"id":15510406,"url":"https://github.com/ananace/kunlaboro","last_synced_at":"2025-04-23T02:54:05.839Z","repository":{"id":4783320,"uuid":"5935505","full_name":"ananace/Kunlaboro","owner":"ananace","description":"The Kunlaboro Entity-System","archived":false,"fork":false,"pushed_at":"2016-11-13T20:20:08.000Z","size":1292,"stargazers_count":9,"open_issues_count":10,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-23T02:53:58.027Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/ananace.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}},"created_at":"2012-09-24T14:13:49.000Z","updated_at":"2018-06-27T08:31:24.000Z","dependencies_parsed_at":"2022-09-10T16:50:20.620Z","dependency_job_id":null,"html_url":"https://github.com/ananace/Kunlaboro","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FKunlaboro","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FKunlaboro/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FKunlaboro/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ananace%2FKunlaboro/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ananace","download_url":"https://codeload.github.com/ananace/Kunlaboro/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250360259,"owners_count":21417718,"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":[],"created_at":"2024-10-02T09:48:29.696Z","updated_at":"2025-04-23T02:54:05.799Z","avatar_url":"https://github.com/ananace.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Kunlaboro [![Build Status](https://travis-ci.org/ace13/Kunlaboro.svg?branch=master)](https://travis-ci.org/ace13/Kunlaboro) [![Build status](https://ci.appveyor.com/api/projects/status/eqe00q7ej7vrj33m/branch/master?svg=true)](https://ci.appveyor.com/project/ace13/kunlaboro/branch/master)\n=========\n\n[Source](https://github.com/ace13/Kunlaboro) | [Issues](https://github.com/ace13/Kunlaboro/issues) | [Documentation](https://ace13.github.io/Kunlaboro)\n\nKunlaboro - which is esperanto and means *cooperation* - is a C++ Entity-Component System licensed under the MIT license.\n\nIt is currently undergoing a complete rewrite to hold a higher performance - data-driven - approach to components, while still providing a high-level message passing system.\n\nRequirements\n------------\n\nKunlaboro is built using many C++11 and 14 features, therefore it requires a reasonably modern compiler to work properly.\n\nCurrent development is done on Visual Studio 2015, with additional testing on GCC-4.9 and Clang-3.4. Other compilers that support C++14 will most likely also work.\n\nTODO\n----\n\n- ~~Low level, high performance, event system.~~\n  - ~~Events indexed by POD structs containing event data.~~\n  - ~~Fast iteration and calling of registered events.~~\n- ~~High level, acceptable performance, message passing system.~~\n  - ~~Messages indexed by hashed string values (32/64-bit).~~\n  - ~~Message passing done in an RPC-like way.~~\n  - ~~Global/Local message requests.~~\n- Functions for shrinking arrays, collecting garbage.\n  - Clear unused bitfield slots, reduce size on bit removal.\n  - ~~Run garbage collection on memory pools, on user request.~~\n- Better creation of POD components?\n  - Look into possibility of having true POD components.\n- ~~Improve job queue~~\n  - Allow for reusing queue without restarting threads.\n- Clean up code, forward declare more things.\n  - Include inline through headers.\n- More compile-time code.\n  - Use ID enums to make compile-time bitsets possible.\n\nCode Examples\n-------------\n\n3D Particle system; **Note**: Uses true POD components, which is not supported at the moment.\n\n```c++\nstruct Position : public Kunlaboro::Component\n{\n\tfloat X, Y, Z;\n};\nstruct Velocity : public Kunlaboro::Component\n{\n\tfloat dX, dY, dZ;\n};\nstruct Friction : public Kunlaboro::Component\n{\n\tfloat Friction;\n};\nstruct Lifetime : public Kunlaboro::Component\n{\n\tfloat Time;\n};\n\nclass ParticleSystem\n{\npublic:\n\tParticleSystem(Kunlaboro::EntitySystem\u0026 es)\n\t\t: mES(es)\n\t{ }\n\n\tvoid update(float dt)\n\t{\n\t\tmDT = dt;\n\n\t\tauto iter = Kunlaboro::EntityView(mES);\n\t\titer.withComponents\u003cKunlaboro::Match_All, Position, Velocity\u003e.forEach(iterate);\n\t\titer.withComponents\u003cKunlaboro::Match_All, Velocity, Friction\u003e.forEach(iterate);\n\t\titer.withComponents\u003cKunlaboro::Match_All, Lifetime\u003e.forEach(iterate);\n\t}\n\n\tvoid addParticle(float x, float y, float z, float dx, float dy, float dz)\n\t{\n\t\tauto ent = mES.entityCreate();\n\t\tent.addComponent\u003cPosition\u003e(x, y, z);\n\t\tent.addComponent\u003cVelocity\u003e(dx, dy, dz);\n\t}\n\n\tvoid addParticle(float x, float y, float z, float dx, float dy, float dz, float life)\n\t{\n\t\tauto ent = mES.entityCreate();\n\t\tent.addComponent\u003cPosition\u003e(x, y, z);\n\t\tent.addComponent\u003cVelocity\u003e(dx, dy, dz);\n\t\tent.addComponent\u003cLifetime\u003e(life);\n\t}\n\nprivate:\n\tvoid iterate(const Kunlaboro::Entity\u0026 ent, Position\u0026 pos, Velocity\u0026 vel)\n\t{\n\t\tpos.X += dX * mDT;\n\t\tpos.Y += dY * mDT;\n\t\tpos.Z += dZ * mDT;\n\t}\n\tvoid iterate(const Kunlaboro::Entity\u0026 ent, Velocity\u0026 vel, Friction\u0026 fric)\n\t{\n\t\tfloat frictionDelta = 1 - fric.Friction * mDT;\n\n\t\tvel.dX *= frictionDelta;\n\t\tvel.dY *= frictionDelta;\n\t\tvel.dZ *= frictionDelta;\n\t}\n\tvoid iterate(const Kunlaboro::Entity\u0026 ent, Lifetime\u0026 time)\n\t{\n\t\ttime.Time -= mDT;\n\n\t\tif (time.Time \u003c= 0)\n\t\t\tent.destroy();\n\t}\n\n\tfloat mDT;\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fananace%2Fkunlaboro","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fananace%2Fkunlaboro","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fananace%2Fkunlaboro/lists"}