clojure-gamedev

pfeodrippe 2024-07-14T02:21:37.003209Z

I will soon release some metrics additions to Vybe so we can improve debugging of the game systems/observers/whatever needed (using Clerk!)

👀 2
emil0r 2024-07-16T14:18:35.114639Z

emil:vybe/ (main) $ ls -la /tmp/pfeodrippe_vybe_native         [16:18:12]
total 40424
drwxr-xr-x  7 emil  wheel       224 Jul 12 10:41 .
drwxrwxrwt  9 root  wheel       288 Jul 16 16:15 ..
-rw-r--r--  1 emil  wheel  17351248 Jul 12 10:44 libjoltc.dylib
-rw-r--r--  1 emil  wheel   1614888 Jul  9 13:20 libraylib.dylib
-rw-r--r--  1 emil  wheel   1110000 Jul 12 10:44 libvybe_flecs.dylib
-rw-r--r--  1 emil  wheel     16736 Jul 12 10:44 libvybe_jolt.dylib
-rw-r--r--  1 emil  wheel     52344 Jul  9 13:20 libvybe_raylib.dylib

emil0r 2024-07-16T14:19:18.467779Z

emil:vybe/ (main) $ clj -M:dev -m vybe.native.loader && clj -M:osx -m vybe.raylib

Execution error (ClassNotFoundException) at java.net.URLClassLoader/findClass (URLClassLoader.java:445).
org.vybe.raylib.raylib

emil0r 2024-07-16T14:19:53.389909Z

{:clojure.main/message
 "Execution error (ClassNotFoundException) at java.net.URLClassLoader/findClass (URLClassLoader.java:445).\norg.vybe.raylib.raylib\n",
 :clojure.main/triage
 {:clojure.error/class java.lang.ClassNotFoundException,
  :clojure.error/line 445,
  :clojure.error/cause "org.vybe.raylib.raylib",
  :clojure.error/symbol java.net.URLClassLoader/findClass,
  :clojure.error/source "URLClassLoader.java",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type clojure.lang.Compiler$CompilerException,
    :message
    "Syntax error macroexpanding at (vybe/raylib/impl.clj:1:1).",
    :data
    {:clojure.error/phase :execution,
     :clojure.error/line 1,
     :clojure.error/column 1,
     :clojure.error/source "vybe/raylib/impl.clj"},
    :at [clojure.lang.Compiler load "Compiler.java" 7665]}
   {:type java.lang.ClassNotFoundException,
    :message "org.vybe.raylib.raylib",
    :at
    [java.net.URLClassLoader findClass "URLClassLoader.java" 445]}],

pfeodrippe 2024-07-16T18:42:00.813119Z

@emil0r Hunn, so it seems you are running it from the vybe root directory? Better to use vybe as a clojars package, otherwise you won’t have much to test with (and you would have to compile the Java libs before using the build.clj file), try to use https://github.com/pfeodrippe/vybe-games and run exactly the same command \o Use c to create downfall cubes, space to change the camera view, m to animate one of the cameras (the default one) and mouse hover/click on the towers to see them going up and down 😛

emil0r 2024-07-16T21:36:12.365569Z

OK. Will give that a whirl then

emil0r 2024-07-16T21:36:34.623959Z

Any plans on making this work with graalvm?

pfeodrippe 2024-07-16T21:42:38.898589Z

Haven’t tried it, if someone has it working, more than happy to review it. First, I would like to make it work very fine in the JVM, then make some small games and then cljs (as I know that 2 of the 3 C libs I’m using work fine with wasm, not sure about Jolt).

emil0r 2024-07-15T14:09:45.958679Z

Tried to get things running btw. First time worked, second time I got interesting link errors. How stable is Vybe?

pfeodrippe 2024-07-15T15:09:17.760699Z

Hi @emil0r, it’s still in WIP and I have tested it only on a arm OSX (there is no dynamic lib generated for other OSs out of the box), which OS are you using? So are you trying https://github.com/pfeodrippe/vybe-games or something else? Which command are you running (https://github.com/pfeodrippe/vybe?tab=readme-ov-file#getting-started) and which error are you having?

pfeodrippe 2024-07-15T15:14:00.128959Z

For reference, https://github.com/pfeodrippe/vybe/blob/main/src/vybe/panama.clj#L21 is the location where we put the dynamic libs, check if you are seeing 4 files there (one for jolt, one for Flecs and 2 for raylib) o/

emil0r 2024-07-15T20:15:37.032439Z

I'm on an M2 MBP

emil0r 2024-07-15T20:16:07.890289Z

I'll have a look again later

pfeodrippe 2024-07-15T20:52:54.760609Z

Ok, thanks o/