(转) Playing FPS games with deep reinforcement learning

简介: Playing FPS games with deep reinforcement learning  博文转自:https://blog.acolyer.org/2016/11/23/playing-fps-games-with-deep-reinforcement-learning/...

 

Playing FPS games with deep reinforcement learning

 

 

博文转自:https://blog.acolyer.org/2016/11/23/playing-fps-games-with-deep-reinforcement-learning/

 

When I wrote up ‘Asynchronous methods for deep learning’ last month, I made a throwaway remark that after Go the next challenge for deep learning systems would be to win an esports competition against the best human teams. Can you imagine the theatre!

 

Source: ‘League of Legends’ video game championship is like the World Cup, Super Bowl combined – Fortune:http://fortune.com/2015/10/29/league-of-legends-video-game-championship/

Since those are team competitions, it would need to be a team of collaborating software agents playing against human teams. Which would make for some very cool AI technology.

Today’s paper isn’t quite at that level yet, but it does show that progress is already being made on playing first-person shooter (FPS) games in 3D environments.

In this paper, we tackle the task of playing an FPS game in a 3D environment. This task is much more challenging than playing most Atari games as it involves a wide variety of skills, such as navigating through a map, collecting items, recognizing and fighting enemies, etc. Furthermore, states are partially observable, and the agent navigates a 3D environment in a first-person perspective, which makes the task more suitable for real-world robotics applications.

Lample and Chaplot develop an AI agent for playing death matches. I’m not really an FPS kind of person, and had no idea what a deathmatch was. It turns out to be a scenario in which the objective is to maximize the number of kills by a player/agent. Nice. The agent uses separate neural networks for navigation tasks and for action tasks. Experimentation is done using the VizDoom framework for developing AI bots that play Doom. It turns out there’s even been a recent VizDoom competition, with the ‘full deathmatch’ category won by a team from Intel Labs. Here’s a video of their entry in action:

Deep Recurrent Q-Networks

The core of the system is built on a DRQN architecture (Deep Recurrent Q-Network). A regular Deep-Q network, such as that used to play Atari games, receives a full (or very close to full) observation of the environment at each step. But in a game like DOOM where agent’s field of view is limited to 90 degrees centred around its position it only receives apartial observation.

In 2015 Hausknecht and Stone introduced Deep Recurrent Q-Networks which include an extra parameter at each step representing the hidden state of the agent. This can be accomplished by layering a recurrent neural network such as an LSTM on top of a normal DNQ network.

Two models

In a deathmatch, you need to explore the map to collect items and find enemies, and then you need to fight enemies when you find them. Lample and Chaplot use two networks, one for navigation, and one for action. The current phase of the game (and hence which model to use at any given time) is determined by predicting whether or not an enemy is visible in the current frame (action model if so, navigation model otherwise).

There are various advantages of splitting the task into two phases and training a different network for each phase. First, this makes the architecture modular and allows different models to be trained and tested independently… Furthermore, the navigation phase only requires three actions (move forward, turn left, and turn right), which dramatically reduces the number of state-action pairs required to learn the Q-function and makes training much faster. More importantly, using two networks also mitigates ‘camper’ behaviour, i.e. the tendency to stay in one area of the map and wait for enemies, which was exhibited by the agent when we tried to train a single DQN or DRQN for the deathmatch task.

Training

When trained using a vanilla DRQN approach, agents tended either to fire at will, hoping for enemies to wander into their crossfire, or not fire at all when given a penalty for using ammunition. This is because the agent could not effectively learn to detect enemies. To address this, the team gave the agent additional information that it could use during training (but not during actual gameplay or testing). At each training step, in addition to receiving a video frame, the agent received a boolean value for each entity (enemy, health pack, weapon, ammo and so on) indicating whether or not it appeared in the frame.

We modified the DRQN architecture to incorporate this information and to make it sensitive to game features. In the initial model, the output of the CNN is given to a LSTM that predicts a score for each action based on the current frame and its hidden state. We added two fully-connected layers of size 512, and k-connected to the output of the CNN, where k is the number of game features we want to detect… Although a lot of game information was available, we only used an indicator about the presence of enemies on the current frame.

Jointly training the DRQN model and the game feature detection allows the kernels of the convolutional layers to capture relevant information about the game with only a few hours of training needed to reach an optimal enemy detection accuracy of 90%.

The reward function for the action network includes:

  • positive rewards for kills
  • negative rewards for suicides
  • positive rewards for picking up objects
  • negative rewards for losing health
  • negative rewards for shooting or losing ammo

The navigation network was simply given a positive reward for picking up an item, and a negative reward for walking on lava.

A frame-skip of 4 turned out to be best overall balance between training speed and performance (the agent receives a screen input every 4+1 frames, and the action decided by the network is repeated over all the skipped frames). During back-propagation, only action states with enough history to give a reasonable estimation are updated.

Fighting! (evaluation)

Evaluation is done using the delightful kill to death ratio (K/D) as the scoring metric. Table 2 below shows how well the agent performed both on known maps (limited deathmatch) and on unknown maps (full deathmatch).

 

You can watch the agent play in these videos.

Here’s how it stacks up against human opposition:

 

The authors conclude:

In this paper, we have presented a complete architecture for playing deathmatch scenarios in FPS games. We introduced a method to augment a DRQN model with high-level game information, and modularized our architecture to incorporate independent networks responsible for different phases of the game. These methods lead to dramatic improvements over the standard DRQN model when applied to complicated tasks like a deathmatch. We showed that the proposed model is able to outperform built-in bots as well as human players and demonstrated the generalizability of our model to unknown maps. Moreover, our methods are complementary to recent improvements in DQN, and could easily be combined with dueling architectures (Wang, de Freitas, and Lanctot 2015), and priorized replay (Schaul et al. 2015).

相关文章
|
6月前
|
人工智能 调度 SEO
内容型OPC:一个人如何借助智能体做全平台内容
内容型OPC入门门槛低,核心在于选题判断力与智能体调度能力。借助选题、写作、优化、分发四类智能体提效,但关键在人把控质量:自主定方向、审校改终稿。案例显示,一人可多号运营,实现引流—社群—闭环。AI辅助,人定调、智执行、人验收。(239字)
|
12月前
|
数据采集 安全 前端开发
堪比Log4j!Next.js CVSS 10.0漏洞席卷39%云环境,这些场景已成为攻击重灾区
CVSS评分10.0的Next.js高危漏洞正席卷全球,波及39%云环境。无需认证、利用简单,攻击者可远程执行代码,窃取数据、植入后门。关联React漏洞CVE-2025-55182,启用App Router的公网项目成重灾区。企业须立即排查资产、部署WAF、升级至安全版本,24小时内完成应急防护,严防大规模攻击。
|
7月前
|
存储 缓存 人工智能
缓存输入便宜120倍,DeepSeek V4 怎么做到的
DeepSeek V4创新采用CSA+HCA混合注意力架构,支持1M超长上下文,并通过KV缓存压缩、磁盘存储与智能命中复用,大幅降低prefill成本。其Pro版未命中/命中输入价差达120倍,显著高于竞品,真正实现长上下文“又便宜又高效”。
1559 0
缓存输入便宜120倍,DeepSeek V4 怎么做到的
|
11月前
|
人工智能 中间件 API
【架构最佳实践】大模型落地的隐形英雄:为何企业级应用必须引入“AI调度官”?
本文提出“AI调度官”架构,作为连接业务与模型的智能中间件,在阿里云环境下实现模型路由、流量分发与成本优化。通过意图识别、动态调度与熔断降级,平衡智能与成本,助力企业构建高性价比的生成式AI应用。
631 3
|
11月前
|
运维 搜索推荐 安全
企业建站常用的建站系统选项指南
《2026中小企业数字化转型指南》显示,超30%中小微企业已建官网,官网成品牌宣传、转型升级与出海必备。建站不难,关键选对工具:SAAS平台(如阿里云)省心易用;CMS系统更灵活——PageAdmin强于站群与业务系统,ECShop专注电商,WordPress生态丰富但需防卡顿与安全风险,齐博稳重适用政务,织梦则存版权与安全隐患。按需选择,事半功倍!(239字)
668 7
|
11月前
|
Web App开发
代理ip在浏览器的配置指南
本文分三步详解代理IP配置:①打开浏览器对应设置(Chrome设为“设置”,Firefox为“选项”,Edge为“Internet选项”);②在“局域网设置”中填写代理IP与端口并保存;③百度搜“IP”验证是否生效。附注意事项及稳定IP推荐,操作清晰易上手。
|
12月前
|
SQL 监控 关系型数据库
如何定位出项目中的慢SQL
在项目开发中,定位慢SQL是常见问题。可通过链路追踪工具(如SkyWalking)分析调用链耗时,精准定位慢接口及慢SQL;若无监控工具,可开启MySQL慢查询日志,配置阈值记录执行时间较长的SQL,进而优化性能。
|
消息中间件 Java Kafka
开发者如何使用云消息队列 Kafka 版
【10月更文挑战第15天】开发者如何使用云消息队列 Kafka 版
852 112
|
运维 Kubernetes Cloud Native
主流定时任务解决方案全横评
定时任务作为一种按照约定时间执行预期逻辑的通用模式,在企业级开发中承载着丰富的业务场景,诸如后台定时同步数据生成报表,定时清理磁盘日志文件,定时扫描超时订单进行补偿回调等。
主流定时任务解决方案全横评
|
监控 jenkins 测试技术
Ansible与Jenkins:自动化工具的对比
Ansible和Jenkins是自动化领域的两大巨头。Ansible专注于配置管理和任务自动化,采用无代理架构,使用YAML定义配置,具有幂等性和可扩展性。Jenkins则擅长持续集成和持续交付(CI/CD),支持丰富的插件生态系统,适用于自动化构建、测试和部署。两者各有优势,Ansible适合配置管理与大规模部署,Jenkins则在CI/CD方面表现出色。结合使用可创建更强大的自动化工作流,提升团队生产力和软件质量。选择工具时应根据具体需求决定。

热门文章

最新文章