Autonomous Dynamically Simulated Creatures for Virtual Environments Paul Urban Supervisor: Prof. Shaun Bangay Honours Project 2001
Problem Statement Traditional keyframing is inappropriate for animating realistic creatures in virtual environments, because it is Specified laboriously at a low level Strictly scripted, unvarying Often physically unrealistic Divided into sequences which don’t splice smoothly
Aim Our aim is to create virtual creatures that Are self-animating Exhibit physically realistic motion Have unscripted behaviour Are responsive to their unpredictable environment
The Solution: Animats Our approach is to construct complete artificial animals (animats). We draw upon theory and results from Artificial Life Physically Based Modelling Autonomous Mobile Robots
Anatomy of an Animat Dynamical model point-masses, springs, joints Sensors speed, food Actuators springs, joints Control mechanism finite state machine
Theory: Dynamical model The body and the environment are both modelled as a dynamical (mechanical) system A dynamics engine Animates the body and environment according to Newtonian mechanics Operates in (or near) real-time
Theory: Sensors Simulation Sensor Control mechanism Simulation data about creature body and environment Sensor activation level [0..1] Processing
Theory: Actuators Simulation Actuator Command to update some parameter in the simulated body Actuator activation level [0..1] Minimal processing Control mechanism
Theory: Control Mechanism Actuators Activation levels Sensors Control mechanism Solve the “action selection” problem In this project, FSMs are used
Design Overview Dynamics engine Roobot creature –Experiment to evolve hopping motion Jellyfish creature –Underwater environment Quadruped creature
Design: Dynamics engine No dynamics engine existed in greatdane Design criteria: –Conceptually simple –Applicable to a large variety of systems –Easily extendable –Computationally inexpensive
Design: Dynamics engine Object oriented decomposition Major abstract classes: –PointMass (single mass particle) –Force (applies force to several objects) –DiscreteEvent (detects and handles short-lived events) –Integrator (advances a system through time according physical laws)
Design: Roobot Springs Point masses Floor Torques Angular joints Gravity
Design: Roobot: Control Phases in the hopping motion corresponds to states in a FSM Transitions triggered by sensor values Different feedback algorithm for each state
Problem: Stable Hopping The roobot is dynamically unstable There are (14) parameters in the control FSM Values for stable hopping are unknown Parameters interact unpredictably “Fitness landscape” is unknown
Design: Hop Evolution Experiment Genetic algorithm is used Search for optimal sets of parameters Keep the best set so far Generate new sets through mutation Evaluate according to a fitness criterion (time till falling + distance travelled) Select if it beats the old best, replace old best
Design: Jellyfish Point masses Springs Gravity Buoyancy Pulse force Steering force
Design: Jellyfish: Control Three behaviours –Actively swimming –Pulsing occasionally to maintain depth –Drifting (sinking) passively Steering towards food occurs every pulse Action selection mechanism switches between these as appropriate
Design: Underwater environment Simulated fluid medium Currents to suggest waves overhead Swaying seaweed Rising bubbles Falling rocks
Design: Quadruped Flat torso defined by 4 point masses and 6 supporting springs Four legs (various models attempted) Control mechanism was to be based on that used for the roobot
Implementation Overview Dynamics engine Roobot creature Jellyfish creature –Underwater environment Quadruped creature
Implementation: Dynamics engine Coded in Java Compiles to a shared library, links into greatdane applications A number of additional objects defined, including –PointMass: SpherePointMass –Force: Spring, joints, Gravity, fluids, Floor –DiscreteEvent: Floor –Integrator: RungeKuttaIntegrator
Implementation: Creatures Coded in Java Models built from point masses, springs, angular joints and torque (rotational) joints Strict use of Sensor and Actuator interfaces
Implementation: Roobot Telescoping leg Hip & hip joint Tail Head Foot & ankle joint
Implementation: Jellyfish Dome Tentacles Stages in the pulsing motion
Implementation: Underwater environment Rocks Bubbles Seaweed
Implementation: Quadruped Torso Legs Control spring(s) Quadruped with supporting springs
Quadruped Abandoned Three different leg designs were tried A 2-segment jointed leg model couldn’t stand – knee joints twisted A 1-segment jointed leg model flipped over onto its back A 1-segment leg model with supporting springs was too complex to control
Results Overview Dynamics engine Stable Hopping Roobots Jellyfish swimming in an underwater environment
Results: Dynamics engine Object oriented dynamics engine implemented Highly applicable to particle systems Some difficulty with jointed structures
Results: Stable Hopping Roobots Stable hopping motion was evolved after a few hundred generations Separate evolutions from same starting parameters yielded different motions
Results: Swimming jellyfish Several jellyfish swim in a simulated underwater environment Interesting, physically realistic motion is generated automatically
Observations Dynamic simulation automatically produces realistic motion The design process is complex –Dynamics knowledge is crucial –Lazy modelling is optimal
Conclusions Our “bottom-up” approach to creature modelling using animats is validated The design process is complicated Genetic algorithms can be used to generate motor controllers Our dynamics engine simulates particle systems well, but jointed structures are not well handled
Thank you! Question time…