Awesome, you’re welcome :)
Andrew
Creator of
Recent community posts
I think you’re describing an array of structures, and you’re one step away from greatly increasing the performance — if you just reverse the storage and have a struct of arrays with the same semantics, the whole thing would be much more cache friendly (unless, of course, there is value boxing in play, which could be avoided at least for some values in Common Lisp, but is generally a PITA for performance).
The comparison of the syntax for defintions also might be fruitful, I still haven’t figured the perfect way to define entities, components and systems in code. Here’s how your example will look using my library now:
(ecs:bind-storage)
;; provided myentity, position and sprite components are defined elsewhere
(ecs:make-object `((:myentity) (:position :x 1 :y 1) (:sprite "path/to/sprite")))
(defsystem render
(:components-ro (position sprite))
(draw-sprite :x position-x :y position-y sprite-path))
Note how in defsystem
macro I just write the body of code to process the single entity with no looping logic (it is kinda embeeded into macro itself). I also use quasiqoute to build an object spec to be passed to make-object
(kinda similar to your create-world
, but for single object). I can’t remember, does Scheme has quasiquoting?
cannot query on component values
This is correct for most of ECS implementations there are, but I went ahead and implemented hashtable-based indices in my library, akin to the ones in relational databases. They allow to answer the question “which entity or entities has this specific value as this component’ slot?” I think it might come in handy in implementing things like entity names or prefabs. I’m already using those to e.g. distinguish different images in texture atlas: https://github.com/lockie/mana-break/blob/0.0.1/src/atlas.lisp#L13-L18
I loved the minimalistic interface and the “next wave” pseudographics. It was also easy to run, I only had to symlink Chez binary I have installed with the name “scheme”.
I wonder if you’ve used any tools to measure cache hit efficiency by your ECS library? I reckon I’ve seen such tools (even in Valgrind suite), but haven’t used them yet myself.
Hi! I just wanted to share a tutorial I just published that goes into detail of developing a videogame using Common Lisp, liballegro and ECS framework of my own, cl-fast-ecs. Here it is: https://awkravchuk.itch.io/cl-fast-ecs/devlog/622054/gamedev-in-lisp-part-1-ecs-and-metalinguistic-abstraction.
Let me know if you have any questions or suggestions 😊
Hey David! The link to readme gives me 404. This one does not: https://git.dthompson.us/chickadee-game-template/tree/README.md?h=main
The idea sounds amazing, but unfortunately I can’t get past maintbot who just writes and has just a few commands about some ticket. /LIST
does not do anything, /JOIN
asks for channel name, random text just gets me “No target” reply. Tried both ERC and KVIrc to no avail. Perhaps having a few n00b pointers in MOTD might help (or perhaps it is my IRC skills that are way too rusty 😅)
Such an interesting project, I love interacting with those entities :) I only hope there were more locations than just lobby, cafe and arcade.
Oh, and in the fancy terminal I wasn’t able to see what I type, but the fallback terminal is even better.
By the way, the game binary run with no problems at all, I guess I should finally make myself learn some Guix package management to also effortlessly deploy stuff :)