crashes caused by FloatingOrigin script

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
Post Reply
User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

crashes caused by FloatingOrigin script

Post by Nystul »

I think I found the reason for the crashes I experience occasionally when fast-travelling around like a pro ;)
It took me quite some time to localize the source for the crash but now I am pretty confident that I have found it and how others should be able to reproduce it... I was able to reproduce it with just the core tools without any mods installed.
how I mangage to reproduce it:
-) load the scene Legacy/WorkshopDemo_StreamingWorld
-) add to PlayerAdvanced the scripts FloatingOrigin.cs and PositionUpdate.cs
-) you do not need to manually attach StreamingWorld gameobject and PlayerAdvanced gameobject (if you do make sure you do not accidentally select the PlayerAdvanced prefab)
-) press start and random-teleport several times by pressing key 'r' (I usually get a crash after 20+ teleports - if I have mods enabled I get the crash much earlier after 8-12 teleports - but the important point is it crashes even without them - it is just a bit more unlikely)

without these scripts I can not produce any crashes

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: crashes caused by FloatingOrigin script

Post by Interkarma »

Good to know thanks. The FloatingOrigin scripts could do with another pass anyway.

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: crashes caused by FloatingOrigin script

Post by Nystul »

the crash seems to be related to the update of the particles in function void UpdateParticles(Vector3 offset):
it does no longer happen on my system when commenting out these lines

Code: Select all

	int n = ps.GetParticles(particles);                
        for (int j = 0; j < n; j++)
	{
		particles[j].position += offset;
	}
	ps.SetParticles(particles, n);

User avatar
Interkarma
Posts: 7247
Joined: Sun Mar 22, 2015 1:51 am

Re: crashes caused by FloatingOrigin script

Post by Interkarma »

Thank you Nystul. :)

Post Reply