Monday 30 March 2015

Week 26: Easter Holidays - FPS Optimization?

A level full of lag.

Another week has passed and we find ourselves within the ongoing Easter holidays. This will be a rather short post, since not much has happened this week! While it is a bit of time for me to rest, it is also the time where I finally get to implement most of the gameplay into our Alice In Wonderland level though, so I will try and get more done during the next week.

The problem we are having at the moment is with FPS and optimization. We started off the week by implementing the much needed LODs into our level and after all the work of implementing them had been done, we noticed only a very slight increase in FPS, which is not what we had hoped for! The level still runs with an average of 15-25 FPS and that's simply not good enough, especially considering that we are using high end PCs and we simply can not expect the judges to have a similar machine to run the level on. So I took another look into it and got in contact with some communities online to figure out what exactly was causing the FPS lag. After quite a bit of digging I discovered a tool that would help me debug the frame rate and with that I could easily see that one major issue was lighting.

My first step was disabling all the dynamic lighting on the foliage, since (thinking about it now) having thousands of meshes cast a shadow, which changes every single frame would obviously be quite heavy on performance. This however meant that we would loose all the shadows in the level, which made it look a lot worse, so I decided to try using static lighting instead. Unfortunately I did run out of time in the end and wasn't able to build the lighting yet to see what the level would look like with static shadows, so I will have to try this out as soon as possible.

There was another element that was causing a lot of FPS lag (approximately the same amount as the dynamic lighting), however I have to further investigate into that as well. Hopefully by the end of all this I can get the level to run at 30FPS+ and then focus on getting the gameplay elements implemented.

Until then, stay tuned~

Monday 23 March 2015

Week 25: Breakages and Aspirations

An Eventful Ending

The Easter break is finally here and with it we say goodbye to the last major term of this year. After the holidays we are back for another 2 weeks before the hand-in of our last project and then we get to work on own projects while our work is being marked for this year. Actually no, that is not quite true, because we actually found out this week that we will be getting an additional 2 weeks to finish-off our Alice In Wonderland project. Wohoo!

Although we were doing pretty well up to this point and I feel like this project is the first group project that I have done this year where not everything has gone completely wrong, we did have a couple of down moments throughout working on our Off The Map Competition entry. This was usually minor things, which only really seemed pretty major at the time, but were easily solved within a couple of hours. This time, we had a bit more of a major problem though!

Group work is super-awesome! (Well, sometimes.)

I had been working throughout Monday and Tuesday to implement a new mechanic into our level: Level Streaming! This would allow us to load levels faster and easier and also have animated loading screens instead of a frozen image with text. Awesome! However, this was also the first time we used this new system and it meant that we had to get used to switching between levels within the editor and having all the other levels be visible on the screen at the same time. This could get confusing, for example if we were to place an object within the dark world, but forgot to actually switch to that level and still have the normal world set as the active level. Once we would then unload the normal world, the object that we just placed would disappear with it, no matter if it was actually placed inside the normal world or the dark world.

In the end it turned out that this way of working (while it worked great for us) was just bad practice though and we faced a massive problem with our landscape completely breaking and causing the engine to crash everytime we tried to edit it. This was a major problem as Anya took over the engine from me to place a lot of foliage into the level and populate everything and the foliage she painted was bound to the landscape. Replacing the landscape with a new landscape would therefore mean that we would lose all of our foliage and that would've been quite a big impact on our progress. So we tried to solve the issue and I went into contact with an employee at Epic Games (the developers of the unreal engine) who tried to assist me by taking a look at the level. In the end it turned out that the only solution for this problem was to switch directly into the level we were editing, rather than using the level streaming within the editor. It took us a whole day to figure this out, but at least in the end we managed to save our project. Phew!

An engine crash! Oh wait.. wrong engine.

Technical Artist?

Furthermore, we had our formal reviews this week. Funnily enough I was actually looking at internships at different companies on the day before and discovered a position for a Technical Artist Intern at Ubisoft in Newcastle. I had a browse through and pretty much decided that becoming a technical artist would probably best suit me. Combining modelling and texturing with scripting is something that I personally feel like is interesting and it almost seems that it is pretty much what I am doing on this project right now already and what I have done on the project before. When I came into my review I was promptly told by my tutor that a technical artist is what I've been put down for as well. So clearly, this is where I am going, which is great!

I finally feel like I have something to aim for. So far I was always quite unsure of what to do, but it seems like I have found my goal and now I can focus on getting where I want to be. One of the things that stood out to me were the fact that I needed to have good knowledge of scripted language such as Max Script and Python for the internship at Ubisoft, which is something I have yet to look into. I am fairly confident when it comes to scripting, but I have not yet had the patience to sit through and actually learn a particular language. I know bits and bobs when it comes to PHP and back when I was playing a lot of Garry's Mod, I learned scripting from scratch using a made-up language known as "Expression 2" (http://wiki.wiremod.com/wiki/Expression_2) within an addon called "wiremod", so I am fairly confident that it should not be too hard for me to pick up on Max Script or Python. However, for now I will concentrate on getting our current project done.

Easter Holidays!

I am aiming to keep posting on my blog over easter, since I have quite a bit of work to do for out project. Most of the asthetics are done now, but I have yet to create many cutscenes and puzzles. We went over this during the beginning of the week and I have made a nice big list of stuff that I need to do. I am quite confident that I will get everything done though and if not, then I still have 4 weeks to finish it off after Easter and most importantly several months until the final hand-in for the actual competition. So I should be fine.

Stay tuned~

Sunday 15 March 2015

Week 24: Sounds fishy!

When will the blueprints end?!

The short answer: Not yet, and looking at it, probably not that soon either.

Over the past few weeks I have been focussing a lot on blueprints and I am glad to say that I have learned a lot! I am becoming increasingly more confident in scripting using Unreal's blueprint system and on top of that I am fully enjoying it, however there is a slight problem. I am still studying Game ART - and there's a reason for that.

I was originally always more inclined to become a programmer myself. I was naturally very talented in maths and my logical side of the brain is a lot more predominant than my creative side. After I had finished school I was aiming to study maths and computer science, however things went a bit out of hand and I found myself stuck taking a gap year instead, which was followed by another gap year in which I even started working, until I finally decided that I didn't yet want to give up on my aspirations of working within the games industry and had to get back into learning.

The 2 Sides of the Brain (Logic and Creativity)
During my gap years I had tried to learn programming myself, however I quickly lost motivation and it didn't go all too well. The subject was easy enough to learn, yet I just didn't want to go on. So instead I took up a course at college labelled "Games Development", fully knowing that it will most likely be either programming or art, since those seem to be the 2 major components of making video games. When I actually started the course this turned out to be art.

At first I was a bit scared that it might not be the course for me, as I never considered myself to be any good at art, even though throughout all my school history I studied art (mostly because it was compulsory back in Germany and when I finally moved the the UK I decided to choose art as a subject since I was so used to having it within my curriculum.) After I had spent a couple of weeks it quickly became apparent though, that most of the people on the course didn't seem to be the creative type either, so I adjusted. I then also discovered 3D modelling and quickly fell in love with it. Although I never considered myself to be a creative person, I absolutely LOVED creating things. 3D Modelling is quite a bit more technical than drawing and it suited me a lot more than using pen and paper, so it became one of my favourite things to do! I even took part in the very first 3D Speed Modelling Competition endorsed by World Skills UK and won!

So throughout my time at college, I discovered the second side of making video games and I was more inclined than ever to get a job in the industry. I ended college feeling quite comfortable with my 3D skills, however I knew my 2D was still quite lacking, so I ended up applying for DMU, since I had heard that the Game Art Design course at DMU is a lot more 2D oriented at the beginning and I had hoped that this would give me a chance to improve my skills in that area. Safe to say I was more than excited when I had heard that I managed to get accepted onto the course.


Looking back at it now, I definitely got what I asked for in the first year. A lot of drawing and still quite a bit of creating 3D models; And my skills in the 2D area improved drastically. The second year however, the curriculum had changed. The industry was moving forward fast, so the course had to change in order to adapt the changes in the industry. We went from covering the basics of art straight onto content creation and as much as I had liked to have another year of going out and drawing the world, I wasn't too fussed. In the end I knew that what I truly wanted to do in the industry was anything to do with 3D modelling (most likely environments, since I am still not too much into characters) and actually creating my concepts in 3D would help me get better in that area.

With the last project (Container City) and this project (Alice in Wonderland), my focus has changed a lot back into working more technically. Especially using the Unreal Engine 4. Since most people on our course are more creative than technical I sort of felt inclined to take over the scripting side of level creation; (A level is not a level, unless it's interactive!) - And I thoroughly enjoy it as such, due to my history of learning how to script and my more logical brain. However, I have slowly been thinking more and more about the art side and I really need to start taking care of that. So I really want to get back into doing more arty stuff for this project. However, as it seems right now this won't happen too soon, since there is still a lot to be done on the interactiveness of our level and I am working full steam ahead to make sure we get everything into our level that we want to.

So let's get into what I have done this week.

Funky Fishes and (K)omplex Kelp

This week started a bit earlier than Monday, since I had received a message from Anya who had finished rigging and animating her fish models and had them ready to be imported into the engine for me. So I sat down in the evening on the weekend and gave it a quick go, which worked out great and by Monday morning the fishes were all in the engine and had their animations assigned, so that I could begin scripting a simple AI for them.

To do that I took my butterfly blueprint as an inspiration and made minor changes to it to make it seem more like a fish than a butterfly. I am glad to say that I managed to get the blueprint working pretty quickly and the fishes look absolutely adorable! Unfortunately. I haven't got any screenshots available, but if you head over to Anya's blog you can have a look at them.

Furthermore I also took on another little challenge that arose this week. Anya had modelled a string of kelp and rigged it to animate it to move slowly so it looks more lively underwater. As it stands right now, you can't use the foliage tool to paint skeletal meshes in Unreal, which meant that we had to come up with another solution, since placing every piece of kelp by hand seemed a little over the top. To solve this issue we once again resorted to using blueprints.

I knew that it was more than possible to generate random foliage with blueprint, since there was an example of this in the blueprint examples demo in UE4. I also have been becoming a lot more accustomed to using the construction script within blueprints in UE4. This meant that creating this kelp generating blueprint wasn't all too challenging. However, I only managed to get it to work for a square area at first, by using 2 points that mark the start and end of the square that you could place as needed within the world. The hard part was making the kelp generate in a circle around the area.

My first idea to solve that issue was jumping straight into calculating the area of a circle: pi*r^2, however while that gave me the area of the circle, it was the size and not the actual coordinates. This was a lot more complex and after some research I finally got it. This is also when I realised that I did this sort of thing before when I plotted a circle into a graph using maths. The simple solution to this problem was using sine and cosine. Using sin(A)=x and cos(A)=y you can find a single point on the circumference of the circle. 'A' represents the angle (so 0 would be facing straight up and 90 facing to the right, etc.). So for my kelp generator I used a random float between 0 and 360 to find a random point on the circumference and then used a random float between 0 and the radius of the circle to find a random spot within the circle to place the kelp at.

You can find a bit more about this on Mark's blog and also about how we solved some more issues underwater.

Rocky Road ahead?

I still have to create some rocks in the near future. This is one of the only arty things that I got assigned to do for this project and I really want to get into it. I did some practice with zBrush earlier in this project trying to create rocks, however I haven't actually done a rock that I was pleased with yet. Due to a recent lecture from a third year about baking normal maps I think I found a reason why my rocks just didn't look that great, so I am aiming to get some better looking rocks done pretty soon.



Oh and I also did a bit of a personal project. I sat down and tried to script a little Tetris game in Unreal, just using blueprints. The game is still in development, however there is a playable version here: http://goo.gl/7R5aQh Tell me what you think about it in the comments.

Sunday 8 March 2015

Week 23: Like a Butterfly!

Little Problems and Weekly Changes

First of all let me say this: Our level is making an amazing progress!



I ended my last post by saying that I would aim to get the tea party puzzle finished by this week, however I quickly discovered this Monday, that this would not be the case. First of all I encountered a problem: Previously in older versions of the engine you were able to select a group of meshes in the level and convert them all into a single blueprint. I was going to use this to make a blueprint for the tea party table, which I could then play around with to take out some parts and enable the player to find them. However, as of 4.7 this feature has been replaced with something different, so I ultimately wasn't able to do what I planned to do.

I also thought once again about the puzzle in general and wasn't too keen on it anymore, so as a group we will have to think of puzzles a bit more. While we do have a few nice puzzles in the level, as it stands it just seems like we're still lacking gameplay. This will be an important part, as we won't just be judged on how nice the level looks, but also on how much interactivity there is. I hope we get around to this problem soon and find some nice gameplay elements that we could implement.

Additions: The Butterfly!

I did manage to work on something awesome this week though: A butterfly! I already started working on it a bit earlier, however this week I focused on completing it and now I have a fully working butterfly with very basic AI. I am using blueprints in this case to simulate AI, rather than using actual Unreal Engine AI systems. The whole idea is inspired by a butterfly that I found within the blueprints example of UE4. I made the whole thing from scratch however and also included a little addition. I wanted the butterfly to keep a distance from the player, as it would feel more realistic (anyone who tried to catch a butterfly before knows how hard it is to get close enough to a butterfly**) Everything works like a charm. The butterfly finds a random target to fly towards every few seconds and if something is within his range then it will land on it for a few seconds. If you get close to the butterfly it will quickly fly up high into the air and out of the player's reach. The model itself for the butterfly was made by Mark and it looks absolutely stunning!

Next up I am also planning on implementing a bird, which will work the same way. However, for that I would need a fully rigged bird with animations, as it would look weird if I have the wings of the bird flap in the same way as I have for the butterfly.

Additions Part 2: Collectibles

Finally, I have sat down and created a quick blueprint for collectibles. It's a fully dynamic blueprint, in which you can choose a static mesh and it will make it look and work like a collectible. I made the mesh glow slightly and added some sparkling particle effects around it. The object is then rotating slowly and bopping up and down slightly in the air. Looks quite awesome!

Plans for next week:

For the upcoming week I am looking into further thinking about puzzles and trying to implement some more things into our level. I will also probably look back at the maze that we have in our level as we are currently working on changing quite a bit of it. Also if I will find some time I want to try and do some more arty stuff. After all, I am studying Game Art Design :)

Stay tuned~

**- And yes, I have actually tried to catch a butterfly..(during a volunteering session I did as part of my job at McDonald's) and I succeeded:

Sunday 1 March 2015

Week 22: A Quick Week

Progress on the Project

Aaaaand woosh! Another week has passed. I feel like it wrote my last blog post just yesterday. Our level is progressing along nicely and we are slowly filling in the missing gaps with more and more assets. I was focussing on completing the fountain puzzle this week by implementing the checkpoint system. You can now return up onto the middle platform of the fountain once you've reached that point in case you ever fall down, which will make it a lot easier for people to complete the puzzle without getting too frustrated about it.

Another new addition this week was UMG. The Unreal Motion Graphics UI Designer is a great tool within UE4, that can help the user create a working UI without too much hassle. I used it to create text's within our level that notify the player of when he reached the checkpoint. It will also outline the key the player needs to press in order to return to the checkpoint once they fall down. In addition to that I also ported over my old HUD, which I used for switching between the worlds, since it was much less complex this way.

UMG UI Designer

I did encounter one problem while using UMG and that was the fact that, although you could have a tick event within a UMG widget, you couldn't run more than 1 line of nodes at the same time. Sequences didn't work and neither did custom events. In the end I had to resort to creating a single UMG widget for every bit of text that I wanted to appear on screen. Maybe not the best solution, but still a lot less complex than my previous HUD.

Apart from that not much has happened unfortunately. The week went by so fast that I didn't get around to doing a lot of other things. I did mess around with the water a bit and came up with yet another water shader, which I am quite pleased with, however there is a slight problem, since it is practically invisible when viewed from below the surface, meaning that once you enter the water the water surface disappears, leaving you feeling like you're floating or something. So far I have failed to find a work around for that...

Next Week:

Looking ahead I am starting on the next puzzle now, which I will focus on during the next week. Currently we are planning on having a puzzle within the tea party area. This will require the player to set the table by picking up objects and bringing them to the table within a certain time limit. So far I have touched this briefly, by creating a particle effect for fireflies, since our tea party area (within the other dimension) is quite dark and I found that you could barely make out anything on the table. I also have previously worked on creating the possibility for players to pick up physics items and carry them, which will take away a lot of the scripting that I need for this puzzle.

Glowing insects? Awesome!

I will aim to get the puzzle done by the end of the week. Stay tuned~

Oh and yeah, Unreal Engine 4.7 has been released and it's amazing! ( https://www.unrealengine.com/blog/unreal-engine-47-released )  We previously had some problems with foliage shading within unreal, but that problem has finally been fixed and the foliage is looking better than ever! Yaaaay!!