Download

LevelStreaming for "non first-person" view gameplay

Request based on processing of Streaming Levels for 3rd person/RTSview or another “non first person” projects.

**Description how i fixed/upgrade it for self. **
Every new release/preview i recompile full source specially for that feature with 3 simple lines of code.
2f731d4752f647d6ea6cfea1c79cb1cb5049f497.png

Function in LevelTick.cpp:


void UWorld::ProcessLevelStreamingVolumes(FVector* OverrideViewLocation)
{
...


Warning: That function has parameter OverrideViewLocation which provide location instead of camera view location, but that parameter never used in Engine! And i dont know how to use it without recompile EditorEngine.

So in that function, in loop of iterating of all available PlayerControllers , line :


FVector ViewLocation(0,0,0);


saves location of view in FVector ViewLocation.


PlayerActor->GetPlayerViewPoint( ViewLocation, ViewRotation );


//ViewRotation is Rotator and not used, so it is just for get orientation of view … for nothing )
And later that function has processing to check “every streaming volume” for encompasses of ViewLocation in volume.
bViewpointInVolume = StreamingVolume->EncompassesPoint( ViewLocation ) ;

And if ViewLocation is inside of volume (bool bViewpointInVolume==1) do load level (in short)…

So what i did for 3rd person character gameplay and why:

  1. Declare new var “PlayerLocation”
  2. Get location of player via PlayerActor->GetFocalLocation();
  3. And check both locations (Camera View and Player). Just add StreamingVolume->EncompassesPoint( PlayerLocation ) to bViewpointInVolume:

bViewpointInVolume = StreamingVolume->EncompassesPoint( ViewLocation ) |  StreamingVolume->EncompassesPoint( PlayerLocation );


And demonstration how it works now in my case with recompiled engine 4.15P3, what C++ changes in LevelTick.cpp and how Automatic Level Streaming works inside in editor viewport:
[video]https://youtu.be/uVyHxA65MSc[/video]

I did that specially for situation when camera distance so far from player character. For example when using cinematics (sequencer) which cameras sometimes far away from player and level always unloaded/loaded and character falldown. Or another example - when camera of 3rd person character outside of streaming volumes and you need always think in editor about what size of volume you need between rooms or top down views. Or in RTS style view… Platformers. Many examples with non first person camera view.

**Feature Request Description:
**

  1. Please upgrade LevelTick.cpp and add ability to provide new (or additional like in my case) location for checking it in level streaming volumes.

  2. Please add option in ProjectSettings for switch on/off that functionality. Or Checkbox (check player location additional). Or List with preset OnlyCameraView, CameraViewAndPlayer, OnlyPlayer.
    Screen Shot 2017-02-05 at 11.56.18 copy.png
    Any ideas about that option.

  3. And ability to provide engine own location from c++ source of project/plugin or BP. Access to OverrideViewLocation parameter for example.

Its very easy. Anyway I can help for describing if need.

Git. I can send pull request to git as well but i dont know whom to contact with.

Best regards.