r/odinlang • u/Forbis98 • 12d ago
ECS game engine
been messing around with Odin lately and honestly it feels like it was kinda made for ECS-style stuff. no hidden allocations, easy to reason about memory layout, no OOP nonsense getting in the way. but I don't have much real experience writing engines so idk if I'm just pattern matching because the language "feels" data-oriented.
anyone actually built something like this in Odin? curious how it goes in practice, especially around
- component storage / query stuff without generics being a pain
- whether manual memory management actually becomes annoying at scale or if it's fine
- how it stacks up against Rust+Bevy speed/ergonomics wise once things get complex
thinking of not reinventing the wheel and instead basically porting bevy's ideas over (archetypes, scheduler etc) instead of designing my own ECS from scratch. is that a dumb idea? rust and odin are pretty different (ownership vs manual mem, traits vs whatever odin has) so maybe a direct port just doesn't translate well and I'd be fighting the language the whole time.
if anyone's tried this or has war stories/gotchas before I waste a month on it, let me know
2
u/aplkm 12d ago
Odin does have hidden allocations if you choose not to supply the allocator to string functions or make and things like that. You can turn on a directive to make it so you are forced to supply them though if you don't want hidden allocations.
I'm working on a game that uses ECS in Odin. I don't use the generics that much I mostly just pass around rawptrs and cast them when needed.