Two AIs Learn to Collaborate to Fight Zombies — Transcript
Full transcript
- 0:00In the previous episode, we met Gary,
- 0:02our AI gladiator. He was able to fight
- 0:05up to 16 zombies at the same time thanks
- 0:08to a fearsome technique, a perfect parry
- 0:10followed by a backstab.
- 0:12>> [groaning]
- 0:13>> But despite his prowess, Gary ended up
- 0:15overwhelmed by the horde.
- 0:21So today, he won't be fighting alone in
- 0:23the arena anymore.
- 0:25It's time to get a little help.
- 0:27And that help is Larry.
- 0:35Thanks to everyone for all the name
- 0:37ideas in the comments.
- 0:39It was very inspiring. Now, the only
- 0:42question is whether they can work
- 0:44together to take on the horde.
- 0:47What brilliant strategies could possibly
- 0:49emerge from these two incredible
- 0:51fighters?
- 0:56For deeper immersion, I completely
- 0:58reworked the arena's ground system. The
- 1:00sand is made up of hundreds of thousands
- 1:02of particles that can be moved and
- 1:04tinted. I also fully overhauled the
- 1:07physics of the virus projections.
- 1:13A diffusion mechanism lets all the
- 1:15traces dissipate naturally.
- 1:18What I really like is that the arena
- 1:20floor tells a story all on its own.
- 1:23Now, let's see how our two heroes do in
- 1:25this all new environment. There's
- 1:27nothing like a good zombie fight to
- 1:29break the ice.
- 1:33After 2 minutes, progress is looking
- 1:35pretty good. Let's see how the boys are
- 1:37doing.
- 1:45>> [groaning]
- 1:46>> Unfortunately, Gary has never had a
- 1:47friend and he's not quite sure how to
- 1:50handle it. Even worse, his brain isn't
- 1:53wired for friendship.
- 1:55Gary will need to learn trust and love
- 1:57if he's going to succeed.
- 1:59I had to rewrite the entire simulation
- 2:01to introduce the concept of allies and
- 2:04make the whole system more generic.
- 2:07Until then, I was using ray casting for
- 2:09perception. The advantage is that the
- 2:12number of observations is fixed, but
- 2:14there are several drawbacks.
- 2:16The number of inputs is very high with
- 2:18either many missing values or a huge
- 2:20amount of redundancy. On top of that,
- 2:23[music]
- 2:24detection is also quite imprecise.
- 2:27The new system is based on the proximity
- 2:29of surrounding entities. The 10 nearest
- 2:32ones are included and fed into the
- 2:34neural network. Perhaps a mix of the two
- 2:36systems could be used. This is something
- 2:39I'm still exploring.
- 2:40Of course, the rewards also need to be
- 2:43adjusted to explicitly penalize attacks
- 2:45between allies. Let's run the training
- 2:47again hoping that we can observe the
- 2:49early signs of collaboration. AI is
- 2:52playing a growing role in my projects,
- 2:54especially when it comes to reviewing my
- 2:56code or researching deep technical
- 2:58topics like how to adapt PPO to a
- 3:01multi-agent problem. The challenge is
- 3:03that different AI models excel at
- 3:05different tasks and subscriptions are
- 3:07not cheap. That's why I use Mammoth AI,
- 3:10which brings a wide range of models
- 3:12together under one subscription. It
- 3:14gives me much more flexibility in how I
- 3:16use my credits.
- 3:18For my projects, I mainly use deep
- 3:20search to quickly get up to speed on a
- 3:22topic or exploit in more depth.
- 3:24Perplexity is great for this, delivering
- 3:26detailed well-sourced reports in just a
- 3:29few minutes.
- 3:30Opus 5.5 excels at coding questions and
- 3:33explaining research papers, while GPT-6
- 3:36is my go-to [music] for lighter, quicker
- 3:38research. Mammoth gives me access to all
- 3:41of these services for $10 a month.
- 3:44You can also create custom Mammoths for
- 3:46recurring tasks. For example, I've set
- 3:48up a code reviewer, a researcher, and an
- 3:50English translator.
- 3:52If you want to cut your subscription
- 3:54costs while accessing all the frontier
- 3:56models, try Mammoth starting at $10 a
- 3:59month when billed annually. Thanks again
- 4:01to Mammoth AI for their support.
- 4:04Let's get back to training and see
- 4:06whether the new reward improves the
- 4:08situation. This interface let me monitor
- 4:10training progress, especially through
- 4:12the event logger, which provides a
- 4:14glimpse into the agent's capabilities.
- 4:17>> [music]
- 4:17>> After 100 iterations, let's quickly
- 4:20check whether our two companions are at
- 4:22each other's throats before we continue
- 4:24training.
- 4:28>> [groaning]
- 4:31>> It's obviously still far from perfect,
- 4:34but things between them already seem
- 4:36much calmer. We can also see that
- 4:38they're managing to pull off a few
- 4:39perfect parries. Let's hope it stays
- 4:42that way and get back to training.
- 4:56The perfect parries seem to be pretty
- 4:58well mastered and we're starting to see
- 5:00a few backstabs from time to time. Let's
- 5:02take a closer look.
- 5:22It's definitely much better already.
- 5:25Gary and Larry are far less reckless and
- 5:27manage to block many more hits. However,
- 5:30they are quite uncomfortable when they
- 5:31get close. It feels like they are
- 5:33getting in each other's way.
- 5:35Clearly,
- 5:36basic safety practices are not being
- 5:39followed at all and inevitably an
- 5:41accident eventually happens.
- 5:48Despite a few minor mistakes and thanks
- 5:50to Larry's courageous sacrifice,
- 5:52they make it through the wave. That's a
- 5:54good start, but there's still a long way
- 5:57to go.
- 6:15>> [groaning]
- 6:22>> After 1,200 iterations, progress is
- 6:25significant. Barriers are becoming more
- 6:27frequent, and our gladiators clear the
- 6:29wave without any trouble. However, I
- 6:32think there's a problem with the
- 6:33rewards. Nothing really compensate for
- 6:35the prospect of hurting an ally. Staying
- 6:38close doesn't do much for the agents
- 6:40other than giving them a chance to try
- 6:42to steal each other's points.
- 6:44>> [groaning]
- 6:45>> To counterbalance this, [music] I
- 6:47decided to add an assist mechanic. Two
- 6:49situations qualify as an assist.
- 6:51Attacking a zombie that has been stunned
- 6:53by an ally, or attacking an enemy that
- 6:56is targeting an ally. In addition, any
- 6:59elimination achieved during an assist
- 7:00grants the same rewards to both agents.
- 7:03To force Gary and Larry to target the
- 7:05same enemy, I'll start by having them
- 7:07face a single zombie. That will prevent
- 7:09them from splitting up at the start of
- 7:11the fight if the zombies are not grouped
- 7:13together.
- 7:15Let's take a quick look at where things
- 7:17stand after 200 iterations.
- 7:32The agents have turned into a pair of
- 7:34zombie-bashing bullies.
- 7:36It's an original strategy, though
- 7:38unfortunately, it also involves beating
- 7:40up their allies. And it isn't very
- 7:43effective at racking up eliminations.
- 7:45When it come to proximity, however, it's
- 7:48a resounding success.
- 7:50Let's see whether we can develop a
- 7:51slightly more refined approach going
- 7:53forward.
- 7:57Soon after, eliminations start chaining
- 7:59together, and the score literally
- 8:01skyrockets.
- 8:17>> [groaning]
- 8:26>> The progress really is impressive.
- 8:29The agents are far more effective at
- 8:30eliminating threats, and we can see that
- 8:33they show a great deal of restraint
- 8:35toward one another.
- 8:53Progress will continue more slowly until
- 8:56it reaches a plateau after 600
- 8:57iterations. Let's see how that goes.
- 9:14The method is now finally honed, and the
- 9:17zombies barely get a chance to do
- 9:19anything. There is the occasional bit of
- 9:21friendly fire between Gary and Larry,
- 9:24but that's surely just good camaraderie.
- 9:26It's almost become too easy. Let's bump
- 9:28up the number of zombies they're facing.
- 9:33Let's see how they fare against four
- 9:36zombies.
- 9:37They do attempt to cover each other, but
- 9:40the two fighters are quickly overwhelmed
- 9:42and eliminated within seconds.
- 9:45It's a rather tough start for them, but
- 9:47it's also a situation they've never
- 9:49faced before.
- 9:51Let's give them a little time to get
- 9:53used to this new setup.
- 9:57Fairly quickly, the agents adapt and the
- 9:59score shoots back up. However, what's
- 10:02happening here is a textbook example of
- 10:05the deviousness of optimization
- 10:07algorithms. They're a bit like evil
- 10:09genies.
- 10:10We ask them for something and they grant
- 10:13it in the absolute worst way possible.
- 10:16Here's what Gary does when asked not to
- 10:18hurt his teammate during fights.
- 10:24>> [groaning]
- 10:27>> Uh
- 10:28no ally
- 10:30no damage to ally.
- 10:32And this is not a one-off. It's
- 10:35systematic.
- 10:38On top of that, he's actually pretty
- 10:39good. He's quite capable of controlling
- 10:41the group of zombies and then stabbing
- 10:43them one by one. Once we bumped it up to
- 10:46four zombies, paying the price of
- 10:48betrayal became more profitable. He
- 10:50could rack up points four times as fast
- 10:53rather than share them and risk getting
- 10:55constantly punished whenever an accident
- 10:57happened.
- 10:58At that point, I was a bit stuck because
- 11:01I couldn't find a way to get the agents
- 11:03to cooperate. My attempts had even had
- 11:06the exact opposite effect. The missing
- 11:08piece came from an OpenAI paper about
- 11:10their famous Dota playing AI.
- 11:13Of course, the agents had to work
- 11:15together and one of the things OpenAI
- 11:17tried was giving them a shared reward.
- 11:20That should solve my problem. If Gary
- 11:22takes out an ally, he misses out on a
- 11:24big reward bonus.
- 11:26With this new system, after 200
- 11:28iterations, there were no dubious
- 11:31strategies. They seem to be playing by
- 11:33the rules.
- 11:35However, there is no real attacks or
- 11:37signs of cooperation, but it's still
- 11:40very early.
- 11:41>> [groaning]
- 11:50>> Very quickly, the attacks begins to
- 11:52reappear.
- 11:53But the most interesting part is yet to
- 11:55come.
- 12:04Something very cool is happening here.
- 12:06Gary pushes an enemy towards Larry, who
- 12:09can then eliminate it instantly.
- 12:12In fact, this is the first glimmer of
- 12:15teamwork. Finally.
- 12:30This pattern clearly didn't escape them,
- 12:33and even though it's still quite
- 12:34hesitant, the intention is now
- 12:37unmistakable.
- 12:56After 1,500 iterations, their mastery is
- 13:00much better, and they clear the wave
- 13:02with ease.
- 13:03However, the agents are clearly not very
- 13:06economical with their attacks. They just
- 13:08strike widely and continuously. To force
- 13:11them to be more precise, I added an
- 13:13energy pool that every action draws
- 13:15from. This new addition clearly didn't
- 13:18sit well with our two heroes, who
- 13:20quickly ran out of energy and were swept
- 13:23aside.
- 13:31>> [groaning]
- 13:33>> Adaptation is very quick, however, and
- 13:35they are becoming much more economical
- 13:37with their attacks.
- 13:55A thousand iterations later, they have
- 13:58become killing machines.
- 14:02To make things more challenging, I'll
- 14:04double the energy cost of attacks and
- 14:06half the regeneration rate. Successfully
- 14:09performing a perfect parry restores 20%
- 14:12of the energy.
- 14:18Clearly, we're going to have to learn to
- 14:20parry a bit more.
- 14:27This time, adaptation takes longer.
- 14:29After 600 iterations, they are many
- 14:32learning to buy their time and operate
- 14:34more efficiently.
- 14:35>> [groaning]
- 14:44[groaning]
- 14:47>> Gary, however, pulls off a super perfect
- 14:49parry at the end, which is an excellent
- 14:52signal.
- 14:55>> [groaning]
- 15:01>> A little later, they clearly grasped the
- 15:04value of the perfect parry and use it
- 15:05whenever they run low on energy. The
- 15:08execution is still a bit hesitant, but
- 15:10it's an excellent direction.
- 15:21>> [groaning]
- 15:26[groaning and screaming]
- 15:32>> 13 minutes later, the strategy is nearly
- 15:35flawless. The two cooperate seamlessly
- 15:38and dispatch eight zombies with ease.
- 15:41From here on, I'll disable all secondary
- 15:43rewards and keep only eliminations. So,
- 15:47they stay focused on what matters most.
- 15:49I'll also gradually add more zombies to
- 15:51see just how far Gary and Larry can go.
- 16:38>> [groaning]
- 17:17>> Uh!
- 17:19Huh!
- 17:22Uh! Huh!
- 17:23Uh!
- 17:25Huh!
- 17:28Huh!
- 17:29Huh!
- 17:30Uh! Huh!
- 17:34>> [groaning]
- 17:34>> Huh!
- 17:36Huh!
- 17:36Huh!
- 17:40Huh! Uh!
- 17:43Uh!
- 17:46>> [groaning]
- 17:46>> Huh!
- 17:48Uh!
- 17:50Uh!
- 17:52>> [groaning]
- 17:53>> Uh!
- 17:57Huh!
- 18:00Huh!
- 18:00>> [groaning and screaming]
- 18:03>> Huh!
- 18:05Huh!
- 18:08Uh!
- 18:09Huh! Huh!
- 18:12Huh!
- 18:15Huh!
- 18:18Uh!
- 18:21Uh!
- 18:22Uh!
- 18:25Uh!
- 18:27Huh!
- 18:28>> [groaning]
- 18:28>> Huh!
- 18:30Uh!
- 18:32Uh!
- 18:35Uh!
- 18:45Uh!
- 18:48Uh!
- 18:51Uh!
- 18:53HUH!
- 18:56HUH!
- 19:01>> [groaning]
- 19:01>> HUH!
- 19:02UH!
- 19:05HUH!
- 19:12HUH!
- 19:14HUH!
- 19:15>> [groaning]
- 19:20[groaning]
- 19:29[groaning]
- 19:39[groaning]
- 19:45[groaning]
- 19:58[groaning]
- 20:46[groaning]
- 20:52>> GETTING THE TWO AGENTS TO collaborate
- 20:54was no small feat. Still, I'm very
- 20:56pleased with the result.
- 20:58And I would like to try it with far more
- 21:00than just two fighters.
- 21:02Also, for the next stage of the project,
- 21:04I'm looking for someone to create
- 21:06sprites. Anyone with skills in sprite
- 21:08animation, pixel art or otherwise is
- 21:11welcome to contact me on Discord or by
- 21:13email. All of the details are in the
- 21:15description.
- 21:16A huge thanks to all the Patreon members
- 21:19for their support and to Mammoth AI.
About this transcript
This page contains the full transcript of Two AIs Learn to Collaborate to Fight Zombies by Pezzza's Work, generated from the public captions YouTube serves with the video. The transcript has 1,952 words across 385 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.