Hi all,
I have an issue where lights produce these weird square shadows around them if I move them very far away from the world origin:
At world origin:
5km away from world origin:
10km away from world origin:
I am trying to make a train simulation game and the map is about 20km in size.
If anybody has a workaround or solution for this, any help would be much appreciated!
Many thanks in advance
I frumbled around with various lighting and shadow settings with this one, to no avail.
One thing you can do, though, is use:
I don’t know what you have ( or the engine has ) that will get screwed up by this. But if defintely works. I just set the origin somewhere local.
Firstly, thank you for trying to help!
I tried setting the world origin to my player’s location, which worked on begin play, but I couldn’t get it to work correctly at all when activated with a key; my player just gets destroyed and my AI passengers stop moving. Am I using this correctly? See below:
I did it with a key, it worked fine. Just tried it again.
Not pretty on tick though
I assume moving the origin might screw up AI, you might have to somehow restart it or reset after movng the origin.
BTW, there is also:
EDIT: Was looking at this a bit more, you might need to do some background reading.
I see the option in the world settings ‘Enable world origin rebasing’, it’s greyed out.
I also see people talking about other problem including animations scaling strangely ( got that? ) at great distances.
I think you might need to look into world composition, where you do have one big map, but it’s made out of many sublevels. World composition assumes origin rebasing ( I think ).
Another way out is to use streaming and not stray too far from 0,0,0.
Thank you for looking further into this,
I did manage get the manual origin rebasing method you showed me working by forcing the navigation data to refresh, but seems to completely destroy my physics based camera I have for the train and seems to have unpredictable results (e.g. the AI sometimes wouldn’t find a valid path).
I just had a brief look into world composition, which seems to be designed for landscapes (which I am not using for most of the route), however after enabling wold composition and origin rebasing, it does seem to fix the lighting after I have travelled a long distance or if the game begins somewhere far from the default world origin, but I can’t seem to control how often the origin is rebased through this system. However, it doesn’t seem to cause any of the issues that that come with manual rebasing. I will continue to look into world composition and try to find a way of getting more control over when the origin is rebased.
I think ( never used it ) that although world composition is often used for landscapes, it’s also a general method of dividing a large world into chunks ( held in maps ) which are loaded in realtime. You also have the rebasing.
With level streaming volumes, it’s loading in realtime, but I don’t think it deals with the origin problem. If you did it with level streaming it would need to be blueprint based and all levels would be loaded at the origin. You could use the tunnels as an excuse to stream.