Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Folcon
@Folcon

Hmm, some new and interesting breakage:

Loading Assets/Arcadia/Source/arcadia/linear.clj... 
System.InvalidOperationException: No such var: clojure.core/inline-arity-pred
  clojure.lang.Compiler.ResolveIn (clojure.lang.Namespace, clojure.lang.Symbol, System.Boolean)
  clojure.lang.Compiler.Resolve (clojure.lang.Symbol)
  clojure.lang.Compiler.AnalyzeSymbol (clojure.lang.Symbol)
  clojure.lang.Compiler.Analyze (clojure.lang.CljCompiler.Ast.ParserContext, object, System.String)

Not sure why it's suddenly started blowing up at this point, anyone seen this before?

Folcon
@Folcon
Some investigating seems to imply that vars are being looked up against clojure.core instead of the namespace they're located in...
Folcon
@Folcon
It's ignoring the quote operator as well, fully qualifying the name seems to work...
Folcon
@Folcon
And now it's magically working again >_<...
Folcon
@Folcon

Ok, so I sort of dumbly stumbled into this one =)...

(defn vec->c#list [v]
  (let [xs (|System.Collections.Generic.List`1[System.String]|.)]
    (doseq [e v]
      (.Add xs e))
    xs))

Anyone have anything more elegant that I missed? I specifically need a List of Strings, not Persistent List... Unity's new UI Toolkit doesn't like it if you try and bind Persistent Lists to dropdown boxes =)... If not I'll add it as a pattern!

Joseph Parker
@selfsame
@Folcon yeah that's probably the best way to do it
Folcon
@Folcon
Ok, will add something tomorrow =)
Folcon
@Folcon
Hmm, ok, I'm currently testing exporting and I'm getting a few errors around missing gameobjects, my clojure code creates the gameobjects dynamically. So they don't exist in the scene until the code runs, this works fine in the repl, but could it be a problem when exporting?
Folcon
@Folcon
Alternatively if anyone has suggestions how to call BuildPipeline.PrepareExport(); in Rider (or equivalent) I can try and step / debug it =)...
saikyun
@saikyun
@Folcon do you depend on those objects existing when the game starts? I often create an init-function which creates all the dynamic stuff before I run any update-functions
Folcon
@Folcon
I'm actually creating them using defonce's at the moment. So once the namespace loads they should be created, which is what's weird, it's almost like during export some of the functions are getting invoked, but not others? Or require's aren't firing? Really not sure.
Is there some kind of init script that people use to setup and build all their main gameobjects that I've completely missed?
I think the namespaces are AOT-compiled, so the objects are probably created during compile time :'D
I think I had some trouble like this, but it was a long time ago
Folcon
@Folcon
Does that approach still work if you do it across namespaces?
Folcon
@Folcon
Ok, nevermind, I didn't realise that I should hook+ my init script to Main Camera :start, that properly ensures things run correctly
I'll update my example project to reflect this!
Thanks @saikyun =)
Hmm, new error, which is good, so I can't create primitive's during Serialization, I'll have to adjust logic
Folcon
@Folcon
Ok managed to get a minimal example built and exported, so I updated the example project with that info =)... Will now need to see if this works if I pull in the rest of my changes. If anyone wants to give the example project a tire kick, it's here:
https://github.com/Folcon/arcadia-example-project/
Folcon
@Folcon
Ok, another learning, got to use setup functions to declare any gameobjects as unity doesn't like you creating stuff outside start / awake =)...
saikyun
@saikyun
nice that you managed to find a solution :)
Folcon
@Folcon
=)
Folcon
@Folcon
I don't know if anyone else is interested in using Unity's new UIElements stuff for building user interfaces... I've started building a somewhat kooky namespace to start handling / working with these and if anyone wants to give it a go please tell me =)... I'm still trying to figure out how to hook into it gracefully, but it does work, with a small amount of c# which I'd love to eliminate!
Folcon
@Folcon

Anyone have any suggestions on how to specify this interop call?

public static T Q(UIElements.VisualElement e, string name, string className);

From: https://docs.unity3d.com/2019.1/Documentation/ScriptReference/UIElements.UQueryExtensions.Q.html

This is used as:

var label = root.Q<Label>("label-name");

My digging around in the clr docs is that the way to do this is using (type-args UnityEngine.UIElements.Label) to represent the <Label> part:

(UQueryExtensions/Q (type-args Label) (get-root ui-screen) "label-name" "")

Except this always returns nil, stepping through the nrepl evaluation in the debugger makes me believe that it's not finding the function... Except it's not returning an undefined fn error... Really not sure what's going on...

root and get-root are the same as far as I can tell =)...
My delightful workaround for this is to manually create a function for each type, which is viable as there are only finite types that cover this...

Georg Kirsch
@Disney1
Hello! Has anyone here experience with Arcadia and ArFoundation in Unity?
Folcon
@Folcon

I'm seeing references to StrongBox`1, which some googling is telling me is a way of boxing stuff... specifically this? System.Runtime.CompilerServices.StrongBox, except no idea how to construct it. I've tried importing it with no luck.

I tried constructing it via:

(by-ref (uint 0))
(|System.Runtime.CompilerServices.StrongBox`1[uint]|. 1)
(|StrongBox`1[uint]|. 1) ;; wasn't really expecting this to work, but I figured give it a shot =)...

Maybe this is a rabbit hole, what I'm trying to do is use a function that takes out uint x. Any suggestions on how to do this would be great =)...

Reading the clr docs implies that you should use by-ref and though that works for ref's, it doesn't appear to work on out...

Folcon
@Folcon

I think I'm hitting this:
arcadia-unity/Arcadia#114

(Vector3/SmoothDamp (-> obj .transform .forward) target-dir (by-ref smooth-v) smooth-time)

Commonly smooth-v just blows up, and I have no idea how to tell if it's null or not. Any ideas or ways of working with these?

Folcon
@Folcon

Ok, I figured it out, but it involved having to add smoothDamp to LinearHelper:

public static IPersistentVector smoothDamp(Vector3 current, Vector3 target, Vector3 currentVelocity, float smoothTime)
{
     Vector3 newCurrentVelocity = currentVelocity;
     Vector3 result = Vector3.SmoothDamp(current, target, ref newCurrentVelocity, smoothTime);
     return PersistentVector.create(result, newCurrentVelocity);
}

as well as add smooth-damp to arcadia.linear

(definline smooth-damp
  "Given a `Vector3` `current`, a `Vector3` `target` a `Vector3` `current-velocity` and a `float` `smooth-time`, returns a collection containing the result (`Vector3`) of smoothly changing from the current to the target over the time smooth-time and current-velocity (`Vector3`), as set by the `Vector3/SmoothDamp`.

  Calls to this function will be inlined if possible."
  [^UnityEngine.Vector3 current ^UnityEngine.Vector3 target ^UnityEngine.Vector3 current-velocity smooth-time]
  `(Arcadia.LinearHelper/smoothDamp ~current ~target ~current-velocity ~smooth-time))

Happy to PR it (though it will probably need some improvement), as there seems to be precedent with working with ref according to arcadia-unity/Arcadia#267.

Folcon
@Folcon
Btw, is there any existing way of invoking Arcadia => Prepare for Export from the command line?
Folcon
@Folcon

I've managed to post the question here with some more details if anyone is interested:
https://answers.unity.com/questions/1873894/trying-to-build-a-pipeline-but-getting-error-in.html

If I can get this figured out I'd definitely adding it into the wiki, this is an unnecessary pain =)...

Nano
@nanoni17728
Hi there!
Back again to Arcadia but with an irc bouncer this time.
So I should be more present.
I bought the Shapes asset to do vectorial stuff, I'm gonna set up a monorepo so I can experiment more around Arcadia and Unity
redroote
@redroote

Hi,
I've encountered below error while I was trying to execute build-result of <orbomancy> which is Arcadia-Godot Example.

Can you please enlighten me any clue what I've been doing wrong ?

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'clojure.lang.RT' threw an exception. ---> System.IO.FileNotFoundException: Could not locate clojure.core.cljc.dll or clojure/core.cljc on load path.
  at clojure.lang.RT.load (System.String relativePath, System.Boolean failIfNotFound) [0x001a2] in <fb1204dbf0b848beaab1559f81f1b22c>:0
  at clojure.lang.RT.load (System.String relativePath) [0x00000] in <fb1204dbf0b848beaab1559f81f1b22c>:0
  at clojure.lang.RT.DoInit () [0x00000] in <fb1204dbf0b848beaab1559f81f1b22c>:0
  at clojure.lang.RT..cctor () [0x01f3d] in <fb1204dbf0b848beaab1559f81f1b22c>:0
   --- End of inner exception stack trace ---
  at Arcadia.Boot.Initialize () [0x00037] in <2a86192f9b0a4b49ab80b15f8828eb2b>:0
  at Arcadia.ArcadiaHook._EnterTree () [0x00001] in <2a86192f9b0a4b49ab80b15f8828eb2b>:0

Unhandled Exception:
System.TypeInitializationException: The type initializer for 'clojure.lang.RT' threw an exception. ---> System.IO.FileNotFoundException: Could not locate clojure.core.cljc.dll or clojure/core.cljc on load path.
  at clojure.lang.RT.load (System.String relativePath, System.Boolean failIfNotFound) [0x001a2] in <fb1204dbf0b848beaab1559f81f1b22c>:0
  at clojure.lang.RT.load (System.String relativePath) [0x00000] in <fb1204dbf0b848beaab1559f81f1b22c>:0
  at clojure.lang.RT.DoInit () [0x00000] in <fb1204dbf0b848beaab1559f81f1b22c>:0
  at clojure.lang.RT..cctor () [0x01f3d] in <fb1204dbf0b848beaab1559f81f1b22c>:0
   --- End of inner exception stack trace ---
  at Arcadia.Boot.Initialize () [0x00037] in <2a86192f9b0a4b49ab80b15f8828eb2b>:0
  at Arcadia.ArcadiaHook._EnterTree () [0x00001] in <2a86192f9b0a4b49ab80b15f8828eb2b>:0

Here is how I got this error:

I've proceeded Godot engine build first, then
I used command below via repl:

(require 'arcadia.internal.compiler)
(arcadia.internal.compiler/aot "export/dlls" ['game.core])
``

and witnessed below from Godot output..

compiling clojure.core ..
compiling clojure.core.server ..
compiling arcadia.internal.namespace ..
compiling arcadia.repl ..


then these dlls are produced on export/dlls/

arcadia.2D.clj.dll
arcadia.core.clj.dll
arcadia.internal.config.clj.dll
arcadia.internal.namespace.clj.dll
arcadia.linear.clj.dll
arcadia.repl.clj.dll
game.baddies.clj.dll
game.core.clj.dll
game.data.clj.dll
game.gen.clj.dll
```

Then I copied these dlls to exe folder.
I find those errors on top when I run the exe.

I'm using:
Godot_v3.3.3-stable_mono_win64.exe
latest Arcadia-godot

Thanks in advance,
I'm all ears.

4 replies
Folcon
@Folcon
@nanoni17728 great to hear =)... Been not feeling well these last few weeks, so coding has come to a standstill at the moment, but main thing on my todolist is trying to figure out how to get a nice build pipeline working =)...
Aidar Lukmanov
@AydarLukmanov

Hi everyone, I’m currently working on replacing clojure-clr with nostrand/magic in ArcadiaGodot:
https://github.com/AydarLukmanov/ArcadiaGodot/tree/feature/replace-clr-with-magic

have working version which allow export @selfsame orbmancy on iphone (but needed some fixes because magic is more strict on types), it’s running okay, aside absence of controls
https://github.com/AydarLukmanov/orbomancy

also I setup it up as godot plugin, and add “prepare arcadia export” in tools menu as in unity version
also because it is basically nostrand, nostrand deps should work via configuration.edn, but I didn’t test it yet
Aidar Lukmanov
@AydarLukmanov
saikyun
@saikyun
oh, you can export to ios? that's really cool
nice work @AydarLukmanov
Aidar Lukmanov
@AydarLukmanov
@saikyun Thanks, updated PR, make it ready to review
saikyun
@saikyun
I haven't used godot at all, so I don't have anything to add really :) hope it works out well
Folcon
@Folcon
Hmm @AydarLukmanov, how hard have you found ArcadiaGodot to use? I've only had experience over a hackathon with using it and I only tried using godotnative. Do you get a good repl experience? (I've been toying with giving it a go...)
Aidar Lukmanov
@AydarLukmanov
@Folcon pretty easy, especially clr version, everything working okay but no exports for iphone, but I did’nt make any game yet, so it’s just from first look. Magic version also have working repl, can be improved, for example I question this part https://github.com/arcadia-unity/ArcadiaGodot/pull/30#discussion_r782381588 and in general still need bugfixes, some of the arcadia.core functions not working properly, but it’s easy bypass by delegating to c# functions (currently I created class GodotHelpers with static functions, maybe someone more proficient in clj/c# can make it better in future). Godot engine by itself have good traction, and can be used for any kind of apps, my friend made trading view app for example.
Folcon
@Folcon
There are definitely some issues with using by-ref etc which are really annoying, it sounds like it's a similar issue in godot?
5 replies
Aidar Lukmanov
@AydarLukmanov
compiled arcadia godot magic version to oculus quest 2, fixed one bug, tried to connect via repl unsuccessfully but found this in sources // TODO make IPAddress.Loopback configurable to allow remote connections so probabli will not be big problem to fix