ERS_Collins Posted February 28, 2024 Posted February 28, 2024 Hello! I'm trying to use Pegasus in a very large world. I have implemented a floating-origin system that takes care of the floating point issue Unity is prone to. In tandem with this floating point system, I must of course move POIs (and therefore the route) so that the user does not notice the effect. I discovered the PegasusPoi.UpdateSegemnt() method, which I use after adjusting the transform of the POI object. At first I tried doing this call in a regular function, but that caused my app to freeze for about 7 seconds or so while each POI segment was updated within a single frame. I then tried to do one segment per frame by throwing the UpdateSegment() call loop inside a Coroutine that yielded after each POI. This of course helped, but each POI's call to UpdateSegment() takes so long that the application freezes for at least a couple of seconds before the next iteration/frame. I have included screenshots of the profiler below that show the performance drop. The spike is the time that the coroutine with UpdateSegment() is looping through the PegasusManager's POI list. I have 15 POIs in this route Note that I intend to drive multiple entities via PegasusManagers, so the fact that I am experiencing such performance loss with just one of these routes is... foreboding. All routes will need to be translated when adjusting the floating origin. I'd like to know if there is a more performant way of translating a Pegasus route? For instance, is there a better method I can call, or a different implementation I should be employing? Calls to some kind of Update method seem necessary as simply altering the Transform of the POIs or the PegasusManager do not recalculate the spline, but this one is very slow for some reason. Thank you!! -ERS
Solution Bryan Posted March 4, 2024 Solution Posted March 4, 2024 We will have to investigate this issue. Your distance covered is pretty far from the looks of it. To negate this in the meantime could you please try to make multiple pegasus paths and then use the Unity recorder/timeline to put them together?
ERS_Collins Posted March 14, 2024 Author Posted March 14, 2024 On 3/4/2024 at 2:19 PM, Bryan said: We will have to investigate this issue. Your distance covered is pretty far from the looks of it. To negate this in the meantime could you please try to make multiple pegasus paths and then use the Unity recorder/timeline to put them together? Yes it was a very large distance for sure. A fix I have implemented at this time is to scale the world down to 1uu = 1km (was 1uu = 1m) which has removed my need for floating-origin-type solutions at this time. Your suggestion sounds like it also would have worked, so thank you for that!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now