clojure-gamedev

2017-04-17T12:23:07.370416Z

@neurogoo hmm good question, I know i've built a clojure libGDX project for android before but can't remember how

2017-04-17T12:24:00.377381Z

it seems that it was depended on lein-droid, but that project seems to be on hiatus.

2017-04-17T12:24:24.380720Z

ah yes that sounds familiar

2017-04-17T12:24:53.384772Z

you could also try aot'ing the clojure and using android studio

2017-04-17T12:26:34.398148Z

Hmmm, I have to look into it, but unfortunately does seem like that using Clojure for Android game is not realistically possible currently 😞

2017-04-17T12:29:09.419268Z

yeah possible but not done that often or documented

2017-04-17T12:29:43.424203Z

I know Arcadia can do it but I've never actually tested anything out

2017-04-17T12:31:32.440205Z

Yeah Arcadia is one possibility, but I have understood that it is in quite alpha stage. Also as Unity as engine is not familiar to be I should probably first learn it before using Arcadia

2017-04-17T12:35:59.477668Z

eh it's alpha but very stable - but you're right learning Unity at the same time is a lot to take in

sineer 2017-04-17T15:49:53.398549Z

@neurogoo Have you considered using ClojureScript instead? There's play-cljs and a few others... I find it best to develop for the web for devel phase then target android/ios with re-natal.

sineer 2017-04-17T15:53:23.464727Z

I too had a really hard time working with lein-droid and I don't think it's worth the trouble unless you really need to build some native java code. Working with re-natal and cljs is a lot easier I find and the tools improved a lot last few months

2017-04-17T16:26:45.093966Z

I have considered, but if I have understood correctly, React Native is still somewhat limited for complex graphics.

2017-04-17T16:35:20.256477Z

I am not that familiar with front-end world, but I think I need something like svg or canvas. My idea was to make simple isometrix 4x game

sineer 2017-04-17T17:26:50.257443Z

@neurogoo I understand. I've spent huge amount of time understanding frontend stuff instead of actually doing graphic stuff.

sineer 2017-04-17T17:38:49.501869Z

React(Native) job is not to do complex graphics really it's more about dealing with components lifecycle.

2017-04-17T17:39:21.512720Z

it has a canvas element no?

sineer 2017-04-17T17:40:05.527247Z

You can use whatever you want with react really, canvas, svg, WebGL, ...

sineer 2017-04-17T17:40:44.540618Z

In my latest experiment I mixed gl-react with http://thi.ng to do GLSL in WebGL using om next...

sineer 2017-04-17T17:41:35.558109Z

Recently I've decided that pixi.js looks like what I need for it does WebGL and fall back to canvas if not available

2017-04-17T17:41:50.563449Z

yeah pixi is great

2017-04-17T17:42:07.568999Z

re: react native, does that mean you used a webview?

sineer 2017-04-17T17:43:11.589571Z

I'm not sure, there may be "native" webgl component but they probably do use a webview

sineer 2017-04-17T17:43:34.597440Z

I haven't done WebGL on android yet

sineer 2017-04-17T17:45:50.643534Z

I do think it's a good thing to use a webview too because it makes it that much easier to target the web instead and it's a lot easier develop in your browser than on your android device

sineer 2017-04-17T17:47:45.682910Z

even for simple app I find it a lot easier to develop in plain react then port instead of trying to develop using react native (unless you have some native requirements that can't be done in plain react, ie Bluetooth LE stuff)

sineer 2017-04-17T17:49:29.718268Z

There is nothing like chrome devtools for react native. figwheel and devcards are also a huge plus for me not to mention dirac awesome repl

2017-04-17T17:55:08.834224Z

yeah think we're at a point where a web based game would run fine on most phones

sineer 2017-04-17T17:55:35.843649Z

That said, if all you want to do is code a simple game that you can already plan ahead what it will look like then perhaps all theses tools are a distraction and one could simply code it and focus on implementing the plan...

sineer 2017-04-17T17:56:48.869117Z

Yeah for 2D stuff I think webview on mobile is fine. We also have core.async that can be very useful for concurency.

2017-04-17T19:21:22.596850Z

When I looked into React Native it didn't seem to have canvas element. I could be wrong as it is new to me

2017-04-17T19:30:02.760070Z

There is 3rd party version of canvas for React Native, but that is currently unmaintained

2017-04-17T19:44:57.040956Z

Webview is something that I need to test to see how it perfoms, but it does feel quite unefficient way to do things.

sineer 2017-04-17T22:04:13.541437Z

@neurogoo check out https://github.com/Flipboard/react-canvas

sineer 2017-04-17T22:05:22.558642Z

I'm not sure it can be used in ReactNative too.

sineer 2017-04-17T22:06:52.579833Z

WebGL in webview I suspect would outperform any canvas due to help from the GPU. That is why I believe libs such as pixi.js that target WebGL are the best option

sineer 2017-04-17T22:08:54.606615Z

You might be plesently surprised by Webview canvas performance too since it's mainstream and very much optimized... Using webview with react and virtual DOM is very fast.