Entity Component Message architecture a la Caves of Qud

27 releases (11 breaking)

0.12.1 Aug 20, 2023
0.12.0 Jul 25, 2023
0.11.1 Jul 18, 2023
0.10.0 Jan 19, 2023
0.3.0 Jul 25, 2022

#392 in Game dev

Download history 4/week @ 2023-05-11 2/week @ 2023-05-18 23/week @ 2023-05-25 5/week @ 2023-06-01 2/week @ 2023-06-08 32/week @ 2023-06-15 6/week @ 2023-06-22 53/week @ 2023-06-29 12/week @ 2023-07-06 37/week @ 2023-07-13 42/week @ 2023-07-20 17/week @ 2023-07-27 3/week @ 2023-08-03 11/week @ 2023-08-10 49/week @ 2023-08-17 35/week @ 2023-08-24

99 downloads per month
Used in dialga

MIT license

2.5K SLoC


An Entity-Component-Message architecture crate.

What's an Entity-Component-Message architecture?

Here's an excert from the blog post I wrote on it:

Like in ECS, under ECM you have entities, which are lists of components. But, instead of linking behavior of different components with systems, you do it by passing messages.

When you implement Component for a struct, you implement a method that registers that struct with different message types. Then, from a message handler, you can fire messages to other entities.

When an entity gets a message, it runs through its components in order, and if that component type registers a handler for that message type, it runs the handler and passes the updated value to the next component, and so on … and then finally returns the modified message to the caller.

And there’s a method on World to pass a message to all entities, as your entrypoint.

Check out the tests or examples for more, I guess.


  • serde enables "convenient," "easy-to-use" wrappers for serializing and deserializing worlds. (Disabled by default.)

... and possibly more to follow.

Why is it called Palkia?

I've been naming the helper crates for Foxfire after Pokemon, just because there's a lot of them and I don't want to spend tons of time coming up with names. I picked Palkia specifically because the crate provides a method of organizing data, and Palkia controls space.

This crate is built alongside and for my W.I.P. roguelike Foxfire.


~73K SLoC