Skip to Content
Lua游戏AI开发指南
book

Lua游戏AI开发指南

by Posts & Telecom Press, David Young
May 2024
Beginner to intermediate
327 pages
4h 38m
Chinese
Packt Publishing
Content preview from Lua游戏AI开发指南

第9章 策略

本章主题:

  • 生成基于图层的影响力地图;
  • 绘制单独的影响力地图图层;
  • 了解影响力地图修改器;
  • 操作和传播影响力值;
  • 创建供智能体使用的影响力地图;
  • 创建潜在危险区域战术影响力地图。

到目前为止,我们的智能体已经拥有了一定数量的数据源,可以用来对周边环境进行空间推理。导航网格让智能体能够确定所有可通行的位置,而感知力则让智能体拥有了看和听的能力。然而,缺乏沙箱的细粒度的量化视图会导致智能体无法对沙箱中其他可能感兴趣的地方进行推理。

影响力地图可以从较高层次上降低理解周围环境的难度。这种空间数据可能以多种形式出现,但本质上都是把环境划分为多个可量化的区域,每个区域都能存储和计算一些额外的数据。特别是,我们将使用一种基于三维网格的方式来表达我们的影响力地图。影响力网格中的每个格子表示一个三维空间方块,如图9-1所示。沙箱使用内部的一种三维数组结构来存储影响力地图,它的大小会随着每个网格单元的尺寸而快速增长。

图片 1377

图9-1 影响力地图的网格单元

通过影响力地图,我们可以很容易地执行一些任务,比如让智能体彼此分开、移动智能体到友好区域或者远离敌对区域。以前我们可能会使用基于效用的方法,但是这种方法的开销会随着智能体数量的增长而变得更大。使用一个由所有智能体共享的中央数据结构,可以让性能开销保持最低。

由于影响力网格代表的是一个三维区域而不仅仅是一个二维平面,需要一个单元格高度来量化不同高度上的几何体。图9-2是一个单元格高度为0.5米的影响力地图的示例。注意,出于调试目的,每个单元格都显示为一个沿 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python迁移学习

Python迁移学习

Posts & Telecom Press, Dipanjan Sarkar, Raghav Bali, Tamoghna Ghosh
R深度学习权威指南

R深度学习权威指南

Posts & Telecom Press, Joshua F. Wiley
精通模块化JavaScript

精通模块化JavaScript

Nicolás Bevacqua

Publisher Resources

ISBN: 9781836205555