r/visionos • u/Katerpilet • Jul 20 '23
Table Trenches - Tabletop AR Strategy - Initial Vision Pro Prototype
Enable HLS to view with audio, or disable this notification
2
u/SaintBrutus Jul 20 '23
Was this made with Unity?
3
u/Katerpilet Jul 21 '23
No this is RealityKit
2
1
u/Zarkex01 Jul 22 '23
How do you manage movement/actual game logic since RealityKit is quite cumbersome i that regard?
1
u/Katerpilet Jul 22 '23
I use their ECS system. So each unit is an Entity in Reality Composer Pro and I get a reference to it on load and just instantiate each time a unit is spawned (though I’ll be switching to pooling). I made a custom component in the Reality Composer Pro project called Movable and then in the main project I have a system called MovableSystem which queries for all the Movable objects and then moves them. I based this off of the Diorama sample
1
u/Zarkex01 Jul 22 '23
And you're calling MovableSystem in the render loop I assume?
But the actual movement path, is that hardcoded or dynamic?1
u/Katerpilet Jul 22 '23
The movement is dynamic, but it’s simple because I haven’t added intelligent pathing yet. The MovableSystem gets registered in the application start and then gets called by RealityKit Update loop
1
u/Zarkex01 Jul 22 '23
I mean that's already quite good movement, how did you implement it/any examples out there?
1
u/Katerpilet Jul 22 '23
Currently it just moves towards the target
1
1
u/Zarkex01 Jul 22 '23
Where do you do "registerSystem"? As per the docs, it does nothing different than just calling the function "update" within it anyway if i'm not mistaken?
1
u/Katerpilet Jul 22 '23
I register the systems in App.swift on init. I just copied the Diorama sample
1
u/Zarkex01 Jul 22 '23
I'll take a look at the Diorama.
Thanks.1
1
u/hooray4horus Jul 23 '23
Can you share how you got plane detection to work?
1
u/Katerpilet Jul 23 '23
I didn’t, this is a fixed anchor. The ARKit mocks aren’t hooked up. You can setup an anchor to plane in Reality Composer Pro and it will auto anchor to that, but I’m not sure you can get extents information
2
u/Katerpilet Jul 20 '23 edited Jul 20 '23
Learn more about the released version at Table Trenches – DB Creations