Fork me on GitHub
#clojure-gamedev
<
2022-11-11
>
wotbrew15:11:55

I'm playing with https://github.com/nextjournal/clerk notebooks to assist my clojure game dev, finding it very fun, anyone else using clerk to augment their repl experience during game dev?

wotbrew15:11:15

Feeling like I'm getting a bit closer to https://youtu.be/PUv66718DII?t=646 😎

wotbrew15:11:18

Anyway, curious if any other folks are using clerk for games, if nobody else is doing it perhaps I can write a blog post 😄

zane15:11:07

I would read the heck out of such a blog post. :star-struck:

💯 3
wotbrew16:11:59

I'll see what I can do 🙂

wotbrew16:11:44

Currently rendering scenes as still images (still very cool to debug graphics pipeline!), not sure how best to get animated scenes across to the browser :thinking_face: , maybe something crazy like encode scenes as video 😄, I'm using LibGDX so my render target is a proper opengl context via lwjgl

wotbrew16:11:16

it'd be good to get a blog post out of this yak shave for sure

phronmophobic18:11:02

depending on which clerk viewers you're using, it might be possible to embed clerk in your game-view

phronmophobic18:11:59

It's probably possible to embed this in your game, but I'm not sure how interesting that is.

phronmophobic18:11:57

if you are interested in encoding your scenes as gifs/videos, I've been working on https://github.com/phronmophobic/clj-media

🙏 1
phronmophobic19:11:05

it's a little bit WIP, so happy to answer any questions

wotbrew19:11:43

I'd considered .gif, I think that could be a good solution, means the rendering can take a while and ultimately the artifact is generally useful (can copy paste it about etc)

wotbrew19:11:55

any animated visuals would be short and would not need a high fps

phronmophobic19:11:30

.gifs are generally just inefficient videos, but they work everywhere

wotbrew19:11:09

as long as there is some function from seq of argb / buffered image / whatever to 'thing i can embed in a clerk view' then it should work

👍 1
wotbrew19:11:25

I did wonder if there could be some direct proxy between a canvas/hot region in the viewer to rendering code running on the jvm, because then I could proxy input and basically have loads of multiplexed games 😄

wotbrew19:11:15

alas, .gif is so much more doable right now 😄

phronmophobic19:11:11

lol, let me present my other experiment, https://github.com/phronmophobic/clj-cef

phronmophobic19:11:28

it's probably way over complicated, but you could render clerk in your game and for specific viewers, just find out where the viewer is drawn and draw on top of it

phronmophobic19:11:30

I wouldn't actually recommend doing that, but it's possible, in theory

wotbrew19:11:25

I'm not as hot for embedding as I am for finding a sweet spot with the traditional clerk web sidecar that lets me get interactivity in 'dev mode' while still being exportable as a static website

👍 1
phronmophobic19:11:54

yea, that's probably the sane approach

wotbrew19:11:50

What I am doing now is just plain clerk, I have functions creating BufferedImage out of one-shot render functions, I got a few fbo's. Video again like just works with this model as I return a gif and put in a viewer for it. Interactivity though, ya see I wanna go there, hence I remain curious about live / reactive rendering with some 2-way communication

wotbrew19:11:37

Maybe I can use some kind of stream encoding :thinking_face: , unfortunately I know basically nothing about these things so I have to go read up 'how to encode video 101'

wotbrew19:11:38

These libraries seem really cool so I might try them out as part of my yak shave, thanks for helping me in my quest to not write an actual game 😉

bananadance 2
phronmophobic19:11:31

I've just spent the last week or so staring at ffmpeg examples so if you have any questions or want someone to bounce ideas off of, feel free to DM me.

phronmophobic19:11:15

the tldr for video encoding is something like:

container(eg. mp4) ----demuxing--> packet (encoded data) ---decoder--> frames(raw data) --encoder--> packet --muxer--> container 

🙏 1