Fork me on GitHub
#clojure-gamedev
<
2023-10-09
>
pfeodrippe02:10:54

I have been experimenting with a ECS library called https://www.flecs.dev/flecs/ and I can just say that it has lots of interesting concepts, recommend to take a look. I am working on a very simple UI game with it and it has been fun. Will OSS the lib (using libgdx just for rendering and some other game stuff, but most of it will be focused on Flecs) when I have it in a more functional state (patterns and some questions answered). In the video, you can see it in action (using Portal), I’m also posting some of the actual code (mutation is the king here, so there are some macros to work with Flecs pointers (Flecs is a C lib)), but things will be evolving… slowly, but evolving (I’m not a game dev myself). https://youtu.be/s4ZvwOsqW9Q?si=Ywt4IAMUOIAl0kC5

🙏 2
👀 3
1
zane16:10:37

Thanks for sharing!

zane16:10:21

Would be very cool if the ECS code could be completely separate from the rendering code. That way one could bring one’s own rendering library.

pfeodrippe16:10:40

They are! Things related to ECS are in their own namespaces, the game helper namespaces (for rendering and additional systems) may depend on it, but they could be in a totally different clojar artifact o/

🎉 1
Casey08:10:42

this looks really cool @U5R6XUARE do you have any example code available?

pfeodrippe12:10:08

@U70QFSCG2 Guess I can clean up some stuff in the next weeks to OSS it in a WIP form, not ideal, but then people could also experiment with and do whatever they want (MIT-licensed)

mx200013:12:28

Why are you using flecs for a simple gui based gameplay instead of plain clojure maps (& atoms)? As I understand flecs is useful when having to update a large amount of entities in real-time

pfeodrippe14:12:04

As a non-professional gamedev, I’m more interested in learning the paradigm as Flecs has features that other libs/framework (ECS in Unity or Bevy) don’t have yet. Flecs’s approach is being useful to me in organizing the code so I can use RDD in its fullness. In case I need performance for this or another project, won’t need to learn yet-another-lib-or-framework

pfeodrippe14:12:48

Before Flecs, I tried https://github.com/dominion-dev/dominion-ecs-java, which is much much inferior to Flecs

mx200014:12:21

What is RDD?

pfeodrippe14:12:37

Repl Driven Development

pfeodrippe14:12:02

As Flecs is very dynamic, RDD works pretty well with it

mx200014:12:11

Can you share your github? It might be interesting to see how you integrated flecs.

pfeodrippe14:12:04

Yes yes, I can, I was changing jobs, so didn’t have much time to do it until now, guess I can have some mess pubic until tomorrow if you want to check out o/

mx200014:12:04

cool 🙂 It does not matter if mess

😅 1
mx200014:12:14

Although I'm quite busy with my game and using plain atoms and maps works fine so far so it's not so urgent

pfeodrippe19:01:06

Let me know if you are unable to run it, after running my own README instructions, I have been able to run it on another Mac

pfeodrippe19:01:46

The "game" (and main file of interest as you can see the Vybe API (name inspired by Bevy) being used) is at https://github.com/pfeodrippe/vybe-wip/blob/master/src/pfeodrippe/healthcare.clj

mx200022:01:36

Wow that looks really crazy did you do a lot of interior work?

pfeodrippe22:01:59

What’s interior work?

pfeodrippe22:01:44

The one system = one function approach comes from https://bevyengine.org/

phronmophobic17:01:47

Just reading through https://bevy-cheatbook.github.io/. It's really neat! It's the kind of thing I wish was available for doing regular UI programming.

1