Studio 3 Post-mortem

This trimester has been fun. It’s been something different from what we have had before. We started off doing some networking. Using Winsock to connect to a server thru broadcasting. Then drawing pixels on a 512x512px canvas by sending packets with information in them. Then we worked on a raytracer which you can read about here. After that came SQL databases. We played around with SQLite and amazon servers. Week 5 was shaders. We learned how to use audio to change the shape of an object with shaders. This was for the Studio 2 designers we collaborated with for their music game. You can read more about that here. When the shaders were done we had to collaborate with our Studio 3 designers to make their New Intelligence app. This was not fun. The app was not a conventional game but more like a training game. All 5 programmers were working on different parts of the “game” to finish it. My tasks were to make the app read XML data from an XML file, make a player profile with bars to show progress, make analytics that saves a bunch of information after each exercise, and I was build master. No one else could build the game for some reason. So everytime someone needed a new build it was up to me to build it and upload. For this Adrian showed me how to use Unity Cloud Build.


And here’s some of our analytics. (Hope no one gets mad about this.)anal.PNG

When the New Intelligence app was finally done (it actually never got done, we just got tired of it and quit) we could continue on our network game that we programmers had been dreaming about for 5 weeks. For this game, we all wanted to use Unity to actually make the game. But the server was being made in C++ by Greg. We managed to get Winsock working in Unity and connect to the server with broadcasting. The server was sending the map, starting info and bullet info, it was receiving move and shoot commands. The map was compressed with RLE and we had to unpack it.

While all of this was going on I was still working on some side projects like my team’s final project Space Crawl. I was also working on a Discord bot that would relocate messaged into special text channels. It can remove messages that contain banned words like 9gag and facebook. It can also send random pictures that it reads from a folder. I managed to get it to connect to a voice channel and play an audio clip. But it was really buggy and only worked 1 out of 5 times. When a user entered a new game it would create a voice channel and role for that game.


Studio 3 was really fun and interesting. I learned a whole lot of new things like networking, shaders, analytics, and some new serialization things. I almost never worked alone on a project except for my own side projects. This made me improve my teamwork and communications ability. I learned that it’s much better to have one person as a communicator with a group. Like an audio lead or animator lead. One person that takes care of a department so it becomes more like a pyramid hierarchy. I work best with a free schedule, just having a deadline. That way I can work when I feel like working instead of being forced to work when I might feel like not working. That way I’m more productive with the same amount of hours worked. I have also learned what information is safe and not safe to store with analytics.

I must say that my favorite part about this trimester was the work I did in VR for Space Crawl and networking. I found networking very interesting and challenging to think about what has to be sent and how often. Trying to shrink every packet by mere bytes, just to make every update smaller. Which with time will save a lot of bandwidth.

Studio 3 Post-mortem

Studio 3 Data leaks and security

For as long as personal data has been stored it has also been at risk to being stolen or leaked. The only secure option is to have everything offline in a bunker somewhere. But unfortunately, we need to access that data sometimes so we can’t store it in an offline database. This puts all of that data at risk because it is the security that has to keep up with the hackers.

For this, I looked up a bunch of different leaks. The most recent leak that is relevant to me is the Unity Forums Hack. The hacker group OurMine managed to attack the unity forums on April 30. According to the Unity team, they successfully compromised the forums due to poorly implemented password routines. OurMine is saying they got access a database with 2 million users details. They even messaged everyone to change their password. But according to Unity, no passwords were compromised.

Because of the attack, the Unity team has decided to roll out some new security features. The new features are 2-factor authentication, device identification, and password policy. Now this will only help with security for the users. What about the forums server and database? The answer Unity gave was “There’s no such thing as perfect or complete security, especially for high-risk targets like public forums. In this case, we’ve identified the entry point for the unauthorized access and have since closed it. The forums have been restored from backups to the state prior to the incident to remove any data the unauthorized access may have caused to be left behind.”. This is a perfect example of where security has to catch up with the hackers. The hackers found a backdoor they could enter through and with it, they managed to get access to public emails and send a message to every user. But as soon as the Unity team found the backdoor, they closed it and that’s one less port to worry about.

One thing that the Unity team said was that no password data was leaked because the passwords are not stored in the forum database. An educational guess from me would be that they also don’t store the password string but only a hash of the password. Not storing passwords as string really helps with security leaks as long as the hackers did not get access to the algorithm that creates the hashes.

The problem with some of these leaks is that many people use the same password on everything. Thus if one site does not hash their passwords and it gets leaked, then anyone can get access to their other accounts with more sensitive things like email.

Some things people can do to protect them self from things like this is to not use the same password on everything. But let’s be honest, people are lazy and can’t remember 200 different passwords. A somewhat reliable way of checking if a site hashes their passwords is to create an account with a new password and then ask for a password recovery. If they send you an email with your password it means that they are storing your password as a string. This is unsafe, so I recommend not using the site or making up a completely new and hard password for that site and that site only. Now if they send you an email with a link to create a new password it most likely means they do not store your password and thus you have to create a new one. But this is not 100% reliable.

So to be even safer you could use a master key password. Like an app on your phone or any other device where you only need one password to enter a database of your own with all your passwords for sites. This way you don’t have to remember any passwords other than the app password. So the passwords can be different for everything and can be really long and unrememberable. But this puts your account for that subscription at risk. If you forget your password for that app you lose all your passwords. Or if you lose your phone it’s all lost (if you keep all of it on your phone only).

My personal favorite is 2-factor authentication. But this only works for sites/applications that use this security feature. Sms or phone call authentication is also fine. But this also is not perfect. If you lose your phone all of this is lost. The best option, in my opinion, is to use a really difficult password for your master email (the email you register with). This way you can always reset any password you need, using your email.


Studio 3 Data leaks and security

Studio 3 Shaders and music game

This trimester we had to work with some studio 2 people to make a music video game. Where the music controlled the aesthetics and flow of the game. The game I got assigned to was Falling. My task was to create a water distortion rain effect on the camera, and a shader that rendered a sprite from the top down slowly.

Let’s start with the water distortion effect. I know that unity already has a glass distortion effect so why not use that? I did. But how do I use it with a particle effect?

I had to search some forums and found a thread on the unreal forums that described how they used normal maps with glass shaders and they got the desired effect I wanted. So I googled after some raindrop normal maps and found this.


I put it into MSPaint and cut out some individual raindrops. Then put them onto a material with the glass shader effect.watereffect

Just dragging this material into a particle effect that shoots out of the camera made it look like water dripping off the screen.

Ok, so that was the raindrop effect. Now let’s talk about the lighting effect. My task was to make a sprite render from the top to the bottom in different speeds.

I started by making a new shader and only render the top half to see how it would look. The problem I ran into was that the shader was trying to take light from the scene. I didn’t want that so I made a unlit shader with transparency since I wanted transparent pictures to render correctly.

Here’s what it looks like. The speed of how fast it renders can be changed, this is just to demonstrate what it does.


Studio 3 Shaders and music game

Limitations of current VR systems

For my final project, I am working on a VR space shooter game called Space Crawl. We are developing the game on HTC Vive, but we also want to support Oculus Rift. So this is fairly easy with SteamVR as it supports both. But the problem we have now is the difference between the controllers. The difference is the touchpad the Vive has and the joystick the Rift has. We can’t use swipes and such for the game if we want to have the same experience on the Rift. So we have to consider this during development and in our most recent addition to the game, the grappling hook, we wanted to use swipes to change the speed of the hook. But this idea had to be dismissed early on because of the Rift controller.

We also have to consider that the future of VR controller might be drastically different from what we have now.

This is a picture of one of Valve’s prototype controllers. 

They look similar to the Vive wands we have now but with and additional button and less clunky. Who knows what the next gen Oculus controllers will look like. They might now even change at all. But we won’t know until anything is released.

This means that releasing a VR game now it will have to be updated with each new iteration of controllers that get released. Some games even use the controller model as a visualizer for hands. If you don’t support these new controllers you as a developer might be missing out on money from potentially new consumers that don’t have access to the old controllers.

Controllers might even die out soon and get replaced by hand gloves that track each finger. Then we are going to have to change the whole input system. The question then is “Is this worth the time?”.

Limitations of current VR systems

Studio 3 Raytracer multithreading (UPDATED)

I added 2 lines and changed a setting in my project to allow OpenMP support.openmpyesopenhpramgaforomp

My task was to reduce the time it took to render some things for a raytracer. It first took about 60 seconds to render with only one CPU core.

By simply adding multithreading to the render loop I managed to get the time down to about 11 seconds with absolutely 0% loss in quality.

There are further ways of improving the speed but I don’t know GPGPU that well and I did not want to reduce the quality.

I also played around with some different ways of rendering. None of them came out as fast as just rendering line after line.


Studio 3 Raytracer multithreading (UPDATED)

Studio 2 Postmortem

This studio was really fun and enjoyable for me. Just as a person, I discovered how fun and interesting it is to create a game that you actually want to work on. This such as bot fights and VR was the most fun I’ve ever had with programming. The tech, restrictions, and possibilities of VR are what keeps it interesting to work with. For most of studio 2 we were working alone or as “contractors” making tools for the designers.

For most of studio 2 we were working alone or as “contractors” making tools for the designers. So I also learned that working alone was not that bad. But I find working in a small team is a bit more enjoyable. Having a clear goal of what I’m doing helps with the programming to get it done. Just making a camera tool that 4 designers are gonna use in different ways is hard. As there is much more I have to implement and it all has to work together. But as a team, I get a goal to work towards and it usually is a very specific this that is easy to optimize and work on.

During the duration of studio 2, we also had a lot more freedom to work on whatever we wanted. So I took the liberty to work more on VR and found that to be nice. For now, I want to work on director AI and/or VR. Mostly leaning towards VR. With more and more VR tech coming out there are new doors opening everywhere. New problems are being introduced with more fixes being needed.

I feel that I’ve have improved as a team member and problem solver. My motivation for making VR games have skyrocketed. But my time management has fallen. During some of my programming sessions, I just forget the time and continue to program until the sun rises and then it’s too late(early) for me to go to sleep. But every project was delivered on time. So that is something positive. Project time management have been improving but life time management has completely gotten destroyed. As always my verbal communications skills have increased just by speaking more and more English every day. Research has really helped me with the last project as I used 2 open source assets that saved me weeks of work.

So overall this trimester has been a very very productive one. I have learned a lot of new stuff about programming but also about myself.

Studio 2 Postmortem

Postmortem Studio 2 Énouement

This was the last project in Studio 2 and the requirement was: Home.

So the designer and I decided to make an HTC Vive game. This was really fun. VR is a big hobby for me and I love to play around with it and see what can be done. Since its still a pretty new thing there was not much out there to help us. But luckily we found a VR toolkit to help us out. Most of what we did was using this toolkit. All of the interactions were using scripts from this toolkit. I only had to do slight modifications to some of the scripts to make them work as the designer wanted them. Then I mostly worked on things I found interesting in VR. This has been the most interesting and fun project I’ve ever worked on.

In the beginning, this game had an identity crisis. We didn’t know what to do with the initial idea. It was not interesting and had little to do with VR interactions. So the idea was changed a lot from an old man going through the ages back to when he was a kid, to an old man moving into a retiring home after his wife died. So the game was about packing and interacting with old memory items. Such as photos and trophies. But that was mostly it. We added a toy gun to the game to make it more fun and have something usable to interact with.


Because we didn’t know what to do with the game, in the beginning, we got a late start. This was not much of a problem since the VR toolkit we used helped us save a lot of time. We also got suggestions from people that we should use The Lab Renderer. So that too saved us a lot of time writing shaders. We had also worked slightly on VR before that so we were not walking into this completely blind.

What went really well this time was that the game was not scoped to big at all. We actually finished all the features we wanted to have in the game by the exhibition. That’s a first for me. The first project that was done to 100% completion. Now, of course, we want to add more and try out more stuff. And we will probably work further on this and maybe one day release a game for the Vive and/or Rift.

So to conclude this has been my favorite project to work on so far because of interest and results. We lost some time due to design changes but we did keep up thanks to open source tools. In the future, I will definitely be looking out for more tools and maybe even create my own to use in future projects.

Postmortem Studio 2 Énouement