Unreal Enginegenerative simulationagent-based modeling

Generative Agents


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.


Tools Unreal Engine
Methodology OOP
Timeline 2023 April 1st - 2023 May 1st
Scroll to discover

Inspiration

inspiration SAOSword Art Online Season 3 explores an adventure in a virtual reality game and introduces the intriguing concept of destiny. Destiny defines a virtual character's job and the lifespan of an item, providing a fascinating layer of depth to the virtual world. The show's portrayal of the impact of virtual destinies on character development and interaction inspired the incorporation of MBTI system in my project to simulate character evolution and variation.
inspiration MCMinecraft has a simple reproduction system for animals and villagers. While the game's system allows for basic reproduction, there is a lack of variation in behavior and evolution through reproduction. 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 my population simulation that incorporates genetic algorithms to drive innovation in game mechanics.
inspiration PaperThe paper "Generative Agents: Interactive Simulacra of Human Behavior" introduces the concept of generative agents that use a novel architecture to simulate believable human behavior. This idea can be applied to various domains, offering a more sophisticated approach to simulating human behavior in a virtual environment. This paper served as an inspiration for incorporating advanced agent behavior and interactions in this project.

Research

Inherited traits

In human reproduction, a variety of traits and characteristics are inherited from the parents. This project focuses exclusively on the inheritance of physical traits to demonstrate the concept.

Physical traits

Height, eye color, hair color and texture, skin color, facial features, body shape, and other physical characteristics.

Sex Linked Traits

Sex-linked traits are those whose genes are located on the sex chromosomes. In humans and many other organisms, these are the X and Y chromosomes. These chromosomes play a key role in determining the sex of an individual: typically, females have two X chromosomes (XX), and males have one X and one Y chromosome (XY).
Dominant vs Recessive.png

Hypothesis of Compatibility

Insights derived from large language models (LLMs) suggest that certain MBTI types may exhibit natural compatibility, particularly when they share the same dominant cognitive function (e.g., both emphasizing Thinking or Feeling). This shared focus can enhance mutual understanding and promote more harmonious interactions. Conversely, complementary pairings (e.g., an Introverted type with an Extraverted type) may provide a balancing dynamic, fostering mutual growth and supporting the development of a well-rounded and harmonious relationship.
8MBTI.png

Audience & Application

This project is designed for game developers, educators, researchers, and enthusiasts with a keen interest in virtual worlds and the intricate interactions among their inhabitants. Focusing on character development, the project is non-interactive and emphasizes leveraging genetic algorithms and advanced agent behavior to explore the potential for creating immersive and compelling experiences.

Key Components & Functions

Non-Player Characters (NPCs): Each NPC is defined by a unique genetic profile (DNA), gender, MBTI personality type, a preferred MBTI compatibility, and a predetermined lifespan. NPCs dynamically form romantic partnerships by evaluating specific conditions, including age, marital status, and compatibility with their preferred MBTI type, ensuring realistic and context-sensitive interactions.

Spawn Area:

The Spawn Area serves as the starting point for generating the initial population, embedding randomized genetic information that determines physical traits and gender. Subsequent generations inherit genetic traits from their parent entities, ensuring continuity and variation in the population. Both the initial and subsequent generations are assigned random MBTI types, which influence their personality profiles. A character's preferred MBTI types are aligned with their own MBTI classification, shaping interpersonal dynamics and mate selection behaviors within the simulation.

AI Controller and Behavior Tree:

The AI Controller, integrated with a Behavior Tree, orchestrates character behavior, including activities such as roaming, mate selection, and post-marriage waiting periods. This system seamlessly interacts with the Spawn Area and Pawns to ensure coordinated and dynamic character actions, enabling a robust and responsive AI-driven environment.

Blackboard:

The Blackboard component serves as a centralized data structure for storing variables critical to the operation of the behavior tree that governs character behavior. These variables include attributes such as adulthood status, visibility of potential mates, and coordinates for roaming and mating targets, ensuring seamless decision-making and dynamic character interactions.

Program Structure Prototype

program structure.png

Project Progress Schedule

Phase 0.1.0: - Spawn Character and Respawn Character- Random Character and Random Material Color- AI Behavior– Wonder & Stop Loop

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
video demo 2.png

demo video v0.6

Phase 0.6.0:

Bug fixed:- child spawn with only one parentBody growth:- Child born with small body size- Body size grow from age 0 to 18Physical Trait:- Metal Brightness
timeline.png
video demo 1.png

demo video v0.1

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 locationRule:- 0 = recessive gene, 1 = dominant gene

Phase 0.5.0:

Favor System:- Random MBTI match to list of MBTI favor typeConditions: 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

Blueprint Framework

blueprints.png

Final Behavior

final behavior 1.pngAt the start of the simulation, a predetermined number of agents are generated within the designated spawn area. Each agent is initialized with a random set of gene pairs and a Myers-Briggs Type Indicator (MBTI) personality type. By default, agents engage in random movement within the environment.
final behavior 2.pngAs 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. If two agents satisfy all conditions, they approach each other and reproduce.
final behavior 3.pngOffspring inherit gene pairs from both parents and are assigned a randomly generated MBTI type. These genetic traits determine the child's gender and physical appearance, such as body color, with light and blue traits being dominant, and dark and yellow traits being recessive. The child initially has a smaller body size, which gradually grows from birth (age 0) to maturity at age 18. Once reaching adulthood, the offspring enter the next cycle, participating in the search for romantic partners and forming new pair bonds.

Let's work together.

I'm currently available for freelance work and open to discussing new projects.