github.com• Jun 12, 2026• 1 min read
Show HN: MicroECS – entity component system library in Python/NumPyHi, in the last ~month I've learned a lot about ECS [1,2].I'm currently developing a robotics simulator from scratch (python+raylib) and, due to lack of game dev experience I went "full OOP" on it. A SceneObject with a lot of inherited interfaces (e.g. Collidable, Movable etc.). These are inherited and fixed at run time.The main loop inevitably became: for scene_object in sim.scene_objects: scene_object.update(...) for scene_object in sim.scene_objects: scene_object.draw(...) Well, it turns out that this can become a bottleneck if you have many scene objects because computers love contiguous memory for caching, physics/math vectorization and so on.Having recently learned more about ECS[1,2], I started doing a bunch of experiments in a sandbox with turning the update() function into ECS. The idea is that the data is stored in columnar numpy arrays (components) + a lot of data structure optimizations for querying scene objects and fast access e.g. qr = scene.query(HasMotion, HasPosition)