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 ...
随机推荐
- C library:<cctype>(ctype.h)
1, isalnum(): check whether c is either a decimal digit or an uppercase or lowercase letter. 2, isal ...
- Maven 添加jar包到本地仓库
一.使用Maven命令安装jar包 前提:在windows操作系统中配置好了Maven的环境变量,怎么配置请自己百度,这里不介绍,可参考https://jingyan.baidu.com/articl ...
- css设置input不显示光标
把光标颜色设置为透明色和父类一样就看不出来了,就好像取消了 caret-color: transparent; 设置了这个属性后,无论如何点击都好像没有光标似的
- PCB规则设置
规则设置
- TZOJ 2999 Network(连通图割点数量)
描述 A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting ...
- mysql5.7 生成列 generated column
生成列的值是根据列定义中的表达式计算得出的. mysql5.7支持两种类型的生成列: 1.virtual 生成列:当从表中读取记录时,才计算该列值.不会把数据持久化在硬盘上. 2.stored 生成列 ...
- Hibernate: save, persist, update, merge, saveOrUpdate[z]
[z]https://www.baeldung.com/hibernate-save-persist-update-merge-saveorupdate 1. Introduction In this ...
- Vue 插件和Preset
插件和Preset 插件 Vue CLI 使用了一套基于插件的架构 Vue CLI 使用了一套基于插件的架构.如果你查阅一个新创建项目的 package.json,就会发现依赖都是以 @vue/cli ...
- “windows的批处理”与“Linux的shell script”的类比学习
从2005年开始,做了将近10年的系统维护,先是做网络接入管理,然后做网络安全与审计,然后做服务器管理等整个网络系统的运营管理:现在又兼着做一些Linux下的视频监控系统的软硬件维护.过程中遇到太多重 ...
- redis 哨兵(sentinel)
redis哨兵 哨兵自动故障转移 自动通知应用最新master信息 无需担心,master挂了,程序不需要修改IP啥的,由哨兵自动完成 修改sentinel.conf protected-mode n ...