官术网_书友最值得收藏!

Preparing a possibility map (FPS)

At this point, we are able to understand what a possibility map is and how it can be used to create an AI character that behaves accordingly to different situations in the game. Now that we understand how to use a possibility map, let's create a practical example where we programmed our AI character to successfully defeat the player. For this example, I'll be using two models, one represents the AI enemy that we are programming and the other one represents the player.

We'll create a common example, where the AI is protecting the entrance of a building that the player needs to enter in order to deactivate a bomb and complete the level. Let's imagine that we already have the player fully programmed and that we now need to focus on our AI enemy, as shown in the following screenshot:

Before writing any line of code we need to think about the possible situations that can occur and how our AI will react to them. First, we'll be simplifying the situation by breaking down our stages into a simple 2D visualization that will be used as a reference to determinate distances and other relevant parameters.

After simplifying the situation, we are ready to start planning the possibilities. The player is allowed to move around the building. Note that there's only one entrance, and that entrance is protected by our enemy AI. The arrows represents the direction that the characters are facing, and this will be an important aspect to our planning.

主站蜘蛛池模板: 平遥县| 阳原县| 古交市| 原阳县| 墨竹工卡县| 海南省| 襄汾县| 康定县| 海城市| 临颍县| 巴楚县| 三门峡市| 尉犁县| 肥东县| 玉林市| 清涧县| 莫力| 鄂托克旗| 和龙市| 河间市| 孙吴县| 昌乐县| 吉水县| 肥城市| 灵山县| 柘荣县| 灌云县| 承德县| 汶川县| 玉林市| 榆社县| 蓬安县| 新沂市| 伊吾县| 鸡泽县| 贵港市| 伊宁县| 民权县| 杭锦旗| 普定县| 大宁县|