简体   繁体   English

ActionScript3 中的 AI 编程

[英]AI programming in ActionScript3

I am making a shooter game.我正在制作一个射击游戏。 So I managed to create simulated AI to some of my objects on stage ie I move them whit script.所以我设法在舞台上为我的一些对象创建了模拟 AI,即我用脚本移动它们。

But now I have the Boss which usually have several types of movements and shoots different types of missiles.但现在我有了 Boss,它通常有几种类型的动作并发射不同类型的导弹。

Which type of AI should I use?我应该使用哪种类型的人工智能? Or should I also simulate it?还是我也应该模拟它?

Coz I have seen several games that has bosses where they change dynamically their movement without certain pattern.因为我见过几款游戏都有老板,他们在没有特定模式的情况下动态地改变他们的动作。

Use a state-driven agent.使用状态驱动的代理。 The Boss (the "agent") have several states, describing various types of movements or types of shoots. Boss(“代理”)有几种状态,描述了各种类型的动作或射击类型。 According to the context, the agent switch from one state to another.根据上下文,代理从一个 state 切换到另一个。

You will find clear examples in the book Programming game AI by example .你会在Programming game AI by example一书中找到清晰的例子。

You are lucky, the chapter dedicated to state-driven agents is available online here .你很幸运,专门介绍状态驱动代理的章节可在此处在线获得。 Code examples are in C++, but it's extremely basic.代码示例在 C++ 中,但它非常基础。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM