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 ...
随机推荐
- 库的操作&表的操作
一 库的操作 掌握库的增删改查 一.系统数据库 执行如下命令,查看系统库 show databases; information_schema: 虚拟库,不占用磁盘空间,存储的是数据库启动后的一些参数 ...
- vue-router导航守卫,限制页面访问权限
在项目开发过程中,经常会需要登录.注册.忘记密码等,也有很多页面是需要登录后才能访问,有些页面是无需登录就可以访问的,那么vue是怎么来限制这些访问权限问题的呢? vue-router导航守卫的bef ...
- Hadoop特点
一:HDFS 1.HDFS上传数据,会将文件切分成指定大小的数据块,并以多副本的数据块存储在机器上. 2. part0是指 副本有2个而且1,2有两个副本 二.YARN 1.负责整个集群的管理和调度 ...
- MySQL千万级数据分区存储及查询优化
作为传统的关系型数据库,MySQL因其体积小.速度快.总体拥有成本低受到中小企业的热捧,但是对于大数据量(百万级以上)的操作显得有些力不从心,这里我结合之前开发的一个web系统来介绍一下MySQL数据 ...
- http406错误
The resource identified by this request is only capable of generating responses with characteristics ...
- cocoapods 更新本地仓库 pod setup/update 无限远程中断
升级 cocoapods 无限远程中断:网络不好 试了很多解决方法: 1.替换源,2.设置下载速度,3.清空本地master仓库,4.删了本地的pod库,5.半夜3-5点更新,6.按照失败提示的 (p ...
- 用户Cookie和会话Session、SessionId的关系
一.客户端用cookie保存了sessionID 客户端用cookie保存了sessionID,当我们请求服务器的时候,会把这个sessionID一起发给服务器,服务器会到内存中搜索对应的sessio ...
- Tomcat登陆mysql的密码设置
在登陆mysql的密码和数据库密码不一致时,可以修改Mysql数据库密码或者修改连接Mysql的配置文件: 1.修改连接Tomcat里连接Mysql的配置文件 需要修改两个配置文件 ,一个是在tom ...
- python 爬取网页基础 requests使用
pip install requests 安装requests库 基本顺序: import requests r=requests.get("url路径") r.status_c ...
- vue tab切换
<template> <div class="box"> <ul> <li v-for="(item,index) in arr ...