vrijdag 23 juni 2017

Hinge Joints, Music and so much more that I never ever mentioned.

Over the past few weeks I've been so darn busy, it's not even normal.

I've been creating some amazing windmills with hinge joints for my obstacle games.

I've written my own soundtrack for my "Project Vrij" bus game.

https://soundcloud.com/cheezegami/detour-ost-full-speed-ahead-final

I've made SFX for both games.


I've made a trailer for my Playful Worlds Game.

https://youtu.be/OzvJPe6ls38

I also finished up my other team project in C++.
Quite a hectic time indeed. But it's almost Summer Holidays, so lots of ice cream and more projects. :)

zondag 11 juni 2017

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

Procedural Generation is quite a challenge. But I managed to get at least the room generator working over the past few weeks, it has a dynamic size adjustment and the room numbers are variable.





I am now trying to get corridor generation to work, it is... quite tricky to say the least.



I am trying to generate the corridors by getting a random position from within each room. I take the x value of one room and the y value of another to define a point. Using that point I want to draw a floor between the three points. Quite tricky indeed.



After a long hassle I finally managed to combine two pieces as seen above.



Here I have multiple rooms connected to a single room.



Now I have every room connected to a random other one. The worst that could happen is that room end up in two islands, so, I had to revise my method, a more organised, maybe less random one at that. I simply connect each number of the room toward their next one. Since rooms are already random that shouldn't make it far less random.



After some overlapping preventions in place it now looks quite tidy.

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

donderdag 27 april 2017

Weather System, Instantiation and Skyboxes

So, an elemental obstacle course has to really stand out.




To do this I had to modify the teleportation system I used to a big extend. I had to add to following functionality :

  • De-instance the levels that are not being played.
    • And to compensate the telporter has to instantiate the level loaded. This is also very important for performance.
    • And thus create a small script that de-instances all the levels beside the lobby on game start.
  • Change skybox depending on the level loaded.

But the code  of the teleporter is still very clean and compact. The fact that a lot of code is pre-written in Unity helps a lot.

I also made a weather system using particles that:
  • Trails the player as the player progresses in the level. Floating above the player, making a rain system that covers the entire level is too taxing for performance.
  • Displays the correct particles and properties depending on the loaded level.


zondag 23 april 2017

Spawnpoints and Colliders.

For the past day I have been working on a spawnpoint system. I was inspired by games like Roblox, where you would respawn on a checkpoint you touched, I wanted to recreate this within Unity.

Here is a very early example of what would be called an obstacle course. Every blue Platform counts as a checkpoint and makes the player respawn there if they lose. (Touching Killzones)


As you can see here, the code isn't quite complicated. It simply puts the player towards the spawnpoint position if the player touches a killzone and it moves the spawnzone if the player toches a safezone.

In practice this is a very early example of toying around with losing and respawning.


Update 1: I managed to add teleporters as well, I further adjusted the frequency and appearance of the spawners whilest keeping the style simple.



As you can see I've added a lobby to spawn in, whilest also having the white squares counting as a spawn point. The blue square in the lobby teleports you to the first course, which you can see in the background.
The code I used on the teleporters, is again, very simple, and uses the tag system that Unity uses. while having a gameobject from within the scene attached to it.



Update 2:
I added another level where I made blocks that fade away when you walk on them and reappear after a given time.


This was quite a challenge to set up at itself, but I used a switch-state machine to have it work flawlessly and sequential.




This way none of the states mess with each other and it automatically loops itself back to the default position (0) if you're not standing on it.

woensdag 15 maart 2017

HKU - Playful Worlds - Part 2

The past few weeks I've been busy with projectiles, mini-maps and particles.
I also did a lot of debugging and polishing.


I also worked on projectile rotation and movement, I used the Sinus and Cosinus functions to make an object rotate in a circle or an infinity sign.

dinsdag 14 februari 2017

HKU - Playful Worlds - Part 1

This week I made a lot of progress with my procedural dungeon generator. It utilises a script that places UTF-8 Characters in a certain algorithm. The next thing it does it that it uses a script that places prefab models into the scene. The player is able to move inside these objects.


XXXXXXXXXXXXXXXXXXXXXXXX
X┌─┐┌┐┌┐┌──┐┌┐┌─┐┌──┐┌┐X
X└─┴┘│├┼┼┐┌┤└┴┼─┴┤┌┬┴┴┘X
X┌───┴┴┘││├┤╔╤˄╤╗├┘└┐┌┐X
X│▼╔╤╤╤╗├┘││╟@@@╢├─┐├┘│X
X└┤╟@@@╢├┬┼┴˂@@@˃┤┌┴┤┌┤X
X┌┴˂@@@˃┴┘├┐╟@@@╢││┌┴┤│X
X│O╟@@@╢┌┐├┤╚╧˅╧╝└┼┤┌┤│X
X└┐╚╧˅╧╝├┘└┼┐┌┤┌┐┌┤│└┼┤X
X┌┤┌─┴┐┌┤┌┐├┼┼┼┤└┼┤│┌┼┘X
X│├┼┬┐├┤└┘└┤│├┘│┌┼┤├┘└┐X
X├┘├┘├┘├┬┐┌┼┴┴┬┴┴┴┤│┌┬┤X
X└─┴─┘O└┼┴┤│╔╤˄╤╗┌┴┘│││X
X┌┐╔╤╤╤╗│┌┤│╟@@@╢└┐┌┘├┤X
X└┤╟@@@╢│├┴┘╟@@@˃┬┼┘┌┼┤X
X┌┼˂@@@˃┼┼─┐╟@@@╢│└┬┤└┤X
X└┘╟@@@╢└┤┌┤╚╧˅╧╝└─┘│┌┘X
X┌┐╚╧˅╧╝┌┘├┴┬┐└─┬─┬┬┼┘▼X
X└┤┌┬┤┌┬┤┌┼┬┼┤O╔˄╗│└┘┌┘X
X┌┘│├┴┴┼┤│└┼┤└┐╟@˃┼┬─┴┐X
X│┌┴┴┐┌┤└┼─┼┤┌┤╚˅╝││┌┬┘X
X└┤┌┬┼┘└┬┤┌┼┘├┴┬┼┐│└┤│▼X
XO└┘└┘►─┘└┴┘►┘►┴┴┴┘O└┴┘X
XXXXXXXXXXXXXXXXXXXXXXXX

Above here is a pattern for the maze that is being generated.

















Above here is an early stage picture of how the room layout was being generated, note the big hole on the left to make space for an at that point invisible room.












Here I was trying to import some models I got from the tutorial I followed.

















I also ran into bugs... very often.



















But eventually I managed to get a pretty decent algorithm going.

















A big shoutout to Richard Hawkes (https://www.youtube.com/channel/UCiYIoN_wIwA0etN2DHbI6Zw) for the tutorials I follow and the models I used to make this happen.