I am in week 2 of the production of our game Naar. It is a roleplaying game set in an oriental fantasy world. You play as Mokhtar, a djinn who set out to defeat an evil demon Iblis. The main feature of the game is spell casting and combining spells to create new spells. In this production I took on the role as lead programmer, which means I have to overlook the programming, plan code structure and if necessary, delegate tasks. I do a little programming as well as much as I can.
The first week was all about playing around with the game engine, Unreal Engine 4. That week I set up an animation state machine using the visual scripting feature of UE4 called blueprint, a repository on bitbucket using Source Tree which is a version control software used to merge versions of a project to allow everybody in the group to make changes in the same project from their own computers and an animation state machine.
The animation state machine contains four different states: Idle_walk_run, jump_start, jump_loop and jump_end. In Idle_walk_run I use something called blend state which is a method of merging together different animations so that there is such a smooth transition between animations as possible. In this case the animations are: idle, where Mokhtar stands still and breathes. Walk, where he is walking and Run, where he rolls around and dies. No he runs of course.
The three different jumping states is a way to make jumping or falling animations easy to deal with. For example, if there were only one jump animation in which the avatar jumps, lingers in the air for a while and lands, this animation would loop all the way down to the ground, jumping and landing while still falling if you would jump of a cliff. If you cut these into sections, the character starts to jump and when this animation is almost done, the jump_loop state executes and a section of the jump while the character is in the air loops until they reach the ground. On the ground the last state Jump_end executes and the landing animation plays. Then the last transition occurs back to the idle_walk_run state again.
This week I have been doing a UML-Diagram for the spell-hierarchy. I thought that since UE4 is made in the language C++, an object oriented approach would fit in naturally plus this way of thinking code is what I am used to, as opposed to data oriented – or component oriented design which is unfamiliar to me as of yet. The difference between data oriented approaches and object oriented design is that with data oriented design, the actual data handling is considered first hand to optimize efficiency for example, while object orientation sorts classes based on common features, for example a rocking chair is a chair, the chair has a seat, some way to rest your back and four legs. A rocking chair could be thought of to inherit these features from a chair because it has those qualities in common. What separates a rocking chair from a chair are the rounded things attached to its legs. But it is still a chair.
I have also made a prototype shooting animation that can play from every animation state and is handled by controller input events using blueprint. when you press the X-button on an xbox 360 controller the light spell casting animation will play. No additional functionality is implemented yet. I have also created a Behavior Tree for the first enemy. It is very simple. The enemy is only supposed to walk around following a set of targets until Mokhtar comes into a certain distance of it, then it attacks him. When it attacks it sends an event message that can be picked up by surrounding enemies, reveling Mokhtar’s position and the other enemies would start attacking as well.
Last but certainly not least, the first version of the boss’s behavior tree is also done. The boss will move toward different positions where he will lift rocks using a gravity spell and then throw them at Mokhtar. if mokhtar is close he will be pushed away. He can be rendered unconscious by getting hit by one of those rocks if Mokhtar uses his spells to throw them back at the boss. In that case he will let out a cloud of gas which can be ignited by a fire spell. The following explosion damages the boss and sets him into the next stage where he will start using more aggressive spells. There are three stages before he is defeated, each will add aggressive behavior to his behavior.
Here are links to pictures of work I have done until now: