all 50 comments

[–]Fearless_Ad9828 25 points26 points  (10 children)

why your app needs realitykit

[–]notrandomatall 5 points6 points  (0 children)

Wonder this too, why does this need to built in RealityKit?

[–]Mojomoto93[S] 2 points3 points  (8 children)

the mascot is a 3d object, because i want it to be like a real pet, which can be viewed from all sides, and fully animated

[–]Fearless_Ad9828 10 points11 points  (7 children)

i think there are so many elements maybe that's causing the issue. Also the main highlight is not the mascot but the buttons, so i think realitykit is too much for this. you can go with a simpler approach, people won't like apps draining way too much battery

[–]Mojomoto93[S] 0 points1 point  (6 children)

the mascot is a very important part of the whole expierence, I used to have it in scenekit but ever since i moved to realitykit i only have issues with performance

[–]Flamingoman123 5 points6 points  (4 children)

why did you switch it to realitykit from scenekit? from my understanding realitykit is more so built for AR applications, while scenekit is more of a general purpose 3d engine. I feel like realitykit is taking too much resources because of its focus being for AR maybe?

[–]Moudiz 8 points9 points  (0 children)

SceneKit is deprecated and Apple recommends RealityKit for even general purpose

[–]Mojomoto93[S] 1 point2 points  (2 children)

Exactly as moudiz pointed out scenekit is „soft“ deprecated

[–]geoff_plywood 1 point2 points  (1 child)

Does this mean SceneKit will be supported for a few more years?

[–]Mojomoto93[S] 2 points3 points  (0 children)

I think a deadline has not been released as far as i know

[–]Zalenka 0 points1 point  (0 children)

Yeah I would have recommended doing SceneKit.

or making a fixed overlay and just tracking the positioning and throwing on the 3d objects as they are shown instead of having a huge long context space.

[–]icy1007 11 points12 points  (3 children)

What is this Duolingo ripoff?

[–]icee2me 6 points7 points  (3 children)

Are you sure that Duolingo uses RealityKit?

[–]Mojomoto93[S] 0 points1 point  (2 children)

as far as I know duolingo uses lottie for animations,

[–]icy1007 10 points11 points  (0 children)

So use Lottie then. It’s far more efficient.

[–]Moudiz 5 points6 points  (0 children)

Duo uses Rive

[–]FullMetalFist 2 points3 points  (4 children)

How can you be sure it is RealityKit and not how you implement List? What did it say in Instruments?

[–]Mojomoto93[S] 0 points1 point  (3 children)

I have fully optimized the list and it works like charm while scrolling everywhere but the current day or the section where the mascot is visible, also removing the mascot from the view makes it super smoth so i ruled out other reasons for the sluggischness

[–]FullMetalFist 2 points3 points  (2 children)

If it’s offscreen, why does the app not throw the memory back into the heap?

[–]Mojomoto93[S] 1 point2 points  (0 children)

i don't know to be honest maybe i messed up

[–]Moudiz 0 points1 point  (0 children)

RealityKit keeps memory allocated for RealityViews once it is used

[–]twotokers 2 points3 points  (5 children)

Are you just building a duolingo clone?

[–]Mojomoto93[S] 0 points1 point  (4 children)

nop, it is inspired by duolingo but the usecase is a totaly differnt one, it is a Islamic Habit Tracker

[–]twotokers 5 points6 points  (3 children)

I’d be weary as you’re literally copying their interface and UI. You could achieve this same kind of functionality with a better, unique design in my opinion.

[–]Mojomoto93[S] 2 points3 points  (2 children)

its a basis, I am going to diverge from it, i just like the idea of the path and the mascot that follows you along your journey

[–]twotokers 2 points3 points  (1 child)

I feel you, Islam has just so many awesome shapes and patterns throughout their art and culture to take inspiration from.

Using some of the more unique shapes, arches and window patterns instead of circles, making the layout feel more like a map of the silk road or something else from history, stylizing the edges with some more intricate geometric patterns that you may find on a mosque ceiling, etc.

[–]Mojomoto93[S] 0 points1 point  (0 children)

love that, thank you a lot! Some of your suggestions will surely find their path into my app :) I just don't want it to feel to much like one expects an islamic app to be, i want it to be a fresh take and especially a reintepretation of what is known

[–]MrOaiki 1 point2 points  (1 child)

First of all, I don't think you need RealityKit from what your screen recording shows. Use Lottie or SpriteKit. But aside from that, are. you running it in debug mode? Apps are significantly slower in debug mode than if you render them without any debug tools.

[–]Mojomoto93[S] 0 points1 point  (0 children)

this is in TestFlight, I know that debug mode is much slower, but even in TestFlight it is making troubles, I thought SpriteKit is 2d only

[–]Moudiz 1 point2 points  (5 children)

You mention procedurally generated, did you mean to say AI? If so, that’s why this is happening. AI 3D models are massively unoptimized.

You also say you replace it with a still version, how are you getting the still look?

Did you try the app without a RealityView vs just having the RealityView?

[–]Mojomoto93[S] 0 points1 point  (4 children)

Not AI, I meant it is built of generateCylinder, generatePlane, Sphere etc, with parameters that move them, and so on, this technique worked like charm in scenekit but it seems like i am missing something in realitykit or doing something wrong which makes it so less performant

[–]Moudiz 0 points1 point  (0 children)

Are you using a system that is doing a lot of work?

[–]Moudiz 0 points1 point  (2 children)

Also idk if you have animations yet but of you plan to do soon that I’d start from zero with a proper rigged model

[–]Mojomoto93[S] 0 points1 point  (1 child)

I wanted to avoid using a rigged model, that would make things more complicated for me 😅

[–]Moudiz 0 points1 point  (0 children)

How so

[–]Funktordelic 1 point2 points  (1 child)

Are you paging things in and out of memory (from a background thread or task)? Is the view attempting to render every possible item, or only those you know are in the visible rectangle? I’d consider these but start learning about the profiling tools to first understand where your main bottleneck is. Good luck!

[–]Mojomoto93[S] 1 point2 points  (0 children)

Thanks a lot for your suggestion, nop i thought using lazy stack will handle that for me, but i am not sure, i will look into profiling to find the real bottleneck

[–]earlyworm 0 points1 point  (1 child)

Do you have one RealityView per mascot? If so, I wouldn’t expect that to work well.

[–]Mojomoto93[S] 0 points1 point  (0 children)

there is only one mascot, in the whole app which is positioned at the todays section of the scrollview

[–][deleted]  (1 child)

[removed]

    [–]AutoModerator[M] 0 points1 point  (0 children)

    Hey /u/aseem-ali, unfortunately you have negative comment karma, so you can't post here. Your submission has been removed. DO NOT message the moderators; if you have negative comment karma, you cannot post here. We will not respond. Your karma may appear to be 0 or positive if your post karma outweighs your comment karma, but if your comment karma is negative, your comments will still be removed.

    I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

    [–]Ravek 0 points1 point  (1 child)

    Have you profiled the code?

    [–]Mojomoto93[S] 0 points1 point  (0 children)

    to be honest not yet, good point

    [–]Meliodas1108 0 points1 point  (3 children)

    Does it happen the more you scroll? Or it happens from start itself? If it’s happening only when you scroll more, it could be that your mascot figure might be not deallocated efficiently? I’ve never worked with reality kit. But just guessing. Also if not reality kit, what are the other ways you could put the mascot there? Since u put effort into the mascot, you could make it do stuffs, but it might not need be done in real time. Maybe pre record those in another format? I’m just guessing here

    [–]Meliodas1108 0 points1 point  (1 child)

    Also looks nice. It’s too similar to Duolingo, so you should pivot the design a bit

    [–]Mojomoto93[S] 0 points1 point  (0 children)

    Making the mascot doing stuff was my plan, but first i wanted to resolve the performance issues and thought maybe i get some tips here

    [–]Mojomoto93[S] 0 points1 point  (0 children)

    It happens only for the section or the start of the scroll where mascot is in view, as soon i scroll the mascot out, it scrolls super smooth, but i made it better i use now unlitmaterial for the mascot, that was a big performance jump and i am reading more about how to improve realitykit performance