Thursday, 29 March 2012

Keys...

So after two wonderful and relaxing days after my Viva (which went pretty well I think), I've been thinking up some ideas to better enhance my level, namely the assets and symbols in the level that can help the players solve the puzzle.
My main and probably only puzzle is 'find a key, unlock the door'. Which I admit is very basic and boring. The only thing I have going for it is to make the keys and doors look 'pretty'. I thought of other things like themes behind rooms- which would contain the next key to the next room.
I've put together a sort-of moodboard to help me decide on these little themes:

There cartoon ones, short, long, bulky, symbolic, gothic, eccentric, bold and even simple types. I personally really dig the gothic kind, but I think I want to try bring them out, so combining them with a cartoon look should do the trick. Think Kingdom Hearts only not as cartoony!

Monday, 26 March 2012

Special Post!

Here's some cool gifs I made for my Viva, neat aren't they?

 
 
 

Sunday, 25 March 2012

Dissonance Progress Video (Viva 02)

Here's the progress video of my project. It shows my current achievments with some mechanics, though it had to be cut down quite a bit since I'll be using this for my second Viva.

User Interface Concept

Concpet for Scaleform UI




Pause screen

Death screen


Thursday, 22 March 2012

Somewhat Finished Decor of Bedroom

I just wish I had more time, maybe another day and I could do so much more.... off to Leamington Spa I go. Here's the latest shot of the room, it's looking good, the challenge is to get everything else to look as good.


Tuesday, 20 March 2012

Asset Models/Texture no. 2

More assets, and now this is probably where I'll need to stop (although it doesn't mean I definitely will), time to prepare my level and presentation.

Door Frame  Tris: 432

Victorian Frame 03  Tris: 224
Simple Chair  Tris: 468
Simple Bed  Tris: 464
Arm Chair  Tris: 616

Monday, 19 March 2012

Asset Modelling/Texturing Crazy

In preparation for a good second Viva, I've been busting my bottom to get these out as quickly while trying to maintain the quality I try to stand by at all times. It was difficult trying to cut my time, unfortunately I hate it when things aren't as perfect as I wanted them to be, so these are rough- but I'm not done with them yet! I will continue to modify and improve and model more for the final Viva.
Standard Door  Tris: 684
Simple Lamp  Tris: 296
Trap Chandelier  Tris: 1424
Cupid Bracket  Tris: 196
Victorian Frame 01  Tris: 878
Victorian Frame 02  Tris: 166
Morbid Mermaid Candle Holder  Tris: 734

I actually have more models to texture (it's been a very productive weekend), but that will be updated tomorrow.

More to come soon, these will be the last of the batch:
Arm Chair
Victorian Frame 03
Simple chair
Simple Bed
Door Frame
Book case

Thursday, 15 March 2012

Path Node Finding

The path node finding is scripted almost entirely, now I can place as many path nodes in my game level and the monster will randomly choose the destination and head towards it. Therefore I don't need to rely on the MoveToActor kismet.

I cannot take much credit for the code I used to get pathfinding using nodes and scripts. After the pylons were placed into the map, mougli's code worked. So the only problem I really had with it in the first place was a lack of a navmesh. The pylons made everything work!

The code used before to calculated the velocity/speed/distance of the monster when travelling towards the player is now uneccessary. Because of that, I was able to use Mougli's AI Script mentioned in previous posts. Christian Skogen helped me out again especially with two parts of the code that would allow the monster to randomly choose any pathnode on the level and travel to it, of course it has to be within the range of the pylon placed there.

I will explain the additional parts of code here:

I used Mougli's code for AI with slight alterations like changing state names.
Then when it worked and the monster could navigate around corners, I tried looking up a way to call pathnodes into script (my monstersaicontroller). I came across this thread which told me about the arrays. This adds the pathnodes into an Array- a list of data. So then you can begin to use them in script.

simulated event PostBeginPlay()
{
    local Pathnode Current;

    foreach Worldinfo.AllActors(class'Pathnode', Current)
    {
        pathNodes.AddItem(Current);
    }
   
    super.PostBeginPlay();
}
Then looked up Random function, and vector maths (with much of christian's help). Applied that until I had a AIcontroller class that would make the monster choose random path nodes, navigate and travel to them. The chasing state (chasing the character) is still intact and just contains Mougli's code. Instead of an Idle, I changed it to Patrol, since it would no longer be idle and just copy/pasted mougli's code again.

He explained how vector maths worked so I could grasp the last bit of code. The last part of the code is an if statement- basically IF the distance between the monster and the player is less than the chaseDistance=1000 (which was alterable in the Default properties), the monster would give up and go back to finding patrol nodes.
 This was placed at the end of the Chase state just before 'goto Begin;'
    if (VSize(target.Location - self.pawn.Location) > chaseDistance)
    {
        WorldInfo.Game.Broadcast(self, "Lost player");
        GotoState('FindPatrolNode');
    }   

About Pylons

I was quite wrong about my 'discovery' yesterday. It seems that Pylons are picky about the ceiling height of your sub/add brush- they don't dislike subtractive brushes at all, as I tested again and it turns out the real issue was the height of the sub and add brushes. If you have a floor and also a ceiling there seems to be minimum height requirement. Which sucks really that I couldn't figure this out sooner. I was left scratching my head until now.

Wednesday, 14 March 2012

Navmesh Alternative or is it?

I tried and tried to impliment the code from the previous post in so many ways, I gave up. I looked far and high for a solution, and finally after four painful hours of self-inflicted mental torture there was a god... I mean,  videos:

Still now I'm not sure why the code from before did not work, but I found that I can at least cheat the patrolling of my monster by using path nodes. Very generously Ben Townley shared me a kismet sequence he discovered last year that could attach a volume to a spawned bot and kill the player. Since I haven't enough time to get a full melee system working, this is a very important alternative for me. Thank you again Ben, you've saved me.
I had also used a 'MoveActorTo' sequence, and it should have worked perfectly but it didn't. At first I thought it was the nature of my AIController code, so I tried replacing everything with premade code (copy/paste). But nothing worked, besides the code I already had, and I had lost it. My housemate tried to calm me down and tried to help me look for anything to do with Pylons (because i had started muttering it and remembered Ed had mentioned it vaguely for navigational meshes). I felt like I looked it up almost everywhere, there wasn't any tutorials out there that would guide me except for the videos above (which were found not by me but my amazing housemate).

I watched it with the biggest feeling of doubt ever, since nothing was working I didn't think this would either. The current UDK version uses pylons with a area distinguished by a cube rather than a shere/cylinder/circle as shown in the video. I tried what the man in the tutorial had done but it gave me an error:
'error:Could not find ground position for pylon - this pylon will not build paths' 
These lines appeared after building paths with the pylon.
... I then tried it on one of the simple premade levels, it worked, the paths built just fine. The floor there was a static mesh, and I took a very big note of that. Next then I had tried it in an empty level with and Add brush and subtractive brush inside, it didn't work...

So I was questioning if it was because it didn't work on brushes period... this made my heart sink very low. But that was stupid, either it was because the brushes had some form of navigational mesh there already and this pylon business was unessessary or I was doing something wrong- or both.

In the tutorial I finally noticed he was using and additive brush, and everything else was actually a static mesh. My level consists heavily of subtractive brushes. Turns out the pylons do not bod well with subtractive brushes... *BEEP*ing hell.
So i tested this again.


It works!! The monster travels to the second pathnode. This may mean I have to do some heavy reconstruction to my level. Sorry if this seemed obvious to you, but I am an incredible script/code noob. :)

!!!*EDIT*!!!!!
Turns out I was wrong again. Check the next post.

Monday, 12 March 2012

Nav Mesh and Step sound trouble

I've progressed a lot, but it seems these two things are something that should be easy but are not for the reason that, I've got a crap load of code already and I don't know how to get it working with new code.

Mougli's Navigational Mesh tutorial
This guy Mougli is no doubt brilliant, but his code is something I would have to try and literally integrate with my own.

The customAIPawn is fine, but the customAIController is hard to impliment, here is Mougli's:


My dilemma is I don't know how to integrate his code into my own. I've tried many things, but alas I don't have enough scripting/code knowledge to do this.
Here is my code, you can see I've started to put in some code, I already have and Idle and Chase state though, and all the inner workings of the speed/velocity of the monster to player. However instead of using this odd 'Go to begin' method, I applied it per 'Tick' which is like a refresh, and probably considered a more stable method (as told by a programmer).


Footsteps trouble shoot thread
The guy who started the thread has solved his problems but I don't know what he means when he explains:
 "Got it working, it seems like the footstep animnotify calls PlayFootStepSound(); already, so all I had to do was setup the playsound functions, and the footstep notify in the Animset."

Maya to MotionBuilder: Importing C3D and mapping Actor

Been asked for help by Neasa, so I thought I'd blog it here, it would be nice for others too, mind you this is super vague and I'm not an expert so I'm just showing how I went about it.
Video Tutorials on Maya to Motion Part 1, Part 2 from adachan1 on youtube.

Firstly, you need to have your animation data from ViconIQ, in .c3d format- or fbx if you've already messed about with it.  You need Maya 2012 if you want to import/export it easily like I did.  Also this tutorial uses the skeleton generated by the MotionBuilder characterisation plugin in maya. So if you have a custom skeleton, I can't help you too much with that.

Open up your MotionBuilder, and for your sake, set the keyboard configuration to 'Maya' so you won't have to relearn all the controls again for MotionBuilder. This means things like the move, scale and rotate tools are all asigned to the same 'W, E, R' keys. 

Settings > Keyboard Configuration > Maya



Importing your Animation Data


In the Asset Browser tab under the 'Resources' area, you can selet useful files here like the Actor dummy. I added a file directory containing all my animation data, so it was easy for me to access. Right click > Add favourite path. You won't regret it.






 
So with your folder added, you can quickly select your files through this browser. Click and drag the file over, select the 'Import' option.


Sunday, 11 March 2012

Monster Finished!

Something I put together to submit to my deviantArt, it displays wireframe too.




Monster Texture work-in-progress

I have a few versions of my monster, and most of these were by accident, the first head was unintentionally awesome. But I wonder if I should try to stick to my concepts?




Saturday, 10 March 2012

Physics and Death Animation



Physics Asset tweaking. I originally wanted a death animation, but somehow I'm finding the Physics Asset editor to be quite amusing.

Tutorial by a Really Chilled Out Dude



Applying Ragdoll on Death

After quite a bit of googling, I managed to stumbled upon a string of links that helped me simulate a function in my customPawn class to allow for a ragdoll effect on death. I'm extending from UDKPawn, according to the poster of the thread, much of the code comes from UTpawn.
Code that allows for ragdoll on death 
For me the code works completely, but the character fell through the floor, and equally as quickly I found that you must add 'Mesh.SetBlockRigidBody(true);' in the ragdoll properties.

Now this is what it looks like when Cecilia gets killed by a cabinet:

Friday, 9 March 2012

So Much Help with my Monster Animations

After sulking (not getting anywhere) for a good two hours, I recieved a crazy amount of help from a BSC Games Developement student. Unfortunately he tried to explain the workings of enemy AI classes, but my code-illiterate skull could barely comprehend it. So I'll try to write it down here, to look back at.



CustomAIController Class

I have an 'Idle' and 'Chase' state made (line 12 & 29), and within these is where the monster is told to use the animations and when. 'auto state Idle' means it will go straight into the Idle state as soon as it is spawned, this is the default state the monster will be in. Below that is an 'if statement' that will tell the monster to chase the player if she is within range and sight. This is where the AnimationTree is used. 'self.pawn.SetPhysics(PHYS_WALKING)' for example is set when the distance of the player to the monster is less than the max chasing distance. The monster starts the running animation because I assigned it to the 'PHYS_WALKING' node from the monster's AnimTree in the editor.






'state Chase'
'event Tick(float delatTime)' <-- in the brackets we're telling deltaTime will be used, so letting it know where to find it.
In the event of a 'Tick' (a refresh) it checks for distance and direction between player and monster- this is also where the calculations of speed and movement are made too since it is a custom made state.

'deltaTime'
This is a calculation that adapts the speed of any particular computer running the game engine to a constant. For example, a slow computer will have less 'Ticks' per second than a more powerful computer. Without the 'deltaTime' the monster would end up moving much quicker on the more powerful computer, because it moves per 'tick' (it moves x amount of units per refresh). In this case, the deltaTime multiplies by a much smaller number to give the same speed, as it would on the slower computer.

'Normal(selfToPlayer)'
Normalising 'selfToPlayer' is concerning diagonal directions. It is simple to state the speed and distance straight on the X or Y or Z axis, but if it were applied to an (e.g.) X,Y co-ordinate (a diagonal direction) the monster could end up travelling too far or/and too fast as it would try to apply the same speed-per-distance. 'selfToPlayer' is the vector between the player and monster, the direction. Normalising it creates a shorter line, this line is always the same length no matter what direction/distance is normalised and is used like the etchings on a ruler. This line, along with the ground speed and the deltaTime, forms the velocity of the monster. Basically with normalisation and deltaTime, the monster will now travel the same speed, independent of direction and computer speed.




Monster Texturing


Thursday, 8 March 2012

Fixed my shadows

They're not black anymore, all thanks to Allar's Awesome Blog. Dynamic lighting was a must for my character to be seen, this bit of code allows you to light your character up with the environment too, this was probably present in other pawns.

Monday, 5 March 2012

Rigged & UV unwrapped Monster

Over the weekend I've been finishing the model for my monster, retouching pieces and unwrapping it. It's ready to be textured.


Texture UV

Rig and light map UVs on the right.
Today I went to FADE to get some advice and help from Ed about custom animations, particularly an animation for the 'Use' function when pressing 'E' on the keyboard. Unfortunately after many hours of trying there wasn't much luck, I believe it has something to do with where I extend my classes from in my CustomPawn.
 
FullBodySlot for use animation, work in progress...



However I at least manage to import my monster's skeletal mesh and spawn the NPC. It works as it did two months ago, thankfully. All that's needed is to attach some kind of KillVolume to simulate instant death at encounter.

Attempting to attach a kill volume on the NPC... it didn't go quite to plan, it was the NPC that de-spawned when it hit the main character.
So far here's what I have, the animations on Cecilia are almost final, and the monster's AI & Controller classes need tweaking to get it's AnimTree to work. I'm not sure why there is a navmesh problem just yet, but it seems to be fine on a fresh level. In the worst case I'll have to rebuild my Maze from bottom up.

Saturday, 3 March 2012

Cecilia's animation in UDK

My animations finally work, it was a matter of 12 hours of labouring through raw cut animation data, discovering that FBX randomly adds two frames and having to tweak for ages until they are correct.
I have several animations ready in the AnimSet editor below, and have assigned the basic animations such as the walk cycle (I have the run cycle but it still has a blip in it so I need to go back to edit the blasted thing).

As mentioned in the previous post I need to look into the dynamic lighting, since it's obvious that the shadows are not meant to be pitch black. Here's my animation + awesome camera in all it's glory. By the way, it looks much better in my level, but I needed to use this to demonstrate the harsh shadows in a well lit area.

Friday, 2 March 2012

Problems 101!

Floating Character
I double checked that my pivots were at the feet of the model: the pivot of all the meshes, the character reference, but not the skeleton itself. I think this has a lot to do with why Cecilia is floating. But others have managed this perfectly fine the way it was. I haven't put an animation on Cecilia yet and may do this before solving my floating problem.

It seems to look fine in the udk skeletal mesh viewer. I had opted for the option of changing the origin but it was already at ' Z= -50', I set it to 'Z= -80' and it looks fine but now the camera is too high. So there are a few things I must consider before looking into this problem. I will come back to it soon.


I'm beginning to think this is not a model/skeleton problem but maybe a setting in udk.

Dynamic Lighting
As well as this I have turned on dynamic lighting, but it causes a very harsh and black shadow on my character. My scripts also allow the dynamic shading but I'm unsure as to how to change the colour of the shadow so that it won't be as dark..

The Infamous FBX Problem
I've finally witnessed this irregular and quite illogical problem. The class have been going on about this interesting quirk with the FBX exporter. It seems after I tried applying an actual animation in the UDK editor, my model screwed up. This is a paint weights problem, and here's the kicker... you cannot save in a session of painting weights to your character in Maya before exporting. Yes, that is the problem solver. To make sure this worked, I quickly rebound my character to the skeleton and exported it, as you can see from the second image below, the animation and mesh are running smoothly without problems.


Cecilia Running animation refining

I've been so busy lately, I haven't had the chance to impliment my character in game. I have been refining the normal running animation ready to put into udk though.