yuna-engine 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (372) hide show
  1. yuna_engine-0.1.0/.github/workflows/ci.yml +27 -0
  2. yuna_engine-0.1.0/.github/workflows/release.yml +33 -0
  3. yuna_engine-0.1.0/.gitignore +221 -0
  4. yuna_engine-0.1.0/.pre-commit-config.yaml +46 -0
  5. yuna_engine-0.1.0/.python-version +1 -0
  6. yuna_engine-0.1.0/LICENSE +21 -0
  7. yuna_engine-0.1.0/PKG-INFO +124 -0
  8. yuna_engine-0.1.0/README.md +103 -0
  9. yuna_engine-0.1.0/assets/yuna.svg +10 -0
  10. yuna_engine-0.1.0/pyproject.toml +109 -0
  11. yuna_engine-0.1.0/src/__init__.py +0 -0
  12. yuna_engine-0.1.0/src/yuna/README.md +1017 -0
  13. yuna_engine-0.1.0/src/yuna/__init__.py +30 -0
  14. yuna_engine-0.1.0/src/yuna/ai/__init__.py +0 -0
  15. yuna_engine-0.1.0/src/yuna/ai/behavior_tree/__init__.py +0 -0
  16. yuna_engine-0.1.0/src/yuna/ai/behavior_tree/component.py +57 -0
  17. yuna_engine-0.1.0/src/yuna/ai/behavior_tree/composite.py +161 -0
  18. yuna_engine-0.1.0/src/yuna/ai/behavior_tree/decorator.py +202 -0
  19. yuna_engine-0.1.0/src/yuna/ai/behavior_tree/node.py +44 -0
  20. yuna_engine-0.1.0/src/yuna/ai/behavior_tree/system.py +106 -0
  21. yuna_engine-0.1.0/src/yuna/ai/behavior_tree/types.py +68 -0
  22. yuna_engine-0.1.0/src/yuna/ai/blackboard.py +162 -0
  23. yuna_engine-0.1.0/src/yuna/ai/events.py +175 -0
  24. yuna_engine-0.1.0/src/yuna/ai/optimization.py +75 -0
  25. yuna_engine-0.1.0/src/yuna/ai/pathfinding.py +412 -0
  26. yuna_engine-0.1.0/src/yuna/ai/perception.py +461 -0
  27. yuna_engine-0.1.0/src/yuna/ai/profiling.py +36 -0
  28. yuna_engine-0.1.0/src/yuna/ai/query.py +184 -0
  29. yuna_engine-0.1.0/src/yuna/ai/steering.py +480 -0
  30. yuna_engine-0.1.0/src/yuna/api-docs/ERROR_HANDLING.md +429 -0
  31. yuna_engine-0.1.0/src/yuna/commands/__init__.py +0 -0
  32. yuna_engine-0.1.0/src/yuna/commands/applicator.py +153 -0
  33. yuna_engine-0.1.0/src/yuna/commands/command.py +118 -0
  34. yuna_engine-0.1.0/src/yuna/commands/effect_modifiers.py +201 -0
  35. yuna_engine-0.1.0/src/yuna/commands/invoker.py +137 -0
  36. yuna_engine-0.1.0/src/yuna/commands/macro.py +165 -0
  37. yuna_engine-0.1.0/src/yuna/commands/permissions.py +159 -0
  38. yuna_engine-0.1.0/src/yuna/commands/result.py +29 -0
  39. yuna_engine-0.1.0/src/yuna/commands/validator.py +335 -0
  40. yuna_engine-0.1.0/src/yuna/config/__init__.py +0 -0
  41. yuna_engine-0.1.0/src/yuna/config/component.py +69 -0
  42. yuna_engine-0.1.0/src/yuna/config/modifiers.py +144 -0
  43. yuna_engine-0.1.0/src/yuna/config/patterns.py +139 -0
  44. yuna_engine-0.1.0/src/yuna/config/schema.py +310 -0
  45. yuna_engine-0.1.0/src/yuna/config/store.py +203 -0
  46. yuna_engine-0.1.0/src/yuna/config/types.py +179 -0
  47. yuna_engine-0.1.0/src/yuna/config/validators.py +33 -0
  48. yuna_engine-0.1.0/src/yuna/deprecation.py +153 -0
  49. yuna_engine-0.1.0/src/yuna/ecs/__init__.py +0 -0
  50. yuna_engine-0.1.0/src/yuna/ecs/archetype.py +241 -0
  51. yuna_engine-0.1.0/src/yuna/ecs/archetype_store.py +374 -0
  52. yuna_engine-0.1.0/src/yuna/ecs/buffer.py +131 -0
  53. yuna_engine-0.1.0/src/yuna/ecs/component.py +29 -0
  54. yuna_engine-0.1.0/src/yuna/ecs/dirty.py +84 -0
  55. yuna_engine-0.1.0/src/yuna/ecs/entity.py +152 -0
  56. yuna_engine-0.1.0/src/yuna/ecs/hierarchy.py +208 -0
  57. yuna_engine-0.1.0/src/yuna/ecs/lifecycle.py +232 -0
  58. yuna_engine-0.1.0/src/yuna/ecs/markers.py +27 -0
  59. yuna_engine-0.1.0/src/yuna/ecs/priority.py +69 -0
  60. yuna_engine-0.1.0/src/yuna/ecs/prototype.py +179 -0
  61. yuna_engine-0.1.0/src/yuna/ecs/query.py +265 -0
  62. yuna_engine-0.1.0/src/yuna/ecs/relationships.py +170 -0
  63. yuna_engine-0.1.0/src/yuna/ecs/store.py +235 -0
  64. yuna_engine-0.1.0/src/yuna/ecs/system.py +130 -0
  65. yuna_engine-0.1.0/src/yuna/ecs/world.py +771 -0
  66. yuna_engine-0.1.0/src/yuna/events/__init__.py +0 -0
  67. yuna_engine-0.1.0/src/yuna/events/bus.py +149 -0
  68. yuna_engine-0.1.0/src/yuna/events/consumption.py +38 -0
  69. yuna_engine-0.1.0/src/yuna/events/dispatcher.py +201 -0
  70. yuna_engine-0.1.0/src/yuna/events/event.py +42 -0
  71. yuna_engine-0.1.0/src/yuna/events/filtering.py +168 -0
  72. yuna_engine-0.1.0/src/yuna/events/queue.py +123 -0
  73. yuna_engine-0.1.0/src/yuna/exceptions.py +450 -0
  74. yuna_engine-0.1.0/src/yuna/fsm/__init__.py +0 -0
  75. yuna_engine-0.1.0/src/yuna/fsm/component.py +54 -0
  76. yuna_engine-0.1.0/src/yuna/fsm/machine.py +168 -0
  77. yuna_engine-0.1.0/src/yuna/fsm/state.py +81 -0
  78. yuna_engine-0.1.0/src/yuna/fsm/system.py +81 -0
  79. yuna_engine-0.1.0/src/yuna/fsm/transition.py +51 -0
  80. yuna_engine-0.1.0/src/yuna/loop/__init__.py +0 -0
  81. yuna_engine-0.1.0/src/yuna/loop/dependencies.py +229 -0
  82. yuna_engine-0.1.0/src/yuna/loop/game_loop.py +247 -0
  83. yuna_engine-0.1.0/src/yuna/loop/job.py +126 -0
  84. yuna_engine-0.1.0/src/yuna/loop/parallel.py +144 -0
  85. yuna_engine-0.1.0/src/yuna/loop/scheduler.py +207 -0
  86. yuna_engine-0.1.0/src/yuna/loop/time.py +79 -0
  87. yuna_engine-0.1.0/src/yuna/modifiers/__init__.py +0 -0
  88. yuna_engine-0.1.0/src/yuna/modifiers/applicator.py +42 -0
  89. yuna_engine-0.1.0/src/yuna/modifiers/batch.py +94 -0
  90. yuna_engine-0.1.0/src/yuna/modifiers/cache.py +192 -0
  91. yuna_engine-0.1.0/src/yuna/modifiers/conditions.py +327 -0
  92. yuna_engine-0.1.0/src/yuna/modifiers/config.py +324 -0
  93. yuna_engine-0.1.0/src/yuna/modifiers/context.py +41 -0
  94. yuna_engine-0.1.0/src/yuna/modifiers/conventions.py +171 -0
  95. yuna_engine-0.1.0/src/yuna/modifiers/conversions.py +198 -0
  96. yuna_engine-0.1.0/src/yuna/modifiers/expiration.py +58 -0
  97. yuna_engine-0.1.0/src/yuna/modifiers/interceptor.py +42 -0
  98. yuna_engine-0.1.0/src/yuna/modifiers/modifier.py +125 -0
  99. yuna_engine-0.1.0/src/yuna/modifiers/operations.py +154 -0
  100. yuna_engine-0.1.0/src/yuna/modifiers/pipeline.py +234 -0
  101. yuna_engine-0.1.0/src/yuna/modifiers/query.py +194 -0
  102. yuna_engine-0.1.0/src/yuna/modifiers/reader.py +40 -0
  103. yuna_engine-0.1.0/src/yuna/modifiers/relationships.py +402 -0
  104. yuna_engine-0.1.0/src/yuna/modifiers/scaling.py +253 -0
  105. yuna_engine-0.1.0/src/yuna/modifiers/stages.py +1046 -0
  106. yuna_engine-0.1.0/src/yuna/modifiers/tracker.py +180 -0
  107. yuna_engine-0.1.0/src/yuna/modifiers/types.py +80 -0
  108. yuna_engine-0.1.0/src/yuna/network/__init__.py +0 -0
  109. yuna_engine-0.1.0/src/yuna/network/authority.py +27 -0
  110. yuna_engine-0.1.0/src/yuna/network/budget.py +180 -0
  111. yuna_engine-0.1.0/src/yuna/network/component_tags.py +29 -0
  112. yuna_engine-0.1.0/src/yuna/network/compression.py +153 -0
  113. yuna_engine-0.1.0/src/yuna/network/delta.py +171 -0
  114. yuna_engine-0.1.0/src/yuna/network/interest.py +293 -0
  115. yuna_engine-0.1.0/src/yuna/network/priority.py +265 -0
  116. yuna_engine-0.1.0/src/yuna/network/quantization.py +179 -0
  117. yuna_engine-0.1.0/src/yuna/network/relevancy.py +319 -0
  118. yuna_engine-0.1.0/src/yuna/network/replication.py +288 -0
  119. yuna_engine-0.1.0/src/yuna/particles/__init__.py +0 -0
  120. yuna_engine-0.1.0/src/yuna/particles/field.py +79 -0
  121. yuna_engine-0.1.0/src/yuna/particles/simulation.py +271 -0
  122. yuna_engine-0.1.0/src/yuna/physics/__init__.py +0 -0
  123. yuna_engine-0.1.0/src/yuna/physics/body.py +93 -0
  124. yuna_engine-0.1.0/src/yuna/physics/engine.py +356 -0
  125. yuna_engine-0.1.0/src/yuna/physics/shapes.py +266 -0
  126. yuna_engine-0.1.0/src/yuna/physics/system.py +150 -0
  127. yuna_engine-0.1.0/src/yuna/pipeline/__init__.py +0 -0
  128. yuna_engine-0.1.0/src/yuna/pipeline/context.py +17 -0
  129. yuna_engine-0.1.0/src/yuna/pipeline/pipeline.py +187 -0
  130. yuna_engine-0.1.0/src/yuna/pipeline/registry.py +95 -0
  131. yuna_engine-0.1.0/src/yuna/pipeline/stage.py +47 -0
  132. yuna_engine-0.1.0/src/yuna/prefabs/__init__.py +0 -0
  133. yuna_engine-0.1.0/src/yuna/prefabs/manager.py +277 -0
  134. yuna_engine-0.1.0/src/yuna/prefabs/prefab.py +50 -0
  135. yuna_engine-0.1.0/src/yuna/profiling/__init__.py +0 -0
  136. yuna_engine-0.1.0/src/yuna/profiling/decorators.py +85 -0
  137. yuna_engine-0.1.0/src/yuna/profiling/monitor.py +370 -0
  138. yuna_engine-0.1.0/src/yuna/profiling/stats.py +68 -0
  139. yuna_engine-0.1.0/src/yuna/py.typed +0 -0
  140. yuna_engine-0.1.0/src/yuna/replay/__init__.py +0 -0
  141. yuna_engine-0.1.0/src/yuna/replay/config.py +70 -0
  142. yuna_engine-0.1.0/src/yuna/replay/controls.py +59 -0
  143. yuna_engine-0.1.0/src/yuna/replay/incremental.py +571 -0
  144. yuna_engine-0.1.0/src/yuna/replay/player.py +293 -0
  145. yuna_engine-0.1.0/src/yuna/replay/recorder.py +320 -0
  146. yuna_engine-0.1.0/src/yuna/replay/storage.py +223 -0
  147. yuna_engine-0.1.0/src/yuna/resources/__init__.py +0 -0
  148. yuna_engine-0.1.0/src/yuna/resources/flyweight.py +74 -0
  149. yuna_engine-0.1.0/src/yuna/resources/pool.py +93 -0
  150. yuna_engine-0.1.0/src/yuna/resources/pools.py +288 -0
  151. yuna_engine-0.1.0/src/yuna/scene/__init__.py +0 -0
  152. yuna_engine-0.1.0/src/yuna/scene/chunk.py +221 -0
  153. yuna_engine-0.1.0/src/yuna/scene/manager.py +156 -0
  154. yuna_engine-0.1.0/src/yuna/scene/scene.py +91 -0
  155. yuna_engine-0.1.0/src/yuna/scene/streaming.py +301 -0
  156. yuna_engine-0.1.0/src/yuna/scene/transition.py +59 -0
  157. yuna_engine-0.1.0/src/yuna/script/__init__.py +0 -0
  158. yuna_engine-0.1.0/src/yuna/script/compiler.py +198 -0
  159. yuna_engine-0.1.0/src/yuna/script/instructions.py +77 -0
  160. yuna_engine-0.1.0/src/yuna/script/vm.py +232 -0
  161. yuna_engine-0.1.0/src/yuna/services/__init__.py +0 -0
  162. yuna_engine-0.1.0/src/yuna/services/lifetime.py +16 -0
  163. yuna_engine-0.1.0/src/yuna/services/locator.py +117 -0
  164. yuna_engine-0.1.0/src/yuna/services/provider.py +32 -0
  165. yuna_engine-0.1.0/src/yuna/spatial/__init__.py +0 -0
  166. yuna_engine-0.1.0/src/yuna/spatial/bvh.py +380 -0
  167. yuna_engine-0.1.0/src/yuna/spatial/collision.py +15 -0
  168. yuna_engine-0.1.0/src/yuna/spatial/factory.py +134 -0
  169. yuna_engine-0.1.0/src/yuna/spatial/grid.py +819 -0
  170. yuna_engine-0.1.0/src/yuna/spatial/integration.py +202 -0
  171. yuna_engine-0.1.0/src/yuna/spatial/quadtree.py +433 -0
  172. yuna_engine-0.1.0/src/yuna/spatial/queries.py +84 -0
  173. yuna_engine-0.1.0/src/yuna/state/__init__.py +0 -0
  174. yuna_engine-0.1.0/src/yuna/state/component_registry.py +218 -0
  175. yuna_engine-0.1.0/src/yuna/state/manager.py +169 -0
  176. yuna_engine-0.1.0/src/yuna/state/migrations.py +302 -0
  177. yuna_engine-0.1.0/src/yuna/state/raw_snapshot.py +40 -0
  178. yuna_engine-0.1.0/src/yuna/state/serializer.py +730 -0
  179. yuna_engine-0.1.0/src/yuna/state/serializers.py +122 -0
  180. yuna_engine-0.1.0/src/yuna/state/snapshot.py +33 -0
  181. yuna_engine-0.1.0/src/yuna/state/versioning.py +121 -0
  182. yuna_engine-0.1.0/src/yuna/types/__init__.py +0 -0
  183. yuna_engine-0.1.0/src/yuna/types/bounds.py +99 -0
  184. yuna_engine-0.1.0/src/yuna/types/identifiers.py +7 -0
  185. yuna_engine-0.1.0/src/yuna/types/registry.py +233 -0
  186. yuna_engine-0.1.0/src/yuna/types/type_object.py +63 -0
  187. yuna_engine-0.1.0/src/yuna/types/vector.py +99 -0
  188. yuna_engine-0.1.0/tests/__init__.py +0 -0
  189. yuna_engine-0.1.0/tests/ai/__init__.py +0 -0
  190. yuna_engine-0.1.0/tests/ai/behavior_tree/__init__.py +0 -0
  191. yuna_engine-0.1.0/tests/ai/behavior_tree/test_component.py +127 -0
  192. yuna_engine-0.1.0/tests/ai/behavior_tree/test_composite.py +242 -0
  193. yuna_engine-0.1.0/tests/ai/behavior_tree/test_decorator.py +274 -0
  194. yuna_engine-0.1.0/tests/ai/behavior_tree/test_node.py +78 -0
  195. yuna_engine-0.1.0/tests/ai/behavior_tree/test_system.py +256 -0
  196. yuna_engine-0.1.0/tests/ai/behavior_tree/test_types.py +64 -0
  197. yuna_engine-0.1.0/tests/ai/test_blackboard.py +246 -0
  198. yuna_engine-0.1.0/tests/ai/test_events.py +141 -0
  199. yuna_engine-0.1.0/tests/ai/test_optimization.py +261 -0
  200. yuna_engine-0.1.0/tests/ai/test_pathfinding.py +467 -0
  201. yuna_engine-0.1.0/tests/ai/test_perception.py +1492 -0
  202. yuna_engine-0.1.0/tests/ai/test_profiling.py +290 -0
  203. yuna_engine-0.1.0/tests/ai/test_query.py +536 -0
  204. yuna_engine-0.1.0/tests/ai/test_steering.py +648 -0
  205. yuna_engine-0.1.0/tests/commands/__init__.py +0 -0
  206. yuna_engine-0.1.0/tests/commands/test_applicator.py +392 -0
  207. yuna_engine-0.1.0/tests/commands/test_command.py +340 -0
  208. yuna_engine-0.1.0/tests/commands/test_effect_modifiers.py +538 -0
  209. yuna_engine-0.1.0/tests/commands/test_invoker.py +351 -0
  210. yuna_engine-0.1.0/tests/commands/test_macro.py +345 -0
  211. yuna_engine-0.1.0/tests/commands/test_permissions.py +312 -0
  212. yuna_engine-0.1.0/tests/commands/test_result.py +132 -0
  213. yuna_engine-0.1.0/tests/commands/test_validator.py +665 -0
  214. yuna_engine-0.1.0/tests/commands/test_validator_with_effects.py +522 -0
  215. yuna_engine-0.1.0/tests/config/__init__.py +0 -0
  216. yuna_engine-0.1.0/tests/config/test_integration.py +284 -0
  217. yuna_engine-0.1.0/tests/config/test_modifiers.py +433 -0
  218. yuna_engine-0.1.0/tests/config/test_patterns.py +362 -0
  219. yuna_engine-0.1.0/tests/config/test_schema.py +774 -0
  220. yuna_engine-0.1.0/tests/config/test_store.py +584 -0
  221. yuna_engine-0.1.0/tests/config/test_types.py +306 -0
  222. yuna_engine-0.1.0/tests/config/test_validators.py +140 -0
  223. yuna_engine-0.1.0/tests/ecs/__init__.py +0 -0
  224. yuna_engine-0.1.0/tests/ecs/test_archetype.py +365 -0
  225. yuna_engine-0.1.0/tests/ecs/test_archetype_store.py +489 -0
  226. yuna_engine-0.1.0/tests/ecs/test_buffer.py +336 -0
  227. yuna_engine-0.1.0/tests/ecs/test_component.py +52 -0
  228. yuna_engine-0.1.0/tests/ecs/test_dirty.py +298 -0
  229. yuna_engine-0.1.0/tests/ecs/test_dirty_system.py +228 -0
  230. yuna_engine-0.1.0/tests/ecs/test_entity.py +301 -0
  231. yuna_engine-0.1.0/tests/ecs/test_hierarchy.py +363 -0
  232. yuna_engine-0.1.0/tests/ecs/test_lifecycle.py +316 -0
  233. yuna_engine-0.1.0/tests/ecs/test_priority.py +295 -0
  234. yuna_engine-0.1.0/tests/ecs/test_prototype.py +325 -0
  235. yuna_engine-0.1.0/tests/ecs/test_query.py +493 -0
  236. yuna_engine-0.1.0/tests/ecs/test_relationships.py +438 -0
  237. yuna_engine-0.1.0/tests/ecs/test_store.py +318 -0
  238. yuna_engine-0.1.0/tests/ecs/test_system.py +160 -0
  239. yuna_engine-0.1.0/tests/ecs/test_world.py +1014 -0
  240. yuna_engine-0.1.0/tests/ecs/test_world_snapshot.py +248 -0
  241. yuna_engine-0.1.0/tests/events/__init__.py +0 -0
  242. yuna_engine-0.1.0/tests/events/test_bus.py +307 -0
  243. yuna_engine-0.1.0/tests/events/test_consumption.py +273 -0
  244. yuna_engine-0.1.0/tests/events/test_dispatcher.py +289 -0
  245. yuna_engine-0.1.0/tests/events/test_event.py +189 -0
  246. yuna_engine-0.1.0/tests/events/test_filtering.py +513 -0
  247. yuna_engine-0.1.0/tests/events/test_queue.py +352 -0
  248. yuna_engine-0.1.0/tests/fsm/__init__.py +0 -0
  249. yuna_engine-0.1.0/tests/fsm/test_component.py +200 -0
  250. yuna_engine-0.1.0/tests/fsm/test_machine.py +502 -0
  251. yuna_engine-0.1.0/tests/fsm/test_state.py +163 -0
  252. yuna_engine-0.1.0/tests/fsm/test_system.py +361 -0
  253. yuna_engine-0.1.0/tests/fsm/test_transition.py +131 -0
  254. yuna_engine-0.1.0/tests/loop/__init__.py +0 -0
  255. yuna_engine-0.1.0/tests/loop/test_dependencies.py +493 -0
  256. yuna_engine-0.1.0/tests/loop/test_game_loop.py +656 -0
  257. yuna_engine-0.1.0/tests/loop/test_game_loop_recording.py +327 -0
  258. yuna_engine-0.1.0/tests/loop/test_job.py +256 -0
  259. yuna_engine-0.1.0/tests/loop/test_parallel.py +328 -0
  260. yuna_engine-0.1.0/tests/loop/test_scheduler.py +325 -0
  261. yuna_engine-0.1.0/tests/loop/test_time.py +200 -0
  262. yuna_engine-0.1.0/tests/modifiers/__init__.py +0 -0
  263. yuna_engine-0.1.0/tests/modifiers/test_batch.py +330 -0
  264. yuna_engine-0.1.0/tests/modifiers/test_cache.py +341 -0
  265. yuna_engine-0.1.0/tests/modifiers/test_condition_stage.py +374 -0
  266. yuna_engine-0.1.0/tests/modifiers/test_conditions.py +742 -0
  267. yuna_engine-0.1.0/tests/modifiers/test_config.py +664 -0
  268. yuna_engine-0.1.0/tests/modifiers/test_conventions.py +283 -0
  269. yuna_engine-0.1.0/tests/modifiers/test_conversions.py +257 -0
  270. yuna_engine-0.1.0/tests/modifiers/test_entity_type_clamping.py +369 -0
  271. yuna_engine-0.1.0/tests/modifiers/test_expansion_stage.py +450 -0
  272. yuna_engine-0.1.0/tests/modifiers/test_expiration.py +232 -0
  273. yuna_engine-0.1.0/tests/modifiers/test_interceptor.py +149 -0
  274. yuna_engine-0.1.0/tests/modifiers/test_modifier.py +509 -0
  275. yuna_engine-0.1.0/tests/modifiers/test_operations.py +426 -0
  276. yuna_engine-0.1.0/tests/modifiers/test_pipeline.py +596 -0
  277. yuna_engine-0.1.0/tests/modifiers/test_pipeline_with_relationships.py +412 -0
  278. yuna_engine-0.1.0/tests/modifiers/test_pipeline_with_scaling.py +394 -0
  279. yuna_engine-0.1.0/tests/modifiers/test_query.py +551 -0
  280. yuna_engine-0.1.0/tests/modifiers/test_relationship_stage.py +935 -0
  281. yuna_engine-0.1.0/tests/modifiers/test_relationships.py +212 -0
  282. yuna_engine-0.1.0/tests/modifiers/test_scaling.py +468 -0
  283. yuna_engine-0.1.0/tests/modifiers/test_scaling_stage.py +347 -0
  284. yuna_engine-0.1.0/tests/modifiers/test_stage_profiling.py +345 -0
  285. yuna_engine-0.1.0/tests/modifiers/test_stages.py +2235 -0
  286. yuna_engine-0.1.0/tests/modifiers/test_tracker.py +607 -0
  287. yuna_engine-0.1.0/tests/network/__init__.py +0 -0
  288. yuna_engine-0.1.0/tests/network/test_authority.py +43 -0
  289. yuna_engine-0.1.0/tests/network/test_budget.py +388 -0
  290. yuna_engine-0.1.0/tests/network/test_compression.py +229 -0
  291. yuna_engine-0.1.0/tests/network/test_delta.py +391 -0
  292. yuna_engine-0.1.0/tests/network/test_interest.py +652 -0
  293. yuna_engine-0.1.0/tests/network/test_priority.py +594 -0
  294. yuna_engine-0.1.0/tests/network/test_quantization.py +328 -0
  295. yuna_engine-0.1.0/tests/network/test_relevancy.py +423 -0
  296. yuna_engine-0.1.0/tests/network/test_replication.py +559 -0
  297. yuna_engine-0.1.0/tests/particles/__init__.py +0 -0
  298. yuna_engine-0.1.0/tests/particles/test_field.py +114 -0
  299. yuna_engine-0.1.0/tests/particles/test_simulation.py +617 -0
  300. yuna_engine-0.1.0/tests/physics/__init__.py +0 -0
  301. yuna_engine-0.1.0/tests/physics/test_body.py +127 -0
  302. yuna_engine-0.1.0/tests/physics/test_engine.py +459 -0
  303. yuna_engine-0.1.0/tests/physics/test_shapes.py +332 -0
  304. yuna_engine-0.1.0/tests/physics/test_system.py +182 -0
  305. yuna_engine-0.1.0/tests/pipeline/__init__.py +0 -0
  306. yuna_engine-0.1.0/tests/pipeline/test_pipeline.py +475 -0
  307. yuna_engine-0.1.0/tests/pipeline/test_registry.py +233 -0
  308. yuna_engine-0.1.0/tests/pipeline/test_stage.py +196 -0
  309. yuna_engine-0.1.0/tests/prefabs/__init__.py +0 -0
  310. yuna_engine-0.1.0/tests/prefabs/test_manager.py +436 -0
  311. yuna_engine-0.1.0/tests/prefabs/test_prefab.py +132 -0
  312. yuna_engine-0.1.0/tests/profiling/__init__.py +0 -0
  313. yuna_engine-0.1.0/tests/profiling/test_decorators.py +282 -0
  314. yuna_engine-0.1.0/tests/profiling/test_monitor.py +606 -0
  315. yuna_engine-0.1.0/tests/profiling/test_profiling_integration.py +133 -0
  316. yuna_engine-0.1.0/tests/profiling/test_stats.py +113 -0
  317. yuna_engine-0.1.0/tests/replay/__init__.py +0 -0
  318. yuna_engine-0.1.0/tests/replay/test_config.py +138 -0
  319. yuna_engine-0.1.0/tests/replay/test_controls.py +111 -0
  320. yuna_engine-0.1.0/tests/replay/test_incremental.py +1271 -0
  321. yuna_engine-0.1.0/tests/replay/test_incremental_coverage.py +144 -0
  322. yuna_engine-0.1.0/tests/replay/test_player.py +576 -0
  323. yuna_engine-0.1.0/tests/replay/test_recorder.py +1042 -0
  324. yuna_engine-0.1.0/tests/replay/test_storage.py +472 -0
  325. yuna_engine-0.1.0/tests/replay/test_storage_coverage.py +108 -0
  326. yuna_engine-0.1.0/tests/resources/__init__.py +0 -0
  327. yuna_engine-0.1.0/tests/resources/test_flyweight.py +288 -0
  328. yuna_engine-0.1.0/tests/resources/test_pool.py +340 -0
  329. yuna_engine-0.1.0/tests/resources/test_pools.py +299 -0
  330. yuna_engine-0.1.0/tests/scene/__init__.py +0 -0
  331. yuna_engine-0.1.0/tests/scene/test_chunk.py +305 -0
  332. yuna_engine-0.1.0/tests/scene/test_manager.py +306 -0
  333. yuna_engine-0.1.0/tests/scene/test_scene.py +191 -0
  334. yuna_engine-0.1.0/tests/scene/test_streaming.py +405 -0
  335. yuna_engine-0.1.0/tests/scene/test_transition.py +89 -0
  336. yuna_engine-0.1.0/tests/script/__init__.py +0 -0
  337. yuna_engine-0.1.0/tests/script/test_compiler.py +347 -0
  338. yuna_engine-0.1.0/tests/script/test_instructions.py +35 -0
  339. yuna_engine-0.1.0/tests/script/test_vm.py +584 -0
  340. yuna_engine-0.1.0/tests/services/__init__.py +0 -0
  341. yuna_engine-0.1.0/tests/services/test_lifetime.py +37 -0
  342. yuna_engine-0.1.0/tests/services/test_locator.py +322 -0
  343. yuna_engine-0.1.0/tests/services/test_provider.py +72 -0
  344. yuna_engine-0.1.0/tests/spatial/__init__.py +0 -0
  345. yuna_engine-0.1.0/tests/spatial/test_bvh.py +515 -0
  346. yuna_engine-0.1.0/tests/spatial/test_collision.py +28 -0
  347. yuna_engine-0.1.0/tests/spatial/test_factory.py +176 -0
  348. yuna_engine-0.1.0/tests/spatial/test_grid.py +1714 -0
  349. yuna_engine-0.1.0/tests/spatial/test_grid_performance.py +199 -0
  350. yuna_engine-0.1.0/tests/spatial/test_integration.py +356 -0
  351. yuna_engine-0.1.0/tests/spatial/test_quadtree.py +488 -0
  352. yuna_engine-0.1.0/tests/spatial/test_quadtree_performance.py +188 -0
  353. yuna_engine-0.1.0/tests/spatial/test_queries.py +52 -0
  354. yuna_engine-0.1.0/tests/state/__init__.py +0 -0
  355. yuna_engine-0.1.0/tests/state/test_component_registry.py +351 -0
  356. yuna_engine-0.1.0/tests/state/test_manager.py +293 -0
  357. yuna_engine-0.1.0/tests/state/test_migrations.py +610 -0
  358. yuna_engine-0.1.0/tests/state/test_serializer.py +1454 -0
  359. yuna_engine-0.1.0/tests/state/test_serializers.py +249 -0
  360. yuna_engine-0.1.0/tests/state/test_snapshot.py +151 -0
  361. yuna_engine-0.1.0/tests/state/test_versioning.py +379 -0
  362. yuna_engine-0.1.0/tests/test_deprecation.py +356 -0
  363. yuna_engine-0.1.0/tests/test_exceptions.py +665 -0
  364. yuna_engine-0.1.0/tests/test_integration.py +542 -0
  365. yuna_engine-0.1.0/tests/test_performance.py +304 -0
  366. yuna_engine-0.1.0/tests/types/__init__.py +0 -0
  367. yuna_engine-0.1.0/tests/types/test_bounds.py +242 -0
  368. yuna_engine-0.1.0/tests/types/test_identifiers.py +92 -0
  369. yuna_engine-0.1.0/tests/types/test_registry.py +316 -0
  370. yuna_engine-0.1.0/tests/types/test_type_object.py +100 -0
  371. yuna_engine-0.1.0/tests/types/test_vector.py +158 -0
  372. yuna_engine-0.1.0/uv.lock +685 -0
@@ -0,0 +1,27 @@
1
+ name: CI
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+
8
+ jobs:
9
+ quality-gate:
10
+ name: Lint, Type Check, Test (100% coverage)
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v7
14
+
15
+ - name: Install uv
16
+ uses: astral-sh/setup-uv@v10.0.1
17
+ with:
18
+ python-version: "3.14"
19
+
20
+ - name: Sync dependencies
21
+ run: uv sync
22
+
23
+ - name: Lint
24
+ run: uv run pre-commit run --all-files --show-diff-on-failure
25
+
26
+ - name: Run tests
27
+ run: uv run pytest tests --cov=yuna --cov-report=term-missing --cov-fail-under=100
@@ -0,0 +1,33 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ permissions:
8
+ contents: write
9
+ id-token: write
10
+
11
+ jobs:
12
+ release:
13
+ runs-on: ubuntu-latest
14
+ environment: pypi
15
+ steps:
16
+ - uses: actions/checkout@v7
17
+
18
+ - name: Install uv
19
+ uses: astral-sh/setup-uv@v10.0.1
20
+ with:
21
+ python-version: "3.14"
22
+
23
+ - name: Build sdist and wheel
24
+ run: uv build
25
+
26
+ - name: Publish to PyPI
27
+ run: uv publish
28
+
29
+ - name: Create GitHub Release
30
+ uses: softprops/action-gh-release@v3
31
+ with:
32
+ files: dist/*
33
+ generate_release_notes: true
@@ -0,0 +1,221 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+ # Temporary file for partial code execution
204
+ tempCodeRunnerFile.py
205
+
206
+ # Ruff stuff:
207
+ .ruff_cache/
208
+
209
+ # PyPI configuration file
210
+ .pypirc
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
216
+
217
+ # Streamlit
218
+ .streamlit/secrets.toml
219
+
220
+ # JetBrains IDEs
221
+ .idea/
@@ -0,0 +1,46 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v6.0.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-added-large-files
9
+ exclude: uv.lock
10
+ - id: check-json
11
+ - id: check-toml
12
+ - id: check-merge-conflict
13
+ - id: debug-statements
14
+ - id: mixed-line-ending
15
+
16
+ - repo: https://github.com/astral-sh/ruff-pre-commit
17
+ rev: v0.16.5
18
+ hooks:
19
+ - id: ruff
20
+ args: [--fix, --exit-non-zero-on-fix]
21
+ - id: ruff-format
22
+
23
+ - repo: https://github.com/pycqa/isort
24
+ rev: 9.0.1
25
+ hooks:
26
+ - id: isort
27
+ args: [--profile, black]
28
+
29
+ # Run mypy inside the project's uv env so it resolves the installed package
30
+ # and its dependencies. mirrors-mypy runs in an isolated env that can't see
31
+ # them, which turns every unresolved import into `Any` and produces hundreds
32
+ # of false `no-any-return` / `unused-ignore` errors.
33
+ - repo: local
34
+ hooks:
35
+ - id: mypy
36
+ name: mypy
37
+ entry: uv run mypy -p yuna -p tests
38
+ language: system
39
+ types: [python]
40
+ pass_filenames: false
41
+
42
+ - repo: https://github.com/lk16/detect-missing-init
43
+ rev: v0.1.6
44
+ hooks:
45
+ - id: detect-missing-init
46
+ args: ['--create', '--track', '--python-folders', 'src,tests']
@@ -0,0 +1 @@
1
+ 3.14
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Eduardo A. Garcia
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,124 @@
1
+ Metadata-Version: 2.5
2
+ Name: yuna-engine
3
+ Version: 0.1.0
4
+ Summary: A fast, dependency-light ECS game engine for Python.
5
+ Project-URL: Repository, https://github.com/eduardoagarcia/yuna
6
+ Author-email: "Eduardo A. Garcia" <eduardo@helloyuna.ai>
7
+ License-Expression: MIT
8
+ License-File: LICENSE
9
+ Keywords: ecs,entity-component-system,game-engine,gamedev
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.14
15
+ Classifier: Topic :: Games/Entertainment
16
+ Classifier: Topic :: Software Development :: Libraries
17
+ Requires-Python: >=3.14
18
+ Requires-Dist: lz4
19
+ Requires-Dist: pyyaml
20
+ Description-Content-Type: text/markdown
21
+
22
+ <div align="center">
23
+
24
+ <img src="assets/yuna.svg" alt="Yuna" width="160" />
25
+
26
+ # Yuna Python Game Engine
27
+
28
+ Fast, dependency-light ECS game engine for Python.
29
+
30
+ </div>
31
+
32
+ ## Features
33
+
34
+ - **AI**: behavior trees, blackboards, pathfinding, perception, and steering for game agents.
35
+ - **Commands**: a command pattern with validation, permissions, macros, and undoable results.
36
+ - **Config**: data-driven schemas, formula patterns, and validators for tunable game data.
37
+ - **ECS**: an archetype-backed Entity Component System with fast component queries.
38
+ - **Events**: an event bus with dispatching, queuing, filtering, and consumption control.
39
+ - **FSM**: finite state machines with states, transitions, and a driving system.
40
+ - **Game loop**: a fixed-timestep loop with an accumulator and dependency-aware scheduling.
41
+ - **Modifiers**: a staged pipeline for stacking, scaling, and expiring stat modifiers.
42
+ - **Networking**: state replication with authority, delta compression, and interest management.
43
+ - **Particles**: a pure particle simulation with world-level fields for short-lived effects.
44
+ - **Physics**: a 2D physics engine with rigid bodies, shapes, and a stepping system.
45
+ - **Prefabs**: reusable entity templates instantiated into any world.
46
+ - **Profiling**: a performance monitor with per-system stats and timing decorators.
47
+ - **Replay**: deterministic recording and playback with incremental snapshots.
48
+ - **Resources**: object pooling and flyweight sharing to cut allocation churn.
49
+ - **Scene**: chunked scene streaming with transitions for large or open worlds.
50
+ - **Scripting**: a compact bytecode compiler and VM for in-game scripts.
51
+ - **Services**: a service locator with provider registration and lifetime control.
52
+ - **Spatial**: spatial partitioning via grids, quadtrees, and BVH for fast collision queries.
53
+ - **State**: snapshotting, serialization, versioning, and migrations for save/load.
54
+
55
+ ### Optional native acceleration
56
+
57
+ `SpatialGrid` and `SpatialSystem` accept `native_raycast=True`, which routes
58
+ raycasts through an optional `engine_native` extension module when one is
59
+ installed. Yuna does not ship this module: without it the flag is inert and
60
+ raycasts use the pure-Python path, which is the reference implementation and
61
+ behaviorally identical. Games that need faster raycasts can provide their own
62
+ `engine_native` package exposing a compatible `SpatialIndex`.
63
+
64
+ ## Install
65
+
66
+ ```bash
67
+ uv add yuna-engine
68
+ ```
69
+
70
+ ## Quick start
71
+
72
+ One entity, two components, one system. A star falls under gravity:
73
+
74
+ ```python
75
+ from dataclasses import dataclass
76
+
77
+ from yuna import Component, ECSWorld, System
78
+
79
+
80
+ @dataclass
81
+ class Position(Component):
82
+ x: float
83
+ y: float
84
+
85
+
86
+ @dataclass
87
+ class Velocity(Component):
88
+ dx: float
89
+ dy: float
90
+
91
+
92
+ class GravitySystem(System):
93
+ @property
94
+ def priority(self) -> int:
95
+ return 100
96
+
97
+ def update(self, world: ECSWorld, delta_time: float) -> None:
98
+ for _entity, (pos, vel) in (
99
+ world.query().with_components(Position, Velocity).iterator()
100
+ ):
101
+ vel.dy += 9.8 * delta_time
102
+ pos.x += vel.dx * delta_time
103
+ pos.y += vel.dy * delta_time
104
+
105
+
106
+ world = ECSWorld()
107
+ world.register_system(system=GravitySystem())
108
+
109
+ star = world.create_entity()
110
+ world.add_component(entity_id=star, component=Position(x=0.0, y=100.0))
111
+ world.add_component(entity_id=star, component=Velocity(dx=0.0, dy=0.0))
112
+
113
+ for _ in range(60):
114
+ world.update(delta_time=1 / 60)
115
+
116
+ pos = world.get_component(entity_id=star, component_type=Position)
117
+ print(pos.x, pos.y) # print position
118
+ ```
119
+
120
+ Sixty ticks is one second at 60 fps. The star falls ~5 units, to `y≈105`.
121
+
122
+ ## License
123
+
124
+ MIT. See [`LICENSE`](LICENSE).
@@ -0,0 +1,103 @@
1
+ <div align="center">
2
+
3
+ <img src="assets/yuna.svg" alt="Yuna" width="160" />
4
+
5
+ # Yuna Python Game Engine
6
+
7
+ Fast, dependency-light ECS game engine for Python.
8
+
9
+ </div>
10
+
11
+ ## Features
12
+
13
+ - **AI**: behavior trees, blackboards, pathfinding, perception, and steering for game agents.
14
+ - **Commands**: a command pattern with validation, permissions, macros, and undoable results.
15
+ - **Config**: data-driven schemas, formula patterns, and validators for tunable game data.
16
+ - **ECS**: an archetype-backed Entity Component System with fast component queries.
17
+ - **Events**: an event bus with dispatching, queuing, filtering, and consumption control.
18
+ - **FSM**: finite state machines with states, transitions, and a driving system.
19
+ - **Game loop**: a fixed-timestep loop with an accumulator and dependency-aware scheduling.
20
+ - **Modifiers**: a staged pipeline for stacking, scaling, and expiring stat modifiers.
21
+ - **Networking**: state replication with authority, delta compression, and interest management.
22
+ - **Particles**: a pure particle simulation with world-level fields for short-lived effects.
23
+ - **Physics**: a 2D physics engine with rigid bodies, shapes, and a stepping system.
24
+ - **Prefabs**: reusable entity templates instantiated into any world.
25
+ - **Profiling**: a performance monitor with per-system stats and timing decorators.
26
+ - **Replay**: deterministic recording and playback with incremental snapshots.
27
+ - **Resources**: object pooling and flyweight sharing to cut allocation churn.
28
+ - **Scene**: chunked scene streaming with transitions for large or open worlds.
29
+ - **Scripting**: a compact bytecode compiler and VM for in-game scripts.
30
+ - **Services**: a service locator with provider registration and lifetime control.
31
+ - **Spatial**: spatial partitioning via grids, quadtrees, and BVH for fast collision queries.
32
+ - **State**: snapshotting, serialization, versioning, and migrations for save/load.
33
+
34
+ ### Optional native acceleration
35
+
36
+ `SpatialGrid` and `SpatialSystem` accept `native_raycast=True`, which routes
37
+ raycasts through an optional `engine_native` extension module when one is
38
+ installed. Yuna does not ship this module: without it the flag is inert and
39
+ raycasts use the pure-Python path, which is the reference implementation and
40
+ behaviorally identical. Games that need faster raycasts can provide their own
41
+ `engine_native` package exposing a compatible `SpatialIndex`.
42
+
43
+ ## Install
44
+
45
+ ```bash
46
+ uv add yuna-engine
47
+ ```
48
+
49
+ ## Quick start
50
+
51
+ One entity, two components, one system. A star falls under gravity:
52
+
53
+ ```python
54
+ from dataclasses import dataclass
55
+
56
+ from yuna import Component, ECSWorld, System
57
+
58
+
59
+ @dataclass
60
+ class Position(Component):
61
+ x: float
62
+ y: float
63
+
64
+
65
+ @dataclass
66
+ class Velocity(Component):
67
+ dx: float
68
+ dy: float
69
+
70
+
71
+ class GravitySystem(System):
72
+ @property
73
+ def priority(self) -> int:
74
+ return 100
75
+
76
+ def update(self, world: ECSWorld, delta_time: float) -> None:
77
+ for _entity, (pos, vel) in (
78
+ world.query().with_components(Position, Velocity).iterator()
79
+ ):
80
+ vel.dy += 9.8 * delta_time
81
+ pos.x += vel.dx * delta_time
82
+ pos.y += vel.dy * delta_time
83
+
84
+
85
+ world = ECSWorld()
86
+ world.register_system(system=GravitySystem())
87
+
88
+ star = world.create_entity()
89
+ world.add_component(entity_id=star, component=Position(x=0.0, y=100.0))
90
+ world.add_component(entity_id=star, component=Velocity(dx=0.0, dy=0.0))
91
+
92
+ for _ in range(60):
93
+ world.update(delta_time=1 / 60)
94
+
95
+ pos = world.get_component(entity_id=star, component_type=Position)
96
+ print(pos.x, pos.y) # print position
97
+ ```
98
+
99
+ Sixty ticks is one second at 60 fps. The star falls ~5 units, to `y≈105`.
100
+
101
+ ## License
102
+
103
+ MIT. See [`LICENSE`](LICENSE).
@@ -0,0 +1,10 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="120" height="95" viewBox="150 230 780 620" fill="#6366f1">
2
+ <path stroke="#6366f1" stroke-miterlimit="10" stroke-width="11.48" d="M911.26,270.94v496.16h-49.94c.21-8.08-2.3-16.12-7.12-22.74-9.84-13.53-29.96-31.99-64.26-26.17h-.02c-.65.11-.11-1.47-.23-2.81-3.31-34.8-8.38-78.77-26.82-113.87-3.06-5.86-4.25-12.48-3.43-19.05,7.64-61.08,38.07-359.9-132.78-130.64-5.47,7.35-15.12,10.22-23.7,7.02-40.52-15.18-85.31-14.91-125.93.31-8.59,3.2-18.22.33-23.7-7.02-170.86-229.26-140.44,69.56-132.78,130.64.82,6.57-.36,13.19-3.45,19.05-18.41,35.11-23.49,79.09-26.8,113.87-.13,1.32.4,2.93-.25,2.81h-.02c-34.28-5.82-54.4,12.63-64.26,26.17-4.77,6.55-7.27,14.47-7.1,22.43h-49.94v-496.16c0-17.91,14.52-32.43,32.43-32.43h677.66c17.91,0,32.43,14.52,32.43,32.43Z" />
3
+ <path fill="none" stroke="#6366f1" stroke-miterlimit="10" stroke-width="11.42" d="M335.5,832.41c-27.12,24.55-104.59-7.74-116.07-58.49-.52-2.29-.78-4.64-.82-6.99-.17-7.87,2.34-15.71,7.1-22.19,9.86-13.38,29.98-31.63,64.26-25.88h.02c.65.11,1.28.23,1.91.36,24.65,4.98,42.51,25.14,51.11,47.7,9.32,24.4,7.87,51.6-7.5,65.48Z" />
4
+ <path fill="none" stroke="#6366f1" stroke-miterlimit="10" stroke-width="11.48" d="M861.71,767.11c-.06,2.26-.33,4.52-.82,6.76-11.48,51.32-88.97,83.95-116.09,59.15-15.31-13.97-16.81-41.31-7.62-65.9.04-.1.08-.21.11-.31,8.59-22.82,26.45-43.2,51.11-48.24.63-.13,1.26-.25,1.91-.36h.02c34.3-5.82,54.42,12.63,64.26,26.17,4.82,6.62,7.33,14.66,7.12,22.74Z" />
5
+ <ellipse cx="443.44" cy="682.33" rx="16.74" ry="46.49" />
6
+ <ellipse cx="639.79" cy="682.33" rx="16.74" ry="46.49" />
7
+ <path fill="none" stroke="#6366f1" stroke-linecap="round" stroke-miterlimit="10" stroke-width="11.24" d="M509.31,781.25c18.85,19.3,32.92,0,32.92,0" />
8
+ <path fill="none" stroke="#6366f1" stroke-linecap="round" stroke-miterlimit="10" stroke-width="11.24" d="M543.07,781.25c18.85,19.3,32.92,0,32.92,0" />
9
+ <path d="M540.45,778.3l-11.96-20.71c-1.17-2.02.29-4.54,2.62-4.54h23.91c2.33,0,3.79,2.52,2.62,4.54l-11.96,20.71c-1.17,2.02-4.08,2.02-5.24,0Z" />
10
+ </svg>
@@ -0,0 +1,109 @@
1
+ [project]
2
+ name = "yuna-engine"
3
+ version = "0.1.0"
4
+ description = "A fast, dependency-light ECS game engine for Python."
5
+ readme = "README.md"
6
+ requires-python = ">=3.14"
7
+ license = "MIT"
8
+ license-files = ["LICENSE"]
9
+ authors = [{ name = "Eduardo A. Garcia", email = "eduardo@helloyuna.ai" }]
10
+ keywords = ["game-engine", "ecs", "gamedev", "entity-component-system"]
11
+ dependencies = [
12
+ "lz4",
13
+ "PyYAML",
14
+ ]
15
+ classifiers = [
16
+ "Development Status :: 4 - Beta",
17
+ "Intended Audience :: Developers",
18
+ "License :: OSI Approved :: MIT License",
19
+ "Programming Language :: Python :: 3",
20
+ "Programming Language :: Python :: 3.14",
21
+ "Topic :: Games/Entertainment",
22
+ "Topic :: Software Development :: Libraries",
23
+ ]
24
+
25
+ [project.urls]
26
+ Repository = "https://github.com/eduardoagarcia/yuna"
27
+
28
+ [build-system]
29
+ requires = ["hatchling"]
30
+ build-backend = "hatchling.build"
31
+
32
+ [tool.hatch.build.targets.wheel]
33
+ packages = ["src/yuna"]
34
+
35
+ [dependency-groups]
36
+ dev = [
37
+ "pytest>=8.4",
38
+ "pytest-asyncio>=1.1",
39
+ "pytest-cov>=6.3",
40
+ "faker>=37.6",
41
+ "msgpack>=1.1",
42
+ "ruff>=0.12",
43
+ "mypy>=2.3",
44
+ "isort>=6.0",
45
+ "pre-commit>=4.3",
46
+ "types-PyYAML",
47
+ ]
48
+
49
+ [tool.pytest.ini_options]
50
+ addopts = "-v -W ignore::DeprecationWarning -W ignore::UserWarning"
51
+ testpaths = ["tests"]
52
+ asyncio_mode = "auto"
53
+
54
+ [tool.coverage.report]
55
+ fail_under = 100
56
+ exclude_lines = [
57
+ "pragma: no cover",
58
+ "if TYPE_CHECKING:",
59
+ "^\\s*\\.\\.\\.$",
60
+ ]
61
+
62
+ [tool.coverage.run]
63
+ omit = [
64
+ "*/tests/*",
65
+ "*/test_*.py",
66
+ ]
67
+
68
+ [tool.ruff]
69
+ line-length = 88
70
+ target-version = "py314"
71
+ preview = true
72
+ exclude = [".git", "__pycache__", ".venv", "venv", "build", "dist"]
73
+
74
+ [tool.ruff.lint]
75
+ select = ["E", "W", "F", "B", "C4", "UP", "PLC", "PLR", "A"]
76
+ ignore = [
77
+ "I",
78
+ "PLR0913",
79
+ "PLR0912",
80
+ "PLR0915",
81
+ "PLR0904",
82
+ "PLR0911",
83
+ "PLR6301",
84
+ ]
85
+
86
+ [tool.ruff.lint.pylint]
87
+ allow-magic-value-types = ["int", "str", "bytes"]
88
+ max-args = 10
89
+
90
+ [tool.ruff.lint.per-file-ignores]
91
+ "tests/**/*.py" = ["PLR2004", "PLR6301", "A"]
92
+
93
+ [tool.isort]
94
+ profile = "black"
95
+ line_length = 88
96
+ known_first_party = ["yuna"]
97
+
98
+ [tool.mypy]
99
+ python_version = "3.14"
100
+ warn_redundant_casts = true
101
+ warn_unused_ignores = true
102
+ warn_return_any = true
103
+ warn_unreachable = true
104
+ check_untyped_defs = true
105
+ no_implicit_optional = true
106
+
107
+ [[tool.mypy.overrides]]
108
+ module = ["lz4.*", "engine_native", "msgpack.*"]
109
+ ignore_missing_imports = true