Руководство по редактору кат-сцен

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

Перейти к: навигация, поиск

Содержание

Руководство по редактору кат-сцен

Введение

Следующее руководство опишет вам по шагам, как настроить основные кинематографические сцены в CryEngine 2.

Создание новой кат-сцены

Прежде чем начать

  1. Создайте новый слой в панели слоев, назовите новый слой «cinematic».
  2. Чтобы создать новую сцену, для начала откройте панель «TrackView», через «View->Open View Panel->Track View».

После открытия TrackView нажмите на иконку Add Sequence.

Sandbox TrackviewPrimerTutorial image001.jpg

Назовите кат-сцену «example», затем щелкните OK.

Sandbox TrackviewPrimerTutorial image002.jpg

После того, как вы создали новую сцену, пришло время настроить свойства для данной конкретной сцены, нажмите на иконку Edit Sequence. Sandbox TrackviewPrimerTutorial image003.jpg

В появившемся окне Sequence Properties, отметьте следующие флажки:
Sandbox TrackviewPrimerTutorial image004.jpg

Отметьте Disable HUD, это отключит стандартный интерфейс игрока, Disable Player скроет игрока при проигрывании сцены, 16:9 включает широкоформатный эффект сцены, и Non_Skippable означает, что если игрок нажмёт пробел, чтобы пропустить сцену, она продолжит проигрываться, EndTime была скорректирована и длительность сцена стала 15 секунд.

Первый элемент, который надо добавить в сцену, это Scene Node. Он позволяет нам переключать камеры.

Sandbox TrackviewPrimerTutorial image005.jpg

Однако, не добавленные в сцену камеры не могут быть выбраны. Далее, нам нужно добавить камеру, в RollupBar выберите Camera и поместите её на ваш уровень.

Sandbox TrackviewPrimerTutorial image006.jpg

Sandbox TrackviewPrimerTutorial image007.jpg
Сущность Camera в редакторе Sandbox 2.


Далее, мы выберем сцену для использования этой камеры, дважды щелкните по шкале времени на кадре 0, чтобы добавить ключ, как только ключ будет добавлен, нажмите правой кнопкой мыши по ключу, чтобы открыть «Key Properties», щелкните по выпадающему списку и выберите только что добавленную «Camera1»;

Sandbox TrackviewPrimerTutorial image008.jpg

Далее, мы добавим камеру в кат-сцену, так мы сможем «оживить» камеру.

Выберите камеру, чтобы добавить её трек в кат-сцену, затем нажмите иконку Add Selected Node в TrackView.

Sandbox TrackviewPrimerTutorial image009.jpg

Камера должна появится в TrackView, как показано ниже.

Sandbox TrackviewPrimerTutorial image010.jpg

Далее, мы добавим интересующий нас объект в сцену, чтобы сфокусировать на нём камеру.

В этом примере, мы добавим человека с простой анимацией ходьбы.

Для персонажей в кат-сценах используется AnimObject, используется вместо ИИ сущностей из соображений производительности, также как и AnimObject, система ИИ не будут конфликтовать с системой кат-сцен.

Sandbox TrackviewPrimerTutorial image011.jpg

Выберите AnimObject в RollupBar и зажав левую кнопку мыши, перетащите его в окно перспективы.

Замените стандартный прямоугольный объект моделью персонажа, для этого выберите AnimObject, и в разделе Entity PropertiesRollupBar), щелкните по значку папки в поле Model.

Sandbox TrackviewPrimerTutorial image012.jpg

Далее, мы выберем персонажа чтобы добавить его в сцену. Для нашей сцены мы используем нанокостюм игрока.

Найдите файл objects/characters/human/us/nanosuit.

Sandbox TrackviewPrimerTutorial image013.jpg

Далее, мы добавим персонажа в кат-сцену, выберите AnimObject и в кат-сцене щелкните Add Selected Node.

Sandbox TrackviewPrimerTutorial image014.jpg

Кат-сцена станет выглядеть как на скриншоте ниже.

Sandbox TrackviewPrimerTutorial image015.jpg

Далее, мы выберем анимацию для персонажа. Дважды щелкните по кадру 0, чтобы добавить ключ в трек анимации, затем щелкните правой кнопкой мыши по ключу, при этом появится окно Key Properties, затем щелкните по выпадающему списку и прокрутите вниз, и выбери анимацию «relaxed_walk_nw_forward_slow_01», также поставьте галочку Loop Animation, чтобы анимация вечно повторялась, а также поставьте галочку Root not move, так анимацию не сдвинется и исчезнет после проигрывания.

Sandbox TrackviewPrimerTutorial image016.jpg

Ключевые кадры в кат-сценах

Следующий шаг — создание ключевых кадров для того, чтобы персонаж шел вперёд, сейчас же персонаж идёт на одно месте.

Для начала, убедитесь что персонаж выбран и установите ползунок кат-сцены в позицию 0, и щелкните кнопку Record в окне редактор кат-сцен.

Sandbox TrackviewPrimerTutorial image017.jpg

В окне перспективы, переместите персонажа в желаемое исходное положение в кадре 0, это действие запишет положение и добавить ключ позиции для персонажа, затем переместите ползунок времени в кат-сцену на последний кадр на 15 секунду, вы заметите, что ключевые кадры появляются на нулевом кадре, и на текущем 15 кадре, пока кнопка записи не отжата, вы можете перемещать персонажа на желаемое конечное положение. Если вы сейчас подвигаете ползунок времени, то персонаж будет ходить между двумя точками, для получения более естественной анимации ходьбы, настройте конечное положение.

Анимирование камеры

Теперь, когда персонаж ходит, нам надо чтобы камера следовала за ним и панорамировала его ходьбу.

Чтобы посмотреть, что видно в камере, щелкните правой кнопкой по надписи «Perspective», чтобы вызвать выпадающее меню конфигурации окна просмотра, затем выберите «Camera->Camera1», теперь вы осматриваете сцену через «Camera1».

Sandbox TrackviewPrimerTutorial image018.jpg

В начале камера заблокирована и вы не сможете её перемещать, так же как стандартное окно перспективы, чтобы разблокировать камеру, снимите галочку с Lock Camera Movement.

Sandbox TrackviewPrimerTutorial image019.jpg

Это сдедано в целях безопасности, чтобы пользователь случайно не переместил камеру думая, что это окно перспективы, кнопки на окне кат-сцены также должны быть отжаты.

Теперь мы готовы анимировать камеру, для этого установите ползунок времени на кадр 0 и убедитесь, что выбрана камера и нажата кнопка в редакторе кат-сцены, отрегулируйте окно просмотра в соответствии с вашими пожеланиями.

Затем, передвиньте ползунок времени в редакторе кат-сцен на 5 секунд и расположите камеру как желаете, повторите подобные действия на 10 и 15 секундах.

Снова щелкните кнопку «Record», чтобы избежать случайное анимирование камеры, если вы теперь сдвинете ползунок времени назад в редакторе кат-сцен, то вы должны увидеть анимацию камеры по новому пути и идущего персонажа.

Теперь, нам нужно вернуть окно перспективы, для этого щелкните правую кнопку мыши по надписи «Camera1» и выберите Default Camera.

Sandbox TrackviewPrimerTutorial image020.jpg

Мы увидем обзор сцены с изображениями сплайнов пути камеры и персонажа.

Sandbox TrackviewPrimerTutorial image021.jpg

Проигрывание сцены

Если мы просто зайдём в игру, нажав «Ctrl+G», то сцена не воспроизведётся, поскольку мы должны сначала создать логику, используя потоковый граф.

Для начала, нам надо добавить сущность, которая будет содержать потоковый граф, потоковый граф может содержаться в персонаже, он у нас AnimObject, однако использование конкретной сущности более безопасно, поскольку из неё очень трудно случайно удалить потоковый граф, так что, мы будем использовать AreaTrigger.

Sandbox TrackviewPrimerTutorial image023.jpg

Выберите AreaTrigger и перетащите его в окно просмотра, затем переименуйте в «cine_example_FG», далее мы создадим потоковый граф, щелкните по кнопке «Create» в разделе Flow Graph.

Sandbox TrackviewPrimerTutorial image024.jpg

Появится окно озаглавленное как «Enter Group Name for the Flow Graph», назовите группу «cinematics», это очень полезно, чтобы в ней содержались все потоковые графы, связанные с кинематографическими кат-сценами.

Sandbox TrackviewPrimerTutorial image025.jpg

Выбрав AreaTrigger, щелкните по кнопке Open, чтобы начать работу над потоковым графом для этой сцены.

Sandbox TrackviewPrimerTutorial image026.jpg

Откроется редактор Flow Graph, убедитесь, что вы выбрали новосозданный потоковый граф для начала работы над ним.

Sandbox TrackviewPrimerTutorial image027.jpg

For this tutorial we simple want the scene to start as soon as the player drops into game, for this functionality we will add a Misc->Start node.

Right click on the grey area to add a new node and select the Start node, this will trigger as soon as the player drops into game.

Sandbox TrackviewPrimerTutorial image028.jpg

Next we need the start node to trigger the sequence to play, by adding a Animations:PlaySequence node.

Sandbox TrackviewPrimerTutorial image029.jpg

With the two nodes added we need to connect them to setup the logic, simply click and hold on the blue arrow port and drag it into the green StartTrigger input port.

Sandbox TrackviewPrimerTutorial image030.jpg

Next we need to select which Sequence to play, double click on the Animations:PlaySequence node, in the Inputs settings on the right, click on the three dots … to open the Select Sequence pop up, select the sequence that you have created and click ok.

Sandbox TrackviewPrimerTutorial image031.jpg

This is what the current flow graph should look like.

Sandbox TrackviewPrimerTutorial image033.jpg

Testing the scene

If you now drop into game "ctrl+g” the scene should play automatically on start.

Post scene setup

In this scene we are creating the illusion that the character in the scene is the player, thus after the scene has finished we want to hide the AnimObject character, we can do this in the Track view. Open the Track view and select the AnimObject character entity, in the event track double click to add a key frame at 15 seconds, right click on the key frame to bring up the Key Properties, under the Fire Event: drop down box select Hide.

Sandbox TrackviewPrimerTutorial image034.jpg

This will hide the character when the scene gets to the last frame, however if you scrub over the scene in the Track view the character will now disappear, thus we need to add an Unhide event at frame 0, again double click in the event track to add a key frame, right click on the key frame to bring up the Key Properties, under the Fire Event drop down box select Unhide.

Sandbox TrackviewPrimerTutorial image035.jpg

Now the character will unhide and hide accordingly.

To complete the illusion we need to make the player start/continue from where the actor finished in the scene. Currently the player will start from where they dropped into game which creates a break the illusion.

First we need to get the end position of the AnimObject character, scrub the timeline in the track view to 15 seconds, next we need to reference this point,

A useful object to use is an AI TagPoint as it is hidden in game mode, select the tag point and place near the character, rename «cine_character_endpoint»

Sandbox TrackviewPrimerTutorial image036.jpg

To get perfect alignment to the character we will use the Align Selection tool select the tag point and then click the align selection icon then click on the character, this should move the tag point to the correct position.

Sandbox TrackviewPrimerTutorial image037.jpg

Next we need to add logic in the flow graph to the player to this position after the scene, open the flow graph editor and select the flow graph, right click on the grey area to add a new node Entity:BeamEntity.

Sandbox TrackviewPrimerTutorial image038.jpg

The Entity we want to be beaming is the player, add the node Game:LocalPlayer

Sandbox TrackviewPrimerTutorial image039.jpg

Last we need to add a node which references the position of the AI TagPoint where the player ends, add the node Entiy:EntityPos.

Sandbox TrackviewPrimerTutorial image040.jpg

With these new nodes added connect the flow graph as shown below by linking the output to inputs, to assign the tag point to the Entity:EntityPos node, select the AI TagPoint in the viewport, then right click on the Entity:EntityPos flow graph node and select Assign Selected Entity.

Sandbox TrackviewPrimerTutorial image041.jpg

Now when the scene has completed the player will be located at the position of the tag point.

Adding Screen FX

For this scene we will fade in from black at start and then fade out again to black at the end and finally fade in from black once the player has control.

Open the flow graph editor and select the flow graph you have been working on, right click to add a new CrysisFX>ScreenFader node.

Sandbox TrackviewPrimerTutorial image042.jpg

Select the new CrysisFX>ScreenFader node and in the inputs setting adjust the fade in and fade out times to 4.

Next duplicate the CrysisFX>ScreenFader node by right clicking on it and clicking copy, then right click on the grey area and click paste, do this twice so there are a total of three ScreenFader nodes.

Next we need to add a new AreaTrigger to trigger the fade out logic in the flow graph from the Track view.

Add a new AreaTrigger into the viewport and rename "cine_FadeOut_DT” DT is for Dummy Trigger which is used to send events from the track view to the flow graph.

Next add the cine_FadeOut_DT to the track view by clicking the Add Selected Node icon.

Under the event track for the cine_FadeOut_DT add a key frame at 11 seconds. right click on the key frame to bring up the Key Properties and under Fire Event: set to Leave.

Sandbox TrackviewPrimerTutorial image043.jpg

Next open the flow graph editor, right click on the grey space and select Add Selected Entity. This will add the AreaTrigger to the flow graph.

Sandbox TrackviewPrimerTutorial image044.jpg

With all the nodes now added to the flow graph, it is now time to link the logic together, setup the flow graph as pictured below,

Sandbox TrackviewPrimerTutorial image045.jpg

Simply click and drag the output from a node to the corresponding node input to make a connection.

See Also