GOAP
- AI角色的自主移动 --- 操控行为, 单体,小队,群体的行为。 我之前的文章 Unity Movement AI (一) , Unity Movement AI (二)
- 找到最短路径并避开障碍物 --- A* 寻路, NavMesh等
- 角色自主决策 --- 有限状态机FSM和 行为树
- 机器学习 --- Unity 机器学习 ML-Agents (一)官方介绍概念【必读】
- 有限状态机由一组状态(包括初始状态),输入和根据输入及现有状态转换为下一个状态的转换函数组成。
- 行为树中最常用的节点包括:
什么是GOAP?
|
HashSet<KeyValuePair<string, object>> preconditions;
HashSet<KeyValuePair<string, object>> effects;
|
|
// This function checks for the nearest supply pile to deposit wheat at
// Harvesters in different areas of the world will go to their respective chests, but if they are destroyed they can intelligently find another closer one
public bool CheckProceduralCondition (GameObject agent) {
Chest[] chests = GameWorld.chests;
Chest closestChest = null;
float distChest;
foreach (Chest chest in chests) {
if (closestChest == null) {
closestChest = chest;
distChest = Distance (closestChest.position - agent.position);
} else {
// Check if this chest is closer
float distance = Distance (chest.position - agent.position);
if (distance < distChest) {
closestChest = chest;
distChest = distance;
}
// If no chest is found, terminate the action plan
if (cloestChest == null)
return false;
SetTarget (closestChest);
return closestChest != null;
}
}
}
|
|
// Remember the hashsets we used to store preconditions and effects?
// We also use those to hold the worldstate (which is the agents initial precondition) and the effect (which is the goal for the plan)
// This makes the implementation more straightforward
HashSet<KeyValuePair<string, object>> worldState = getWorldState();
HashSet<KeyValuePair<string, object>> goal = createGoalState();
Queue<Action> plan = planner.plan(actions, worldState, goal);
|
- FSM
- FSM State
- GOAP Interface
- Agent
- Action
- Planner
- Agent代理实现
- GOAP Interface接口实现
- Action实现
GOAP的更多相关文章
- AI决策算法 之 GOAP (三)
源码地址:http://pan.baidu.com/s/1dFwzmfB 这篇我们使用上篇文章写的GOAP框架来完成一个实例: 实例内容: AI有10HP, 需要去站岗,站岗完成扣5HP 当HP< ...
- AI决策算法 之 GOAP (二)
http://blog.csdn.net/lovethRain/article/details/67634803 GOAP 的主要逻辑: 1.Agent的状态机初始化Idle状态 2.Idel状态根据 ...
- AI决策算法 之 GOAP (一)
http://blog.csdn.net/lovethrain/article/details/67632033 本系列文章内容部分参考自:http://gamerboom.com/archives/ ...
- 常见的游戏AI技术对比(FSM,HFSM,BT,GOAP,HTN,Utilitay,机器学习)
最近研究的内容,比较懒还没写文章,先占个坑,过几天补
- 趣说游戏AI开发:对状态机的褒扬和批判
0x00 前言 因为临近年关工作繁忙,已经有一段时间没有更新博客了.到了元旦终于有时间来写点东西,既是积累也是分享.如题目所示,本文要来聊一聊在游戏开发中经常会涉及到的话题--游戏AI.设计游戏AI的 ...
- JS学习笔记(不断更新)
1 基础知识 为什么学习 JavaScript? JavaScript web 开发人员必须学习的 门语言中的一门: HTML 定义了网页的内容 CSS 描述了网页的布局 JavaScript 网页的 ...
- AI PRO I 第4章
Behavior Selection Algorithms An Overview Michael Dawe, Steve Gargolinski, Luke Dicken, Troy Humphre ...
- Maven学习3-使用Maven构建项目
转自:http://www.cnblogs.com/xdp-gacl/p/4240930.html maven作为一个高度自动化构建工具,本身提供了构建项目的功能,下面就来体验一下使用maven构建项 ...
- Maven学习总结(三)——使用Maven构建项目
maven作为一个高度自动化构建工具,本身提供了构建项目的功能,下面就来体验一下使用maven构建项目的过程. 一.构建Java项目 1.1.创建Java Project 1.使用mvn archet ...
随机推荐
- python 读取文件第一列 空格隔开的数据
file=open('6230hand.log','r') result=list() for c in file.readlines(): c_array=c.split(" " ...
- FZU-2150.FireGame.(BFS))
本题大意:给出一个n * m的地,‘#’ 代表草, ‘.’代表陆地,每次选择这片地里的两片草,可选相等的草,选择的两片草初始状态为被燃状态,每一分钟被点燃的草会将身边的四连块点.问你需要对于给定的这片 ...
- Nginx搭建正向代理服务器
配置如下: server { listen 8888; #监听端口 location / { res ...
- 客户端无法重新使用 SPID 为 63 的会话,该会话已被重置用于连接
客户端无法重新使用 SPID 为 %d 的会话,该会话已被重置用于连接池.失败 ID 为 %d. 此错误可能是由于先前的操作失败引起的.请查看错误日志,找出在显示此错误消息之前刚发生的失败操作. 20 ...
- linux服务器搭建
centos7 java web项目环境搭配 2018年07月19日 17:20:21 阅读数:25 首先进行系统安装,此处不进行详细介绍,自行百度安装 一.配置ip地址信息 1.进入/etc/sys ...
- 定时器修改button标题闪烁
在做一个项目时,用到UIButton来设置接收短信验证码的倒计时,但是用NSTimer来设置标题会出现连续闪烁的问题. 经过测试发现了一下内容,如果只是单独的设置button的titleLabel的内 ...
- linux命令学习之:cp
cp命令用来复制文件或者目录,是Linux系统中最常用的命令之一. 如同时指定两个以上的文件或目录,且最后的目的地是一个已经存在的目录,则它会把前面指定的所有文件或目录复制到此目录中.若同时指定多个文 ...
- Object转为Bigdecimal
import java.math.BigDecimal; import java.math.BigInteger; public class MathUtils { public static Big ...
- jquery关于attr和prop的差异
转自:http://www.jb51.net/article/88068.htm 处理像checkbox,radio和select这样的元素时,经常会发现明明使用了attr设置了selected或ch ...
- Vue 初始化多个Vue 及之间的相互修改
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...