- Unity Artificial Intelligence Programming
- Dr. Davide Aversa Aung Sithu Kyaw Clifford Peters
- 235字
- 2021-06-10 18:57:46
The messaging system
AI does decision making in response to the events in the world. The events are communicated between the AI entity and the player, the world, or the other AI entities through a messaging system. For example, when the player attacks an enemy unit from a group of patrol guards, the other AI units need to know about this incident as well, so that they can start searching for and attacking the player. If we were using the polling method, our AI entities would need to check the state of all of the other AI entities to know about this incident. However, with an event-driven messaging system, we can implement this in a more manageable and scalable way. We can register the AI characters interested in a particular event as listeners, and if that event happens, our messaging system will broadcast to all listeners. The AI entities can then proceed to take appropriate actions or perform further checks.
The event-driven system does not necessarily provide a faster mechanism than polling. Still, it provides a convenient, central checking system that senses the world and informs the interested AI agents, rather than each agent having to check the same event in every frame. In reality, both polling and messaging systems are used together most of the time. For example, AI might poll for more detailed information when it receives an event from the messaging system.
- 黑客攻防實(shí)戰(zhàn)技術(shù)完全手冊(cè):掃描、嗅探、入侵與防御
- EDA技術(shù)與VHDL編程
- 物聯(lián)網(wǎng)工程規(guī)劃技術(shù)
- 光網(wǎng)絡(luò)評(píng)估及案例分析
- 物聯(lián)網(wǎng)概論(第2版)
- Hands-On Full Stack Development with Spring Boot 2 and React(Second Edition)
- PLC、現(xiàn)場(chǎng)總線及工業(yè)網(wǎng)絡(luò)實(shí)用技術(shù)速成
- 物聯(lián)網(wǎng)與無線傳感器網(wǎng)絡(luò)
- Metasploit Penetration Testing Cookbook
- 深入理解OpenStack Neutron
- 從實(shí)踐中學(xué)習(xí)手機(jī)抓包與數(shù)據(jù)分析
- 一本書讀懂TCP/IP
- 物聯(lián)網(wǎng)
- RestKit for iOS
- Microservices Development Cookbook