I have looked over many similar questions, the most helpful was probably [ this one] (https://answers.unrealengine.com/questions/758130/view.html)
and I have seen it work here
Unfortunately after many days and crashes I think I have to ask some smarter people here and hope someone from Epic could share some knowledge on the subject.
I am new/intermediate when it comes to UE4 C++, but
so far I have managed to successfully (I think?) create a world and spawn an actor inside it.
and
The results:
The world gets created and the actor spawns
I can even look at it in the outliner:
The Problems
The spawned actor has physics enabled, but it doesn’t move and the actor does not receive any Tick() calls.
I hoped that calling RegisterAllActorTickFunctions(true, true) would take care of that, but it didn’t. (Turns out Actor probably calls it anyways when it’s spawned)
Also, I reached the point at which Stopping Play now causes a crash probably because of me being stupid somewhere and not properly getting rid of the world and context…
I dug through tons of code, downloaded 26 Gb of debug symbols to see what is happening, probably read all of World.h/.cpp 3 times (probably not enough), bits of GameEngine.h/.cpp, Actor.h/.cpp and loads of documentation pages about Actor lifetime to get to this point, but I think I reached my limit.
I think I am doing something completely wrong here, am I going in the right way?
Why is the Tick() not getting called on the actor (yes i have a print string on it and it’s connected)?
Is this how one would go about making multiple UWorlds and how should switching actors between them work?
**The reason for all of this: **
I had an idea for a multiplayer game that requires large distances, but I quickly found that the limitation is the physics engine because of floating point precision at larger distances.
Rendering is not an issue as clients can locally shift the world origin once they pass some distance from it.
The server however can not just shift the whole world as players can be anywhere.
The solution I came up with is to divide the one UWorld into many - each would cover a different area, some areas could always be there while others could be spawned on demand.
Players/clients would be moving from sector to sector on the server while locally only having their one world and everything they can see replicated - one of the limitations mentioned is replication, I thought to hook up secondary worlds to the main world NetDriver causing both worlds to “overlap” and replicate on the same connections effectively “merging” them which is exactly what I wanted - no matter which world the player would be, he would get replicaton data from them all, the only thing left would be to remove actors from different distant worlds from replicating.
Yes this is quite a complex idea, probably not going to do it in a week/month/year, but I have some spare time and like to learn/code and would really like to get to know the engine more than just sticking with blueprints and “basic” C++.
If there is a different way of having lets say an area of 100x100 km without multiple worlds or scaling things down a lot and risking them going straight through eachother - I would like to know that way.
That being said I really hope someone from Epic that knows these parts of the engine gets to see this and could give me/us some details, also I noticed that they made a survey around the making the documentation better, so maybe they could add this to the list of “To be documented”.
Also, English is not my first language, sorry for any typos/mistakes.