HEXUN.ZHANG

Generative Agents

Unreal EngineGenerative SimulationAgent-based modeling

This project is a population simulation developed in Unreal Engine, featuring a genetic system with 22 autosome pairs that determine inherited physical traits and a pair of sex chromosomes for gender determination. Additionally, the simulation integrates the Myers-Briggs Type Indicator (MBTI) to influence mate selection tendencies based on personality compatibility.

ToolsUnreal Engine
MethodologyOOP
Timeline2023 April 1st - May 1st
Scroll to discover

Inspiration

SAO

Destiny & Purpose

Sword Art Online Season 3 explores an adventure in a virtual reality game and introduces the concept of destiny. Destiny defines a virtual character's job and lifespan. The show's portrayal of the impact of virtual destinies inspired the incorporation of MBTI system to simulate character evolution.

Minecraft

Genetic Inheritance

Minecraft has a simple reproduction system. I believe this can be improved by passing on traits to offspring through genetic encoding in DNA while applying selection rules, which led me to develop this simulation.

Paper

Agent Behavior

The paper "Generative Agents: Interactive Simulacra of Human Behavior" introduces agents that simulate believable human behavior. This served as an inspiration for incorporating advanced interactions in this project.

Research

Genetics

Inherited Traits

In human reproduction, various characteristics are passed from parents to offspring. This project specifically focuses on physical traits to demonstrate these inheritance concepts.

Physical Traits

Key characteristics simulated include height, eye color, hair color and texture, skin color, facial features, and body shape.

Sex Linked Traits

These traits are determined by genes on the sex chromosomes (X and Y). These chromosomes determine biological sex, with females typically having two X chromosomes (XX) and males having one X and one Y (XY).

MBTI

Hypothesis of Compatibility

Insights derived from LLMs suggest that certain MBTI types may exhibit natural compatibility. Shared dominant functions can enhance mutual understanding, while complementary pairings may provide balance.

Audience & Application

Designed for game developers, educators, and researchers. The project is non-interactive and emphasizes leveraging genetic algorithms to explore immersive experiences.

Key Components

NPCs

Agents are separate entities with unique DNA, gender, and MBTI personalities. They dynamically build relationships by evaluating compatibility, age, and marital status, ensuring realistic social interactions.

Spawn Area

The origin point for the population, initializing agents with randomized genetics and MBTI types. This ensures initial diversity and establishes the gene pool for future generations.

AI Controller

A Behavior Tree system that orchestrates complex character actions like roaming, mate selection, and waiting. It coordinates with the environment to drive responsive and dynamic agent behavior.

Blackboard

A centralized data structure for the Behavior Tree, storing critical variables such as maturity status, potential mate visibility, and navigation targets to enable seamless decision-making.

Program Structure

structure

Progress Schedule

Phase 0.1.0

  • Spawn Character and Respawn Character
  • Random Character and Random Material Color
  • AI Behavior– Wonder & Stop Loop
v1

Demo Video v0.1

Phase 0.2.0

  • Store Information in each Character
  • Create an Array Variable, store all the Genes as constant key pairs
  • Create an Array Variable Trait and set it to Material Parameter of the Spawn
  • First Generation Spawns will have random Genes, Genes determine the Traits index
  • Physical Traits can be represent by material parameters

Phase 0.3.0

  • Create a Spawn Children Function that read Gene from their parents and generate Traits
  • Read parents information from actor reference passed in by the Pawn class
  • Spawn at Mother's location
  • Rule: O = recessive gene, 1 = dominant gene

Phase 0.5.0

Favor System:
  • Random MBTI match to list of MBTI favor type
Conditions:
  • is adult AND is NOT married find mate that also is adult AND is NOT married
  • Mates need to like each other, and are of different gender
  • After find one mate, stop finding other mate
  • After mates find each other, set them both to is married
  • After mates collide, delay 1 second and generate their child next to mother's location

Phase 0.6.0

Bug fixed:
  • child spawn with only one parent
Body growth:
  • Child born with small body size
  • Body size grow from age 0 to 18
Physical Trait:
  • Metal Brightness
v2

Demo Video v0.6

Blueprint Framework

blueprints

Final Behavior

fb1

At the start of the simulation, a predetermined number of agents are generated within the designated spawn area. Each agent is initialized with random gene pairs and a Myers-Briggs Type Indicator (MBTI). By default, agents engage in random movement within the environment.

fb2

As agents mature and reach a specific age threshold, they begin searching for potential romantic partners. This process involves evaluating nearby agents within their visual range based on several criteria: gender compatibility, age, preferred MBTI types, and marital status.

fb3

Offspring inherit gene pairs from their parents and are assigned a random MBTI type. Genetic traits determine appearance, with light/blue traits being dominant and dark/yellow recessive. The child grows from birth (age 0) to maturity at age 18, then enters the cycle of finding partners.