Community Tutorial: ChatGPT + DataTables in Unreal Engine

:rocket: Want to take procedural generation in Unreal Engine to the next level? In this tutorial, we’ll harness the power of ChatGPT and DataTables to dynamically generate and place elements in your game world! :video_game:

You’ll learn how to:
:white_check_mark: Use ChatGPT to generate positional data for procedural elements
:white_check_mark: Integrate AI-driven placement with Unreal Engine’s DataTables
:white_check_mark: Create a dynamic and ever-changing game environment

Perfect for level designers, indie devs, and anyone looking to add a smart twist to procedural generation. Let’s push the boundaries of AI-assisted game design together! :fire:

https://dev.epicgames.com/community/learning/tutorials/xBnJ/chatgpt-datatables-in-unreal-engine

Related to topic (will watch tut in a bit):

Few days ago i had talk with my yellow rubber duck (ie ChatGPT), about procedural random that can be done in unreal material only. And it suggested to do random based on mesh/object world location.
This is HLSL formula:

float3 Pos = WorldPosition.xyz;
float seed = dot(Pos, float3(12.9898, 78.233, 45.164));
float rand = frac(sin(seed) * 43758.5453);

it is some well known and used formula, those numbers were carefully picked for better randomness.

That random made in materials only, it would be same per every pixel in material (as long as location of object is same). So it is great for making random variants of dirt, detail, colors, rotation for materials without need of instanced dynamic materials or blueprints etc.

same for C++:

float RandomFromVec3(const FVector& Vec)
{
    float dot = Vec.X * 12.9898f + Vec.Y * 78.233f + Vec.Z * 37.719f;
    float sinVal = FMath::Sin(dot);
    float frac = sinVal * 43758.5453f;
    return frac - FMath::FloorToFloat(frac); // fract
}

Super nice, you just blew my mind :exploding_head:, mixing PGM and ChatGPT. Oh my god, I was already using ChatGPT to fill in gameplay datatables, but this combination…opens up a whole new world for map creation.