donderdag 18 mei 2017

HKU - Building Playful Worlds - Tower of the Arch Mage - Part 1.

This is another update for my Tower of the Arch Mage project. A game I make for the "Playful Worlds Unity lessons" at the HKU.
The first thing I wanted to make sure is that I have a pixel perfect camera. I used an imported camera script from the store. But I had to sprite textures and make them work in a pixel-perfect enviroment.

 

I really like making sprites. Unity wasn't originally made to exactly replicate pixels in a 2d enviroment, but by finding the right tricks you can get quite far.

I also wrote a small script to have a procedurally generated terain from two different textures. (with some help from Arjan Cordia)
The map generator I use for this project is an edited version of the map creation engine from "Object Oriƫnted Abyss 2". Here's an example of the instantiation code.

Bus Game Part 1



Last weekend I made a prototype of a very simple, but very exciting game. It was made as a prototype of a game concept to use in my school project : "Project Frei".

The idea is fairly simple. You control two busses, and these busses travel a road that progressively gets crazier.
At the moment the game doesn't have any objectives, but it is a heck of a lot of fun to play.


So, one of the things I did at first was to have a simple cube move forward. I did that with a constant translate of the z position.
Eventually I added controls (even for DS4/X360 or other Xinput compatible controllers).
The controls had to be simple and accessible.
The fun thing about the game is that it can be used both singleplayer and multiplayer. As a singleplayer game it's harder because you control two busses at the same time.
















^ Open to see the current controls.

Anyway. More about the code.
Eventually I managed to add a camera to move along as well. As well as a "Collider Cage" to prevent busses from getting out of bounds. This "Playzone" sums up the z position of both the busses and divides it by 2 to have the average of both busses. it then translates itself towards that position.

I also made Jump Pads and Boost Pads. These work with a Box Collider, Once the bus hits something tagged "Jump" the bus will increase its rigidbody's y velocity by a certain amount. The same is try for "Boost" tags and the z velocity.
The bounds also translate the player back to it's original position.



As you can see in the above code I also added some camera shake. That increases the action value of the game.



I think this is an incredible fun project to work on, and I'll post more updates about it when I have more to show.

OC: Shaders and Volumetric Light.

I took a look at the tutorial by : "Brackeys".
https://www.youtube.com/watch?v=H5v_X1k02U0

This tutorial explains a lot about Volumetric Lights and how to apply them.

Volumetric lights are a technique used in games (and 3d animation) to create light beams cast from the light source to add more detail and highlighting to your enviroment. I think the default lighting and shaders from Unity are pretty decent. But I wanted to try to use some advanced graphic techniques.

The elements in the obstacle course now look way stronger.




All of the above examples are with using volumetric lighting on directional lights. They are even more useful on spotlight to really highlight something in a scene.


Spotlight example


So yeah. Just toying around with shaders and volumetric lighting. It's a really useful tool to highlight things and to bring a great atmosphere.
More about Volumetric light.
https://en.wikipedia.org/wiki/Volumetric_lighting


woensdag 3 mei 2017

HKU - Building Playful Worlds - Tower of the Arch Mage - Part 0.

Here is a link to the Design Document of the Final Assessment of the Building Playful Worlds Class at the HKU.
https://docs.google.com/document/d/1q9h2_xKPvTrJ8k_gkq6D7gwt9a9rOn4FbngNM8dU-FY/edit?usp=sharing