Расширенная настройка ИИ

Материал из CryWiki Russia

Перейти к: навигация, поиск
Эта страница страница помечена как находящиеся в процессе перевода с: 11 января 2012.


Содержание

Введение

Несмотря на широкие графические возможности CryENGINE 2, его красивая графика ещё не делает каждый уровень интересным и правильным с точки зрения дизайна уровней. Crysis не только был технической демонстрацией движка, но также преподносил линейный, в то же время ориантированный на выбор игрока геймплей. Это пособие направлено на повышение знаний дизайнеров об игровой настройке ИИ, и создания расширенных возможностей по управлению единицами ИИ в игре, чтобы приспособить их к любым вариантам дизайна уровней. Это руководство предполагает, что вы владеете эементарными техниками дизайна уровней, такими как триггеры и сценарии flowgraph.

Использование нода Entity:BroadcastEvent в своих целях

Entity:BroadcastEvent is an iterative flowgraph node that is capable of selecting a multitude of entities (on the basis of their names containing a certain string) and then performing an entity event. How does this aid in level design? Instead of manually adding all entities to a given flowgraph for whatever purpose, you can simply set up all your entities with certain names (which you should be doing anyway for organisation's sake!) and then execute one flowgraph node. This means that if you decide to, say, change the amount of enemies in the future, you can simply add them with certain names and not worry about rescripting them. Let’s look at an example of this now in a real level design scenario.

Появление ИИ

For the purposes of this tutorial we are only going to apply the effect to two alien troopers, but this will work on much larger groups of AI if necessary.

Правила наименования

Firstly, we need to set our AI up with names that are guaranteed to be unique. I personally use a fairly long string that corresponds to the event in the level. For this particular occasion I have used CrashSiteAI as the prefix to the entity names (the actual troopers are CrashSiteAI1 and CrashSiteAI2 respectively).

Отключение единиц ИИ при старте

What will happen with these AI? Well, I want to disable them until the point where the player triggers a certain event which in this instance is entering a proximity trigger. Firstly, let's take a look at the necessary setup to disable the AI on game start. The flowgraph looks like this:

RTENOTITLE

We want to call the Disable event for the troopers. You can view a full list of entity events by either viewing the Input/Output section of the entity in the rollup bar, or by adding the entity to a flowgraph and looking at the different options available.

Включение по входу в триггер

Now we need to call the Enable event when the player enters the trigger. The flowgraph is made in a very similar fashion.

RTENOTITLE

More to come in the future on extensible AI setup, I hope this has helped some people understand flexible design more and that your projects benefit at least slightly. :)

RTENOTITLE