clojure-gamedev

pfeodrippe 2023-10-09T02:06:54.900019Z

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

👀 3
🙏 2
🙏🏼 1
2023-12-30T13:51:28.959099Z

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

pfeodrippe 2023-12-30T14:01:04.957619Z

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

pfeodrippe 2023-12-30T14:04:48.025569Z

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

2023-12-30T14:17:21.461719Z

What is RDD?

pfeodrippe 2023-12-30T14:17:37.402699Z

Repl Driven Development

pfeodrippe 2023-12-30T14:18:02.693229Z

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

2023-12-30T14:18:11.615389Z

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

pfeodrippe 2023-12-30T14:20:04.692109Z

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/

2023-12-30T14:21:04.874309Z

cool 🙂 It does not matter if mess

😅 1
2023-12-30T14:25:14.669389Z

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

Casey 2023-10-17T08:40:42.674499Z

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

pfeodrippe 2023-10-17T12:33:08.502019Z

@ramblurr 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)

phronmophobic 2024-01-02T17:27:47.842349Z

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
zane 2023-10-09T16:29:37.406039Z

Thanks for sharing!

zane 2023-10-09T16:30:21.421919Z

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.

pfeodrippe 2023-10-09T16:39:40.540339Z

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
pfeodrippe 2024-01-01T19:20:27.202169Z

You can see the chaos at https://github.com/pfeodrippe/vybe-wip \o HNY!

pfeodrippe 2024-01-01T19:22:06.176229Z

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

pfeodrippe 2024-01-01T19:25:46.564979Z

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

2024-01-01T22:40:36.054959Z

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

pfeodrippe 2024-01-01T22:40:59.845689Z

What’s interior work?

pfeodrippe 2024-01-01T22:42:44.054079Z

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