Evolving Game Development With Genetic Algorithms
Здраво Kevin Maes | What The Stack - September 14, 2024
Slide 2
Kevin Maes linkedin.com/in/kevinmaes
@kvmaes
Slide 3
Slide 4
Genetic Algorithms Adaptation in Natural and Arti cial Systems
“general theories of adaptive processes apply across biological, cognitive, social, and computational systems”
fi
John H. Holland
There’s a GA for that! • Designing ef cient network topologies • Automated software testing • Evolving game strategies • Scheduling Problems
fi
• Complex hardware design
Slide 7
States of a genetic algorithm
Slide 8
Population Initialization
Many “individuals” Each with a potential solution Stored in their “DNA”
Mutation • Need to maintain variation • Avoid “local optima” • Strive for the “global optimum” • Mutation rate • Mutation amount
Slide 13
Slide 14
Slide 15
oxomuseo.com
Slide 16
Museo Videojuego Malaga
Atari 2600
Nintendo
Slide 17
Slide 18
Slide 19
Slide 20
Slide 21
Egg drop
Slide 22
Egg drop
Slide 23
React + Konva
Slide 24
Konva
Slide 25
Konva
Slide 26
Game Mechanics • Who are the characters? • How will they move? • How will they interact? • How will the player interact with the game?
Slide 27
First Prototypes
Slide 28
Slide 29
Konva Tween
Slide 30
Slide 31
Slide 32
Slide 33
Slide 34
Slide 35
Konva Hit Detection • Pixel-level - User clicks, can include color detection • Bounding Box - Fast, less-precise • Shape-level - Basic shapes like rectangles, circles, polygons • Custom Hit Detection - Irregular or dynamic shapes • Group - Detects hits on any grouped objects <Group>…</Group>
Slide 36
Slide 37
state.new
Slide 38
state.new
state.new
Slide 39
Egg drop State machines
Slide 40
Egg drop State machines
Slide 41
Slide 42
Slide 43
Slide 44
Vector Graphics
Slide 45
Vector Graphics?
Slide 46
Slide 47
Slide 48
Slide 49
Slide 50
Konva Animation
Slide 51
Slide 52
Slide 53
Open AI Casting Call for Hens
Slide 54
Slide 55
Slide 56
Slide 57
Slide 58
Slide 59
Slide 60
Slide 61
Slide 62
Slide 63
Texture Packer
Slide 64
Slide 65
Slide 66
Slide 67
Slide 68
Slide 69
Slide 70
What about fonts? Arial in a game is so sad
Slide 71
Arco The quick yellow chick jumps over the lazy chef.
Slide 72
Arco The quick yellow chick jumps over the lazy chef.
Slide 73
Arco
Slide 74
Arco FOUT - Flash of unstyled text FOIT - Flash of invisible text FOFT - Flash of faux text
Slide 75
Arco
new FontFaceObserver(‘Arco’);
Slide 76
Slide 77
Second Game Video Here
Slide 78
Slide 79
Slide 80
Slide 81
Genetic Algorithm in Egg Drop
Slide 82
Hendividual
Slide 83
Slide 84
Evaluation & Fitness
Evaluate performance Reward behavior Punishment Weighted criteria
Hens that lay more eggs Hens whose eggs go uncaught Hens whose black eggs get caught Hens who don’t lay any eggs at all