Monday, 2 February 2015

Week 18: Through Sweat and Tears - And Blueprints! (Post-Mortem)

Unreal Scripting

Where do I begin? - I finished off last week by writing about my torch and the problems I encountered with it, however this was just the beginning of all the scripting I had to do, in order to get this level to work. I wouldn't consider myself a scripter/programmer, however I did have previous scripting experience as well as a pretty strong logical mind and that definitely helped a lot in this project.

The scripting system in unreal engine 4 is known as blueprints. They are easy to understand for most people (even those who have never done any programming), but when it comes to complex scripting it can be quite hard and I learned that the hard way. While most of the things I wanted to script into the level were quite simple, they turned out to be a bit harder for some things. For example:

I wanted to make text appear on the HUD. One bit of text which shows the controls to the player, that can be toggled by holding a button and several other bits of text that appear and fade away when you pick up items, etc. While that might sound quite hard I didn't expect to produce something as complex as this!:
HUD Blueprint
I can already hear some of you say:"But Hey! HUDs are never really easy to create!" - and that's true! - However, there was even simpler things that were a lot more complicated than they had to be. Like Global Variables.

Why can't I just create a variable in the level blueprint (which btw. has access to any component within the level) and then be able to change it within every other blueprint? There is of course a way to do this, however it's a bit more complex. It involves either in you having to link 2 blueprints that you want to interact between together or you have to use what is known as casting. Now, for those of us that never heard of casting: It basically means that temporarily you switch over to another blueprint and do something AS that blueprint. For example if I want to have a global variable (or at least something similar to that) then I can create a public variable in blueprint A and then in blueprint B cast to blueprint A and set that variable to whatever I want to set it to.

If it was that simple, it wouldn't have been a problem though. It is actually even more complex. On top of the casting, you also have to specify which EXACT blueprint instance you are casting, too. This means the blueprint needs to be in the scene so you can select to cast to that particular instance, which then again is not too bad, until you get to the HUD or player controller. Which are both blueprints that are NOT in the scene, but rather get created once you play the game. In that instance, however, UE4 has got a simple node to help you out for that such as 'Get Player Controller' and 'Get HUD', but WHY is this so complex? All I wanted to do is set a simple variable to true and let ALL blueprints know about it!

Anyway, enough ranting. Another feature that I implemented which took quite a bit of scripting was the flashlight. I wanted it to move together with the camera. First I had to change the pivot point to be very similar to that of the camera itself and then it took a bit of scripting to find and set the position of the camera and the flashlight. I also created a socket at the front of the flashlight for the light itself to be in, so that the light would move with the flashlight. Here is a quick overview of the blueprint for the flashlight rotation:
Set Flashlight Rotation
Finally another scripting challenge was the end part of the level. We planned for our level to end with an elevator, so I had to script in the button to open the elevator door, which would only work if you had previously turned on the generator. It would have to open the door and upon the player entering the elevator I wanted a message to appear that told the player to press E to end the level. I would then want to switch the player to a camera and slowly fade out the level, while playing music and having the elevator rumble to create the illusion of it moving. After quite a lot of time scripting and testing I managed to produce this:
Elevator Ending Blueprint

The Final Result

I did manage to get there in the end and managed to complete the level; And I have learned A LOT about Unreal in the process. I can now safely say that I am pretty confident in scripting within UE4, which is great! Unfortunately, I haven't been able to do much else within this project. I was mainly focussed on getting everything to work and creating the materials in engine. I also got sounds to help set the atmosphere. I did model a very few objects, however my main part in this project was unreal, therefore I can't show off much. I am, however, able to show a video of our level. We had problems with the framerate and ultimately only got it up to 40-50 FPS, which meant that in the recording process it was running quite slowly, so I was only able to record it at a resolution slightly lower than 720p. I scaled it up a bit and here is the final result: 

Tuesday, 27 January 2015

Week 17: From Engine Polish and FPS Problems

Slow Progress - Container Walls

This week just felt like I managed to accomplish nothing at all, however looking back at it, I must admit that I did actually get quite a few things done. It's just not as obvious as it usually is. I left of last week with a change in idea and how I assembled the level and lit it up with torches. The main problem I encountered was an FPS issue at this point, which in return would take me a long time to fix. While it was mainly the PC that was the problem, I wanted the level to run smoothly even on weaker machines, so I decided to take some time and optimise my torches so that they would create less FPS-lag. I started by looking into the particles itself and trying to mess around with the settings so that it would spawn less particles (even though I only had quite a few to begin with), but at the same time making sure it still looks the same. Not much changed after quite a bit of messing around. I only got a very small boost in the FPS.

I then decided to step back and work on materials. A member of my group was supplying me with textures for the walls and it was my job to put them into engine and create the materials. I wanted to make sure, that the materials were customisable, to enable us to mess around with them and do quick changes as necessary. One example for this was that we wanted for the rust on the wall to be optional, so I used Linear Interpolates to blend textures together. In the end we decided to not use this feature though, as a level with rust all around seemed to give off a much better feel. We went through quite a lot of work in getting the rust to look believable, which was a lot harder than we first imagined. One of our first tries resulted in this:
Rusty Container Wall - Take 1.
As you can see the rust just looked a little out of place, which we later found out was caused by the fact that the rest of the wall was just too clean. Our original plan was to just have some walls with rust and some without, but in the end it just looked better with rust all around. We also decided that while it was nice to be able to customise the colour within my wall material, it created quite a few problems with certain colours just not looking great at all, so in the end we just stuck to making the walls white, with a slight greyish tone. We also added a lot of dirt to them, to make them look more worn off. In the end we came to this:
Final Rusty Container Wall.
Wall Texture.
... which I was quite happy with. We encountered a slight problem with seams appearing on certain parts of the texture, but we solved this by creating a patch of dirt and using it as a decal to cover up the seams, which worked like a charm. In the picture above you can also see the ground texture, which was also created by my group member. For the ceiling we decided to use the same material as the walls, as container ceilings usually have the same metal walls on the ceiling, too.

Solving the FPS Issue

Or at least finding a work around... I took quite some time this week on trying to get the level to run smoothly. I tried even creating LODs for the particles on my torches, which on the faster PCs boosted the FPS from 40 to 60 on a scene, however on other PCs the FPS were still just under 10. So in the end after trying nearly everything I decided to get rid of the lights that were being emitted by the particles and instead put a point light into the torch blueprint. I then used the blueprints timeline function to give the light a dynamic intensity and radius to create the torch flickering effect. In the end it didn't look as pretty as it did before, but at least now the FPS were at a more acceptable 24 instead of 9.

Torch Blueprint (Dynamic Light)
Here is also a picture of the final torch:
Torch.
I decided to end the tweaking at this stage though and will now focus on putting in all the assets into the scene. My group members have been hard at work over the past week and all the assets are finally done (I even managed to do a few myself!), however they still need to be unwrapped and textured, which is what we as a group will focus on for the upcoming week. Hopefully, we will be able to get everything done though, since most of the scripting and tweaking within the engine is pretty much done, thanks to my efforts from this week. This should save us some time and once the textures are done we just need to put them into the engine and everything should work just fine. Since there is a bit of confusion as to when our hand-in actually is, we are aiming to complete this project by Friday (instead of Monday), so hopefully in the next post I will be able to show off the rest of the level itself.

Stay tuned~

Tuesday, 20 January 2015

Week 16: Change of Plans

Containers in the ground?

Plans do not always work out as intended and so did we encounter a slight problem with our original idea. Last week I introduced to you the new project that we are currently working on in groups of 4. Our original idea was to create our container city level underground inside a cave, however we quickly found out that this wouldn't be possible. The reason for that is that the brief states that the level has to be made out of containers, so while it technically would be possible to create our level the way we intended to, the style in which we planned on doing it just didn't work. We wanted our walls to be made out of bricks and/or stone, but why would anyone create stone walls inside a container?

So we decided to change our plans and while we are still keeping our level indoors, it is now located above the ground. After all, having containers buried in the ground or inside a cave just doesn't seem like a good idea either. We got rid of the whole crystal cave idea and our temple idea has been a lot more simplified. We will basically just keep to containers for the design of our level, but have some Aztec symbols spray painted onto the walls. The idea behind that is that after the apocalypse happened, a bunch of people brought back the original beliefs of the Aztecs and built themselves a base out of containers. The player will break into the base and has to get into the elevator which will lead him into the treasure room to steal the Aztec treasure. All of our other level elements are still in place (such as the key and the generator).

Getting some work done!

Unfortunately I didn't have much time to concentrate on concepts during this week. Instead I took on the task of creating the modular components that will make up most of the level. For that I started by taking our level floor plan and dividing the walls into panels. To do this I first thought about different sections and the different panels that I would need and sketched them on a paper. I then measured out the level and created another floor plan, showing all the component parts in their right places. I also drafted out my component sketches to make the whole thing a bit neater:
Modular Component Floor Plan
I then went into 3DS Max to create all of the required components. It was important at this stage, that the components had a seamless texture, so that I could put them together in any sort of way, without having seams all over the place. At the same time it was very important that the measurements were all correct, so I changed the units in 3DS Max to feet and fractional inches and changed the grid to show 1 inch at the time. I then used snapping to make sure all of the components would fit together perfectly. I also created a high poly version of the 10ft wall and baked it down into a normal map.

I was messing around quite a bit with the normal map and the low poly model until I had a decent looking wall and then used the same normal map on the rest of the components:
Modular Components with normal map.
Testing out the wall component in UE4.
I tested the wall in UE4 and created an instanced material that allows me to change the colours of the wall and border pattern very quickly and easily. After that I started assembling the level itself using my floor plan as a guide.

Once all the walls were in place we soon decided to do another change to the level. We wanted the area with the security room to be completely dark, so we thought that instead of having electrical lights, we could give the place some flame torches instead. The area with the security room would then have flame torches that had gone out and the player would have to go down to the locked generator room to pick up a flashlight. This meant, that the generator was only powering the elevator and we decided that it would be stupid to have it so far away, so I quickly redesigned the layout a bit to better suit our idea:
Modified floor plan.
Extending the stairs to go down 2 floors instead of 1.
Placing the generator directly under the elevator.

Scripting and Level Assembly

As you can see in the second screenshot, I also decided to get started with the blueprints we need for our level. I first created some simple torches, using particles for the flame and just a simple placeholder mesh, which I will change out later. The turned out pretty well and didn't take me much time to get ready. I then also created a blueprint for a door, complete with sounds and opening animation, as well as a variable which will check whether you have the key or not. I was going to do some work on the HUD to create the blueprint for the key, however I got asked to instead focus on creating assets so I went back into 3DS Max and created some very simple models for the ceiling and floor of the map.

I then completed assembling the level and placed torches all around the map to light it up. We then encountered a small problem with the player mesh getting lit up by the directional light, which we would need to create an outside area right at the start (with the entrance leading into the container complex). I solved this issue by creating a trigger around the indoor part of the level, which upon entering will turn off the directional light, leaving the torches to be the only light within the level. While I also scripted for the light to be turned back on when going back outside, we decided that once the player would enter the containers, we would look them inside by closing the door behind them.

Unfortunately after getting to this stage I was having some troubles with getting my level to run smoothly on the PCs that I was working on, which was most likely just because the PCs themselves were quite slow. (Our level itself is just made out of modular components, each having round about 150-200 tris and sharing a 512 texture sheet for the normal map, so I doubt the level itself is too resource demanding.)

Hopefully though I will get the level to run a bit smoother on a different PC and I will aim to get some screenshots up of the level as it currently is soon. Until then, stay tuned~

Tuesday, 13 January 2015

Week 15: Welcome to 2015!

Catching-Up

First of all I'd like to start by wishing everyone a happy new year at this point. Hope you all made it well into 2015 and are looking forward to another exciting 12 months. The Christmas holidays (which covered week 12,13 and 14) are over and we are back at work with a new project: Container City!

Group Work

Just like our first real project (The Film Room Project), our new project is a group project; and just like with our first group project we were first assigned to find ourselves within groups of 4. Not again... Why can't they just assign us groups?! Guess I'll just have to keep hoping. Luckily this time I quickly got a group together and I am quite happy with my group members as well. Enough of the whole group talk, let's get into more details on the project itself!

Drafting Floor Plans

The Container City Project is an environment project in which we design and create a playable level, which is made out of containers. Whether indoors or outdoors is completely up to us and we have been granted a lot of freedom. When we first sat together as a group we weren't quite sure how to approach this project so we started off by brainstorming a couple of interesting elements that we wanted our level to have. Since the brief stated that we had to have at least 1 interactive element in our level, we quickly came up with the idea of having the player taking an elevator to finish the level. However, the elevator was to be out of power and thus the player would first need to turn on a generator, which would be found inside a locked room. To open said room the player would need a key, which it would get by climbing through a slightly hidden vent into another locked room.

We then drafted a quick floor plan and decided that we should all do a couple of floor plans each. So I sat down and created 3 floor plans myself. I was careful to stick to the original container dimensions so that my floor plans would all be up to scale:
Plan 1

Plan 2

Plan 3
After each of us had created their floor plans we sat together and chose 1 floor plan from each person that we then had to create a basic block out of in 3D. To do this I sat down and created a set of building blocks which used the shipping container measurements that we had been provided with. When we then sat down to review those block outs, I had an idea of merging 2 of my other team members block outs together, with which the rest of my group agreed with:
Final Floor Plan
Having finished the floor plans I then took up the role of creating the final floor plan as a basic block out in 3D, which was easy since I used my team members' block outs as a base to work from.

Themes?

We then had one major problem left and that was deciding on a theme for our level. No playable level is appealing if it's made out of bland blocks, so we decided to brainstorm some ideas. We decided early on that our level was going to be underground, so we thought of possible things you could have underground. Like prisons, vaults, temples, etc. We then assigned a couple of those themes each between us and created moodboards. I had been assigned with "Prison" and "Laboratory" and soon went to research some pictures for my moodboards.
Laboratory Moodboard

Prison Moodboard
We then fed back on each others' moodboards and soon decided to make our theme an "excavation site based inside a temple that was discovered in a series of crystal caves."

Concepting!

The next step was to start coming up with some concepts. To do this we decided to use screenshots from our block out and sketch/photobash over them. We quickly discovered a problem however: How were we going to stick to our theme, but at the same time make the whole level out of containers?

So this is the stage we are currently stuck at and we are having another talk with the tutors tomorrow to see how we can resolve/work around this issue. I will update this blog next week and hopefully be able to show off some concepts so stay tuned~

Sunday, 28 December 2014

Week 12 - 14: So This Is Christmas!

Enjoying The Holidays

Hey, just thought I'd update my blog quickly. The Christmas holidays are on-going and I am thoroughly enjoying getting a bit of a break. I spent a couple of days up north to celebrate Christmas with my brother and his fiancé and it was pretty good. Apart from that not much is happening. I am playing a couple of games and I recently have got myself hooked on the Phoenix Wright: Ace Attorney series. Definitely a great series of games and I can only recommend it. It shows how much of an impact a good story can have on a game!

At the same time I am participating in the SkySaga: Infinite Isles alpha test. I can definitely see how the game has potential to be a great hit and I enjoy providing feedback to the devs to help improve it. At the moment there isn't too much content in the game, but it is constantly being updated, with a massive amount of new content added recently with the start of the second alpha test. I can't wait to see what they will add next. I might eventually post a little review about it here.

Concerning work I am not doing as good. I guess I just need to have a bit of a break, so right now I am not working on anything. I am however slowly easing my way into it again to prepare myself for the upcoming term. I have learned a lot over the past term and I hope that I will be able to use it in the next few projects.

Until then - Merry Christmas and a happy new year!~

Saturday, 13 December 2014

Week 11: Too Late For Regrets (Dichotomous Characters Post-Mortem)

(Not So) Well-Defining Textures

I finished off my last blog post with a screenshot of my model and just for completion's sake, I will post another screenshot of the model with textures. I used the ink 'n paint material in 3ds max to give the whole model a cell-shaded look and while this was already quite hard to get right, it wasn't the biggest problem that I had with my textures:
Textured Angel Character
The main reason I think that my textures have failed is because I simply overestimated the power of normal maps. I relied on adding quite a lot of detail into the mesh by using normal maps, however I couldn't exactly get it to work as well as I had intended. Together with the stress I had from running closer and closer to the deadline I just had to draw a line and ultimately was forced to hand in my work as it was: "Done, but not polished."

The project is over and while I am definitely glad that it is done, I wish I could've gone back in time to start over! There was quite a few things that I could've done better.

What Went Wrong?

So, where exactly did I fail? As much as I hate to admit it, I think I definitely spend way too much time concepting (once again), however this was not fully intended by me. I had quite a lot of struggles coming up with an idea and after 2 failed attempts I finally managed to get at least something, yet I still think that while my concept wasn't too bad, it's nowhere near as strong as it could've been.

The idea was quite cliché and my failed attempt at making it more unique when doing my colour studies didn't help. I really tried hard for the demon character but when it came to the angel character I kind of had lost a bit of motivation and instead of actually doing it, just resorted to going through various colours in my head. It became clear to me that I thought, that my darker value on the dress would not work, as I couldn't think of any colour that an angel's dress could have, however I think I should've definitely just tried it out, just to be certain.

Since I spent a lot of time concepting, my time for creating the model was very limited. The whole model was done in less than a week and it definitely shows. I intended for it to be quite low poly, however I ended up with just under 2000 tris, which while compared to modern game characters seems not too high, it would've been easy for me to achieve a tri count of less than 1000.

I had managed to waste quite a lot of polys and comparing my model to my original concept, shows that I have lost quite a bit of roundness. The model looks a lot more edgy and overall the silhouette doesn't quite match up. If I were to do my model again I would focus a lot more on roundness and putting tris where they are actually needed, but I would also try and add in a bit more detail to make the model look a bit more like the original concept.

Looking Ahead!

Like the title says: "It's too late for regrets now." The project deadline has passed and I need to look into positively into the future. Christmas is coming up and I will be getting my well-deserved rest, but once I am back I will aim to put more effort into creating my models in future project. Hopefully I will be able to produce some great work.

Stay tuned~

Monday, 8 December 2014

Week 10: 'Tis The Season!

Slowly Finishing Up!

Christmas is coming up! - And with that the first term is slowly coming to an end. The third week of the character project has just finished and as it stands I have now got a complete model that needs to be unwrapped and textured. Thankfully we received an extension for the project last week so that now I will have time to finish off and wrap up this project in the upcoming week. Enough of me talking, here is some pictures:
Value Studies
I had wrapped up my last post by saying I would be doing colour and value studies during this week so that is the first thing I started doing during the week. I didn't want to use complete white or complete black for my value, but I really liked how the wings of my angel character looked when they were completely white so I stuck to that. I also noticed that a darker value on the dress gives a lot more contrast to the whole figure.

For the demon character I noticed quickly that I had to have a clear difference in the values for the legs and upper body and also make sure the values for the upper body and head were the same, so I ended up tweaking around the value of the tail and soon found my favourite. However I still wasn't quite sure which values to go for on my angel character so I picked 2 and paired them up together with the demon to make my final decision:
Value Pairs
After I had picked my values I then went onto doing some colour studies:
Colour Studies
I wasn't particularly keen on my results. I tried to stay away from the cliché red demon, I really did, however I just didn't think any of the other ones really worked. So in the end I decided to stay with the cliché and made a matching white angel. Like I said, I am not particularly keen on what I have got out of this, but I did try hard, so here's my final:
Final Dichotomy Characters
I then had a quick think and decided I would model the angel, so I quickly drew up some orthographics to help me model:
Angel Orthographics
After that I went straight into modelling, which wasn't too hard, however I encountered a few problems:

The first problem I encountered was the bottom of the dress. I'd end up having to model overlayed fabric, which wasn't quite easy to get my head around at first. Eventually I decided that I will use mostly normal maps to solve that problem.

My second problem was how much detail I wanted to have in my model. I wanted for it to be rather low poly and when it came to modelling the wings I simplified them a bit to not push my limit to far. 

My final problem was the hair. I wasn't quite sure how I would model it and eventually decided to just make a basic head model and then stick the hair on top which I would create by edge modelling. The final result, coming in at just under 2000 tris, wasn't too bad so I stuck with it:
Angel Model
As you can see, I simplified the dress quite a bit. The head is also quite flat, but that is because I intended for the facial features to be simply painted on, as it has been done in Wind Waker as well.

Last Week of Term

So here we are, it's the final week of term before Christmas holidays! I'm never really overly excited about Christmas, but it's definitely a nice time and for my a definite well-deserved rest. I was originally planning on staying in Leicester over Christmas, however eventually I decided that I'd go up for a few days to visit my brother instead. I will be sure to keep this blog updated over Christmas though~