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 ...
随机推荐
- Codeforces Beta Round #61 (Div. 2)
Codeforces Beta Round #61 (Div. 2) http://codeforces.com/contest/66 A 输入用long double #include<bit ...
- 转:JMeter压力测试及并发量计算
最近的一个项目刚刚开发完,因为不是专业测试人员,所以记录下测试过程以备时间长忘记了. 一.JMeter的安装(Linux)1. 下载JMeter:这个就不细说了,直接去(http://jmeter.a ...
- vue 点击图片显示大图
使用指南:https://www.npmjs.com/package/vue-directive-image-previewer 简单使用: 1.安装vue-directive-image-previ ...
- Head First Servlets & JSP 学习笔记 第二章 —— Web应用体系结构
Servlet没有main()方法,所以Servlet受其他人控制,这个其他人就是容器!而Tomcat就是一种容器. 容器向Servlet提供Http请求和Http响应:容器来调用Servlet的do ...
- 安装doxygen(一个自动文档生成工具)+Graphviz图形可视化软件
参考文章: http://www.fmddlmyy.cn/text21.html http://www.cnblogs.com/duguguiyu/archive/2008/06/29/1231852 ...
- Oracle 表空间和数据文件之间的关系
首先,你需要明白的一点是:数据库的物理结构是由数据库的操作系统文件所决定,每一个Oracle数据库是由三种类型的文件组成:数据文件.日志文件和控制文件.数据库的文件为数据库信息提供真正的物理存储. 每 ...
- [Z]Spring Data JPA 之 一对一,一对多,多对多 关系映射
一.@OneToOne关系映射 JPA使用@OneToOne来标注一对一的关系. 实体 People :用户. 实体 Address:家庭住址. People 和 Address 是一对一的关系. 这 ...
- 如何为linux系统设置全局的默认网络代理
方法1:更改全局配置文件/etc/profile all_proxy="all_proxy=socks://proxy.xxx.com.cn:80/" ftp_proxy=&quo ...
- BZOJ1833或洛谷2602 [ZJOI2010]数字计数
BZOJ原题链接 洛谷原题链接 又是套记搜模板的时候.. 对\(0\sim 9\)单独统计. 定义\(f[pos][sum]\),即枚举到第\(pos\)位,前面枚举的所有位上是当前要统计的数的个数之 ...
- AppStore企业账号打包发布APP流程详解
一.通过企业账号申请证书 1 Certificate Signing Request (CSR)文件 在Mac系统中进入“钥匙串访问”,选择“钥匙串访问”-“证书助理”-“从证书颁发机构请求证书…”, ...