Improved action mechanics

So, I’ve made some improvements in the action-interaction system. It has been a long-needed update. In different games player is able to perform different actions, not only just run, jump and shoot. Well, honestly, a major part the gameplay nowadays is built around actions and interactions, so inadequate and ineffective solutions are unacceptable. This leads us to a completely new domain of problems: we need a separate mechanism for performing character’s actions. The concept is simple: there are some actions, each can be performed by the character. An action has certain properties, like it’s relationship with animation — an action may or may not have an animation, and it’s relationship with character state and other actions — an action may or may not have effects on the game pawn (except the animations effect). Thus, we come to a fairly easy solution — the LBBasicCharacaterController, which is capable of performing actions, which means the ability to play animations and change pawn’s states (virtually, of course). Basically, we’ll be working only with current character’s logic, leaving all underlying activity to the basic character controller. So, we’re interested in only in these methods:

function HandleActionStart(int startedaction)
{ }
function HandleActionStop(int stoppedaction)
{ }
function HandleAnimNotify(int actioncode, int actiondata, 
ActionNotifyTypes notifytype)
{ }

Which do handle action start, action end and animation notifies, which may or may not trigger during the action animation. If we don’t need any character-specific logic or we just want a Garry’s Mod-styled animation player, we can just use the editor. For the designer it’s really simple — all what’s required is to fill out the Character Action List in the editor, which contains all the necessary data.


For example, here I’ve made four basic actions: touch, pick up, put down, carry, three last interactions I’ve been describing earlier, the touch action and the appropriate interaction I’ll describe later. Also I’ve made some auxiliary actions, which really don’t have any effect in the game, except they do play animation. All options of this actions are shown below, for example, them options of the touch action mean that this action is controlled by the certain animation: the action starts with the animation and ends with this animation, also it may have activation restrictions and switch links. What is activation restriction? It’s simple — the action cannot be performed from any actions (state-actions), except these. And the switch link is a type of  a bridge between the actions — upon its finish, the action can be automatically switched to another one. Well, I’ve made some comments (been trying my best) in sources on GitHub.


Next thing, what is required — the proper animation, set up and linked to the LBBlendByAction animnode, which blends all animations. There’s also a default node, which is used to blend out, when the default action is active.


Thus, all, what’s required now is to call a needed action by the SetParamInt() function with param name ‘BeginAction‘ and param value containing the action code. Also, this can be performed from any sub-system, but I’ve chosen Kismet and its keyboard events.


Well, let’s test this functionality. I’ve made some random (though interdependent) animation sequences (though craggy) for the character, then plugged them into the new action system. There’s a state-action, which defines character’s state — the ‘Sit_Tie_Idle‘ action. There are also two gateway-actions — the ‘Sit_Tie_In‘ as an entrance into this state and the ‘Sit_Tie_Out‘ as an exit. And there are two actions, performed exclusively from the ‘Sit_Tie_Idle‘ state — the ‘Sit_Tie_Gym_1‘ and the ‘Sit_Tie_Gym_2‘.

Now we can make our character do different things. For example, we can watch our strange character doing its strange exercises (some kind of gym, maybe?). However, everything happens in the right order, for example, it can’t just start walking or jumping from a stretched pose, it has to stand up first.

Improved action mechanics

A strange construct in the desert

One of the first levels for the project «A Dream In The Fall». The idea is to find and capture all golems to be able to shove a stuck head. The level mostly consists of platforms and tracks, that connect the platforms. Any other area in the level is a quicksand, which pulls the player down.

The playable character for this level is a walking character (xw_char), which is capable of fast movement and overcoming most of the obstacles. It is also capable of interacting with some interactable objects, placed all over the level, which are used to capture golems.

All golems are initally deactivated, so any golem, except the first, is ought to be interacted in a certain way (well, I think it should be just a touch interaction) to become active.

The graphic component still needs serious improvements: the detail level of world geometry is very poor, especially – the textures, also the sand looks like an old heavily urinated carpet.

A strange construct in the desert

Movement mechanics

Almost the first time doing serious bipedal movement mechanics and animation. Let’s make a first step into the complex character animation (or not). Anyway, here’s the workflow. Honestly, once I’ve been involved in such an affair… And things did not go very well, but that was then. Anyways, now is the first real attempt to create an acceptable bipedal character movement animation and mechanics. First, I’ve made a complete redesign of an old version of movement mechanic, which was a special pawn and was very hard to use. Well, now it looks shiny and new, now this code goes to a new separate mechanism — LBCharacterWalkMovementMechanism, which is now based on LBCharacterMovementMechanism (empty at the moment, lol) and conains all the code, needed for performing pawn movement and blending the animation. It also has all parameters, which are used to regulate pawn’s speed and acceleration.


It has the forward speed parameter and a forward speed coefficient to handle forward speed, same to the sidestep (strafe?) speed. Also it has accel rate, which is used to speed the pawn up, when it wants to run. Another important thing here is the angular speed, which is represented by angular speed parameter and an angular speed coefficient, which are used to handle pawn’s rotation. Also it has move direction, which is used to point the desired movement direction. It’s worth noting, that pawn rotation is quite an interesting task itself (later on this). Second, I’ve made several frames of animation for the character, the walker (xw_char). It wasn’t easy, because someone’s left in it’s feet only one bone. Maybe it was even me. Anyways, there are two fairly appropriate animations sequences:

Simple walk animation:


Simple run animation:


Other intermediate and supportive animations are quite crappy to be shown here. It should be noted that I used the walk and run cycle tutorials by Richard Williams as a reference (found all over the internet) for my walk and run animations. As a result, we’ve got the following animtree:

Where BlendByAngSpeed node does blending between middle, left and right turn sequences and BlendByFwdSpeed node does blending between walk and run sequences. Also, while blending between walk and run is quite a simple task, but blending between rotations seems to be more complex. Using unique animation sequences turned out be the best way to solve this problem, others, like using direct bone rotations may cause weired effects in my animtree during blending between states, for example. Finally, we’ve got the result, let’s see how does it look all together:

Walk and run animations in game:

Turn and turn in place animations in game:

However, complex tests reveal some flaws, like minor body jerking and leg rattling, also there’s still no jump and sidestep implementation. And ofcourse, the camera is terrible, but controlling with joystick (gamepad) partially solves the problem. Nevertheless, in general it looks not too bad.

Movement mechanics

The Lost Head gameplay test

A gameplay test of a game prototype. The player takes control over the lost head, which is detached from the escaping body. The player should be able to solve some problems to bring things back to their places.

The level contains: player-controlled character (The Head) and the non-player-controlled character (The Body), pre-set cameras, location triggers and linked scripted events.

The Lost Head gameplay test

To the shore

Finally it’s time to make the other part – the shore. Sea cliffs and sandy shores is quite a good setting for the adventure level. So, some cliffs were made of stonde and mud:

This cliffs still need a better detail, especially – good texturing. But well, from distance they look quite nice. Considering that the main action takes place in the water, we won’t always see them close. This is how it looks all together.

To the shore

Сочинение на тему: как я провёл лето 2009 в Esperient Creator


Читабельный текст

А если серьёзно, то недавно обнаружил у себя данный пакет. Ранее приходилось с ним работать в одном из проектов. Научился Эспериенту благодаря тому, что сотрудники, в обязанности которых входила непосредственная работа в этом пакете, были дуб дубом. Короче, в этом проекте требовалось разработать ряд интерактивных сценок, демонстрирующих перемещение робота в определённом пространстве. Ничего серьёзного, если бы не предоставляемое ПО. Единственным доступным пакетом для данного проекта был Esperient Creator (или даже Deep Creator), никаких вам 3Д-Максов и прочих приблуд – бичёвская контора, к тому же руководитель – индюк. Конечно, дизайнеры и интерактивщики такие сразу же закукарекали, что они БОГИ и даже им 3Д-Макс никакой не нужен и там всё есть, типа ШВЕЙЦАРСКИЙ НОЖ. Но потом как-то сдулись и начали заваливать проект. Тогда-то к проекту и подключили ИСТИННЫХ БОГОВ – меня и ещё одного чувачка. Руководитель такой собрал всех и говорит типа давайте парни, нужно в рамках пар недель освоить ВИСИВИГ пакет для создания интерактивных приложений и реализовать на нём данный проект, по факту – демонстрационное приложение, в подмогу даю вам двух специалистов, которые по синьке понтовались, что Анрил модили по фану. Ну мы его сначала послали, но потом в общем пришлось всё-таки браться за этот проект. И я не пожалел! Пакет по тем временам был действительно крутой, к тому же и достаточно простой (но не для пентюхов, называющих себя интерактивщиками). Ну в общем, мы с этим штришком покумекали пару недель и выдали ништяковые такие сценки. Одна про управление самим роботцем – там перемещением и прочей шляпой, другая – манипуляции с подключаемыми модулями к этому роботу.

Особо не парились, тупо взяли одну из демо-сцен, поставляемых в комплекте с пакетом – 4Wheel_Car_Control по-моему называлась (сейчас её не нашёл), на эти колёса поставили сбацанный на скорую руку в этом же редакторе загогулину – смазали с туториала, где тип исполняет цаплю, по-моему, был даже такой фал – MyHeron. Короче сделали скелет для этой хрени (у робота гибкая рука была), добавили аниматоры. В общем, за пару ночей бахнули, остальное время изучали туториалы, я даже специальный диск пиратский покупал, на котором 100 в 1 программ для дизайна чисто из-за включённых туда Эспириента и набора туториалов (которых в лицензии не было).

Ну шеф такой грит типа кал это, матал он эту лажу, сказал типа проект завалили и так далее. Но все не обратили внимания на это визгливое кукареканье. Пусть кукарекает, что с него взять? Руководитель проекта – не человек. И так далее. Ну мы в итоге короче стрелки перевели на дизайнеров, типа они лажанули и всё такое. В общем прокатило. Короче как всегда программисты спасли проект.

Я потом реально увлёкся этим пакетом, временно даже забил на Анриал, исполнял там пару фишек – ну свиборг, пинбол, машинки – всё такое. Только свои машинки у меня не получались – сразу колёса отваливались, поэтому брал готовые из демосценок и тупо переделывал внешне. Хотел потом даже Соника сделать, типа грин хил, все дела, но чёт потом это таким гемором стало, что я в итоге забил, да и работы много было. И вот сейчас нашёл на флешке Эспирент Креатор, по-видимому, тот самый, потому что дата была 2009 год. Посмотрел, молодость вспомнил, кайфовые времена, 7 лет прошло, даже 8, а он всё остаётся офигенным пакетом разработки и дизайна 3Д интерактивных приложений. Там и усовершенствованное освещение, световые карты, продвинутые шейдера, какая-никакая физика и никаких C++, иерархий, покупаемых контентов и так далее. Такая вот история, такие дела.

Сочинение на тему: как я провёл лето 2009 в Esperient Creator