Studio 3: The Return of Studio, Again

This post marks the finale of my studio classes that I have been taking for the past year, and I’m happy to say that it has definitely gone better than previous studios. There are still aspects I could improve on, but overall I am happy with how I went. Below I am going to talk about what I did and I will end with a post mortem.

 

Multithreading

As seen in a previous blog, one of the tasks I completed was optimizing a ray tracer using multi threading. If I remember correctly, I cut it down to a third of the time using three threads, which makes sense and got the rendering of the image down to a reasonable time.

Cel Shader

I got to make a cel shader, which was my first experience working with shaders, and I enjoyed working on it. I am definitely going to look further into shaders, make more, and I am considering looking further into graphics programming as a future career option.

Chat Client

I also go to make a chat client, which was capable of drawing images, that worked between two computers on the same network, which is pretty cool.

Client Project

The big thing in studio 3 was getting to work for an actual client for the first time, which was definitely I learning experience, and getting to work for someone outside of uni was awesome.

 

I haven’t elaborated too much on these here, as there is a blog for each of them, except the chat client which is pretty self explanitory. There were also some minor things, like researching information relevant to the video game industry, like data security and privacy policies.

 

The Good

This is the first studio I have had where the final week hasn’t been a mad dash to the finish to get things done on time. Currently, it’s a leisurely stroll, which feels great. Just about everything is done, with ample time to finish off the very little I still have left to do. I am happy with the work I did, but as always I still feel like I could have done better.

 

The Bad

As mentioned, I feel like I could have done better. I did what was needed of me, but I didn’t allow myself enough time in my schedule to research things that interest me or to perfect the things I did do. That’s definitely something that I will fix in the future, now that I am aware of a programming field that I like other than the more generic game-play programming.

 

Overall

As I said, I am happy with how I went. Considering that the worst thing about the trimester is that I didn’t make everything perfect, or do enough extra research at my own discretion, I would say I did pretty well but I still have plenty of room to grow as a programmer.

 

 

Advertisements

Working For a Client

Over the past 6 or so weeks, I was lucky enough to be chosen to work on a project for an outside client, the client being the Queensland police. The stipulation for the project was that the other programmers on the project and myself had no contact with the designers, and only one of us was allowed to talk to the designers. And that is where things kind of fell apart. As of writing this, it has been 6 days since we gave the project to the clients and, despite all the pestering from the programmers, we still have absolutely no idea how the hand over went.

The Good

The best part of the project was obviously that I got to work for an actual client whom at times, genuinely seemed to like the game so hopefully it ends up on the mobile platforms that it was created for. I also learnt about how important it is to question things early. The amount of times I made something that fit the feature spec perfectly just to be told it wasn’t what was needed was ridiculous. I am considering this a good thing, because it was something I hadn’t really considered, as I always have direct contact with my designers and am usually involved in the design process, and learning something new is always good. In the future the first thing I am going to do is to make sure that the feature spec is thorough, any questions I  have about any of it are answered and there is 0 room for error, before I type a single line of code.

 

The Bad

Communication between designers and programmers was terrible. I’m generally not the type of person to point fingers. Sometimes bad things just happen and things go wrong, its always bound to happen in this industry, which is the reason one of the documents we have been forced to make is the risk analysis document. That being said, from my perspective, the 6 weeks can be broken down like this:

1. Designers would give programmers a list of things to do during our Tuesday class.

2. Programmers would do said things in a day, maybe two.

3. Designers would test game in Thursdays class, and after a few hours (up to 3) of the class, would give us more stuff to do.

4. Programmers would do said stuff by the end of Friday.

5. Designers would test the game in class on Tuesday, and the list would repeat until the project was done.

I totally get that we are all working on another large project in a different class, but with this process we lost three full days of work every week, which was totally avoidable if testing was done sooner. In the future, I will pester more when I finish a task. Instead of sending off a single notice saying something along the lines of “It’s done, please test” I will continue to send notices until I know that its been tested and I have something else to work on.

As I said, I don’t want to point fingers. At the end of a day, we are a team so we either do well together or we fall short together. I’m sure that it some instances both the programmers and myself were to blame for something that slowed things down.

 

Overall

In the end, I am happy to have been on this project. Not just because it will look good on a resume, but I learnt things about designer/programmer communication that I hadn’t previously had the chance to learn, and I value to experience. I wish I knew if the clients liked the finished product, and I genuinely hope they liked it, but in regards to the more negative parts of the process, failure is an important part of learning and people often learn more from it than having succeeded without issue.

 

Designing A Shader 2: The Re-Shadening

As can be expected with any plan relating to video game development, I went a little off track of the plan for the betterment of the project.

I only used a single pass, instead of doing the multi-pass rendering I intended to do and I didn’t ignore ambient lighting which allowed it to react to in game light sources.

Naturally, after the research I had previously done, I started by creating a Unity project. To kind of showcase my shader, I would have 3 of 3 different objects (square, sphere and capsule) one of each being the standard asset, one being Unity’s toon shader, and one being my shader. Playing around with the Unity shader, I noticed that the outline would get larger as the camera was further away, which from far enough away, would turn the object into a black dot. I’m not entirely sure what caused this to happen, but I am mostly sure that it had something to do with the method of drawing in certain back facing triangles to create an outline.

To create the shader, I first had to learn the basics of making a shader, which I did by watching this Unity tutorial on youtube and after that, looked around the web a bit for something more specific to what I was after that I could follow along to.

After a few hours, I eventually created a shader I am quite happy with and that I enjoy making shaders. Unlike the Unity shader, the outline of my objects would not expand on distance (and in the case of the cube, it wouldn’t separate from the object), it would react ambient lighting and the values regarding the outline and the shininess of the object could be changed in the inspector by selecting the material.

CelShaderComparison
The pattern goes Standard Asset, my shader followed by the Unity shader

One thing I noticed on the Unity Shader is that it used something called a CubeMap. I’m not sure what it is, so in the future I will definitely look into it, and continue research into shaders, so I can not only improve upon this one, but continue to make varying kinds of shaders.

 

Designing A Cel Shader

Anyone who knows me, knows that I like reading comics. So when given the task of having to make a shader, I pretty quickly decided to make a cel shader or “toon shader” as its sometimes called.

The Borderlands series and any recent Telltale game are the biggest games that use such a shader, and do an amazing job in doing so, partially due to the shader, and partially because the assets they have a created with cel shading in mind (from what I’ve read), and they really nail the comic book look that I like.

unnamed

unfortunately, I don’t think its realistic for me to try to achieve the look that Telltales ‘The Wolf Among Us’ has, but I will attempt to do a much more basic shader that ideally I can build on in the future.

Looking into cel shading, they always have two very distinct features. Firstly, rather than a continuous change of colour, they have a sudden changes in colour which wont change until the next jump. Secondly, the objects in the game are outlined.

The particular shader I will be making will ignore ambient and specular lighting, at least for now and will be using multipass-rendering, two passes each with its own vertex shader and its own pixel shader. And although there are algorithms for edge detection, such as the Sobel operator, I will be making a system that ignores front facing triangles and drawing the back facing triangles, and then drawing the front facing triangles.

I’m currently unsure how this will work out, but apparently it is actually easier than using an algorithm, but if it fails I will switch to using an algorithm.

Copyright and Licensing for NotYet

Looking into the copyright and licensing regarding the software that my team (NotYet) and I are using for our final project at uni, a game called Refuge, there are very little problems that we could potentially have. The big three programs we use are Unity Engine to make the game, Source Tree for version control and Visual Studio for the coding.

We are working under the personal edition license of Unity. According to the website, this license is free to students (which we are), we completely own everything we make and will remain free until we as a company earn $100k USD in gross annual revenue, or raise in excess of $100k USD. Considering this is a small indie project made by very few people, the likely hood of us earning enough to have to buy a different license is low (although it would be awesome) and if we did earn that much, the cost would be negligible.

Source Tree is forever free.

Visual studio is free for enterprises with less than $1 million USD in annual income, so again, if we were to reach that amount, any cost would be negligible.

I can’t speak for the audio or animator students, and the programs they use, but I believe its safe to say that they will have similar licensing to any of the above

Therefore, this project can be made with our current licencing with very minimal risk to cost and copyright issues, as long as we don’t do anything ridiculous like use copyrighted assets

Data and Storage Security Risks

The next task I have to complete is an analyses of  security risks involved with the data storage of one of my project, and talk about any related leaks.

Most of the information about the project is on Google Drive, a free to use cloud storage system, with the actual game on GitHub.

According to Netskope, a cloud storage security company, 15% of business users have had their cloud storage hacked. This is largely because of the failure in either the related business having a security policy, or of an employees inability to follow a security policy that was set in place. Many users reuse login information from other, more vulnerable services, such as email.

A scam was created a few weeks ago, where some scammers used an exploit in google drive, to send targets an email that would link to a google drive folder, but when the link was clicked it would take them to a fake login page for google drive, that looked almost identical to the legitimate login page and people would just hand over their login information without even thinking about it.

After looking into this particular security information, I have realised the importance of having a security policy, a document outline the procedures employees must take to make sure they don’t unintentionally create a weak link in the chain that ends up getting exploited.

 

 

 

PS4 Hardware Limitations

I feel like I need to begin this post by stating that I have no biased towards any console. I actually have all of the current gen consoles and a gaming PC, the PS4 just interested me the most, as it has the same limitations as basically every console ever.

The biggest hardware limitation with any gaming console is that, the parts can’t be upgraded. In the age of technology, when advancements in technology are happening at a faster and faster rate, console are becoming outdated even faster. Mixed in with the fact that console will never be released with the current best hardware available, due to the very reasonable need to be affordable to the masses, it will take less time for developers to reach the maximum potential that the console can harness.

For example, the Playstation 4 came out November 2013 and the PS4 pro has been announced for November 2016. The PS4 pro has both a better GPU and CPU. Granted that its basically the same console, after three years of being on the market, technology reached the point where a console could justify an upgrade in technology, at the cost of having to buy a whole new console.

This leads into another issue. The lack of upgrade-ability means that if one part breaks, the whole thing becomes a brick.

Another issue is that as new generations of console get released, games from older generations become unplayable on the new consoles.

Multi-threading

Recently, during studio 3, my classmates and I were given another programming challenge. To use threading to decrease the time it takes for the below image to render.

Rendering.png

 

Initially, on the computers that we were testing it on, it would take about 45 seconds to render the entire image. As you can see in the top left of the image, I got it down to 14.8 seconds.

To achieve this I iterated over every pixel, using modules 4 to put each one into one of four lists, this would guarantee that the lists of pixels would be roughly the same size. Then in four separate threads, ran a function that render the given list.

Obviously using more threads would make this even faster, if the computer running could run more threads.

Spatial Partition-ing

Recently, I was given the framework for a unity project that creates a white circle on a black background. It ran and printed out how long it took to print out a set amount of said circles. The goal was to use some form of spatial partitioning to improved the efficiency of the program.

 

Ultimately I decided to use the grid method, as it was a fairly simple problem and I didn’t want to over complicate the problem and use a quad-tree, although I am well aware that it would have made the program even more efficient than my end result.

 

I started by creating the grid itself, iterating over the grid to give the cells correct width and height and than adding each circle to its own spot within the grid. After doing this I lowered the run time from 10.4 to 6.0, so its not far from being 50% more efficient. As mention above, I am sure that if I used a quad tree it would have been even faster but since the goal was to reduce run-time and not to make run-time as fast as possible and how the grid method is generally easier to implement than quad tree, I decided grid would suit this particular task.