UE Plugin

Blueprints

Node description & Code Overview

For most purposes, setting up according Installation and Setup to should be enough.

This is an ongoing document that we will fill with descriptions of the different nodes, their functionality, and/or parts of BPs and their description.

The central element of BP_coala is the loading and unloading of new areas.

The most important part happens in the node "On Gps Position Changed".

It collects the coordinates of new areas in range and creates the basic object for a request of that area.

USTRUCT(BlueprintType, meta=(HiddenByDefault))

struct BLANKPROJECT_API FCoalaRemoteTileRequest

{

GENERATED_BODY()

UPROPERTY(EditAnywhere, BlueprintReadWrite)

uint8 zoom;

UPROPERTY(EditAnywhere, BlueprintReadWrite)

int tile_x;

UPROPERTY(EditAnywhere, BlueprintReadWrite)

int tile_y;

FORCEINLINE bool operator != (const FCoalaRemoteTileRequest &other) const

{

return this->zoom!=other.zoom && this->tile_x!=other.tile_x && this->tile_y!=other.tile_y;

}

FORCEINLINE bool operator == (const FCoalaRemoteTileRequest &other) const

{

return this->zoom==other.zoom && this->tile_x==other.tile_x && this->tile_y==other.tile_y;

}

};

It also deletes all the areas, that are out of the buffer range.

Central part of each area is the UCoalaArea

UCLASS(BlueprintType)

class BLANKPROJECT_API UCoalaArea : public UBlueprintFunctionLibrary

{

GENERATED_BODY()

public:

UPROPERTY(EditAnywhere) UCoalaProperties* props;

UPROPERTY(EditAnywhere) TArray<UCoalaWater*> water;

UPROPERTY(EditAnywhere) TArray<UCoalaBuilding*> buildings;

UPROPERTY(EditAnywhere) TArray<UCoalaPOI*> pois;

UPROPERTY(EditAnywhere) UCoalaWeather* weather;

UPROPERTY(EditAnywhere) TArray<UCoalaCell*> grid;

UPROPERTY(EditAnywhere) TArray<UCoalaStreets*> streets;

UPROPERTY(EditAnywhere) class ACoalaAreaActor* sceneObject;

};

It holds the translated JSON information in the different named properties and the reference to the mesh object in the SceneObject.

The SceneObject allows easy debugging and groups the corresponding mesh actors.

For each new Area the BP_coala will send a COALA request.

After all new request have been sent, the player is moved by "Move Character"

For each new area the BP should receive an answer which starts the Mesh Generation:

Each mesh for each area is created in "Create Coala Meshes". After that is done the area will be added to the known areas and we provide two events a child could react on.

1) "AreaLoaded" : to react when a single area is loaded with the reference to the just loaded area.

2) "MapLoaded" : to react when all the areas are loaded for example to remove a loading screen when the game starts.