clojure-gamedev

Daniel Gerson 2024-10-20T22:37:04.809719Z

@pfeodrippe Vibe is super cool. Thought I'd see if I could get some gamepad inputs monitoring and it worked โœจOf course I immediately ran into my first issue ๐Ÿ˜…. The gamepad inputs seems to have a hard coded deadzone. Is this something that forces a raylib recompile? https://github.com/raysan5/raylib/blob/master/src/external/RGFW.h#L5665 How do I handle it?

pfeodrippe 2024-10-20T23:04:47.376339Z

Thanks o/ Yeah, it would require a recompilation. Which OS do you use? As you may try it locally first by cloning vybe and running the jextract script in the bin folder. Vybe has GitHub actions jobs setup to compile everything automatically, so you can see the dependencies needed, but it should be basically be zig and jextract, let me know o/

pfeodrippe 2024-10-20T23:05:34.467569Z

Then, you can point the Deps to your local vybe as the commented out :local/root at https://github.com/pfeodrippe/vybe-games/blob/main/deps.edn#L24

pfeodrippe 2024-10-20T23:14:17.165129Z

You can also try some Java or clj libs like https://github.com/williamahartman/Jamepad if needed, in Java the APIs are much better than in C when you need to change some default ahahahaah

Daniel Gerson 2024-10-20T23:45:46.706999Z

Whoops, misspelled Vybe ๐Ÿ˜… . Gonna take me a while. Thanks for confirming. I think I'm going to open up a feature request for Raylib. This won't just affect Vybe but also JS and Python bindings. Moreover, in FPSs it should be up to the user, not the designer to set their deadzone. Likewise for users with old drifty controllers. Therefore I think it's a fundamental flaw of Raylib. In the meantime I can live with it ๐Ÿ˜ฌ. If it comes to that I'll local/root it as you say and recompile.

pfeodrippe 2024-10-20T23:50:37.844739Z

Nice, let me know of anything \o The local build process should be straightforwards (as you should need to call only the jextract-libs.sh script and then start the game), you can also let GH actions do it for you and deploy to clojars lol

๐Ÿ˜€ 1
๐Ÿ™ 1
Daniel Gerson 2024-10-22T13:00:26.790499Z

For reference https://github.com/raysan5/raylib/issues/4405. hehe

pfeodrippe 2024-10-22T13:51:25.652579Z

Nice, thanks! They want to add more #define tags ahahahaha well, we can create our own raylib fork (which we already do anyway in vybe) and do the more flexible approach if they donโ€™t

Daniel Gerson 2024-10-23T11:09:45.843549Z

Probably not a consideration for you, but I just thought to make you aware of https://pub.dev/documentation/raylib/latest/ . If Vybe's API could mindfully keep in sync/wrap/re-implement with something that could run on ClojureDart, you'd have a seemless path for mobile game development. Obviously stuff like Panama and other JVM based APIs would be out. Yes Raylib doesn't run on iOS at the moment... but there is Vulkan and SDL2 work being done.

pfeodrippe 2024-10-23T12:09:04.784829Z

Nice! Yeah, this is another world, for sure. If I had to do this, I guess I would try to use something lower-level like Zig (Iโ€™m writing a flecs wrapper similar to the Clojure API for it at https://github.com/pfeodrippe/vybe/blob/develop/zig_src/vybe/flecs.zig#L973). The idea, in the future, is that we can generate zig code and dynamically compile it for a systemโ€ฆ but it will take a while ahahaha Another alternative is to compile it down to wasm, which should be run in every foreseeable consumer device

pfeodrippe 2024-10-23T12:10:48.022669Z

Re: the deadzone, I can commit the fix into our fork, so you can have it working properly

๐Ÿ™Œ 1
pfeodrippe 2024-10-23T12:26:54.959319Z

I am not a professional gamedev, so take everything I say with a grain of salt ahahaha

Daniel Gerson 2024-10-23T13:05:36.208439Z

I'm not completely understanding the Zig angle. Wouldn't that sacrifice live coding?

pfeodrippe 2024-10-23T13:07:04.608549Z

This is for when you have a well-defined system and you need some extra performance. And, in theory, you can also hot reload the zig code itself as itโ€™s just a DLL for the JVM, but this hot reloading is for the far future if needed

๐Ÿ‘ 1
pfeodrippe 2024-10-23T13:07:44.704459Z

When you are testing things out, do it in CLJ, yes o/

Daniel Gerson 2024-10-23T13:07:52.676819Z

Yeah completely get rewriting stable bits of the system in some lower level language.

Daniel Gerson 2024-10-23T13:08:14.241389Z

It's not where I want to live though ๐Ÿ™‚

pfeodrippe 2024-10-23T13:09:04.215209Z

Me neither ahahahah let the application tell you when needed o/ Optimizing early , specially for a game, is a sure way to make very slow progress

pfeodrippe 2024-10-23T13:09:25.902149Z

*optimizing early

Daniel Gerson 2024-10-23T13:09:50.035029Z

Love that the original Bandikoot was written in a bespoke Lisp with live coding!!! ๐ŸฆŠ

pfeodrippe 2024-10-23T13:10:46.174549Z

Wow nice, didnโ€™t know that

Daniel Gerson 2024-10-23T13:15:52.758249Z

Andy Gavin is a hero! Naughty Dog would still be a Lisp shop if he hadn't sold it to Sony. Link to timestamp but the whole interview is great https://youtu.be/pSHj5UKSylk?t=5893

โค๏ธ 1