Summary: I want to use procedural map generation based on semi-complete tiles. Think of a tile like a room/floor or something. The game is going to use a grid based movement system. Therefor the level designer need tools to mark which sections of the grid are accessible and which parts are not (something like a brush to easy mark grid sections as valid/not valid). There is some more work to do like placing objects, lights and waypoints and so on.
Now i’m able to show you what i want to achieve via screenshots. I’ve implemented some automatic collision mechanics to determine which grid tiles are “valid” and “invalid” in editor mode (screenshot 1: valid - green, invalid - red). This is something that has only to be done once the hole grid + assets are created (by the level designer) so i want to save the pre-computed and manually edited results (grid data stored in a TArray) inside a blueprint.
Workflow:
- Create “Room”-Actor (creates default grid data)
- Add meshes and other items as scene components to the actor.
- Automatically AND (later on) manually edit grid data (mark valid and invalid grid tiles)
- Create a Blueprint from Actor (to save the final room ready to use ingame)
As you can see on screenshot 2 the grid data is not saved as new “default” data for the TArray (if so it would not get a reset cause i did a check in code if the array is empty before filling it up with default valid flags). How can i achieve that respect the workflow above (or if it is not possible how to achieve it anyway)?
The grid data is defined as a TArray in an USTRUCT that is defined as member in the custom Room-Actor (the owner).
USTRUCT()
struct AESTUS_API FRoomTiles
{
GENERATED_USTRUCT_BODY()
[...]
UPROPERTY(EditAnywhere, BlueprintReadWrite)
TArray<uint8> Tiles;
[...]
};
UCLASS()
class AESTUS_API ARoom : public AActor
{
GENERATED_BODY()
[...]
UPROPERTY(EditAnywhere, BlueprintReadWrite)
FRoomTiles Tiles;
[...]
};
Screenshot 1
Screenshot 2