Have been working hard on Hex World these past few weeks and have finally gotten the world manager system created that can handle the dynamic nature of the world, a variety of tiles that have unique behaviour, and some simple tools that has helped me create a simple level to test everything out in.
The video below shows how the world manager can maintain different tile stack compositions and handle the recreation of tiles, the grouping of tiles to move as one, and a bunch of different world tiles with different behaviour. There are grass tiles that sink in when stood on and be destroyed, pressure switch tiles that can be activated, mine tiles that can blow up when stood on or wired up to a pressure switch tile, and jump pad tiles that can launch the player up as well as some others.
I’ve came up with an idea for a game after playing Legend of Zelda A Link Between Worlds and messing around with the sand rod. The sand rod is an item that can force sand to rise and form into platforms to walk on. What I want to do is create an entire world based on this concept.
What I have been experimenting with is a form of world consisting of hexagon shaped tiles that can shift up and down to form new terrain or create visual effects, such as craters or waves.
Here are some early concept videos of the kind of effects I could make.
Made a revolver cannon for a bit of fun in 3DS Max. Though it would be a bit of fun to upload it here.
I was having some fun with 3DS Max and created an air ship. I’ve been spending the past weeks getting it flying in the Unreal engine, and getting some basic AI to see if I can get it to navigate in 3D space.
I used to play a lot of Garry’s mod when I was younger. Whenever you wanted to make something fly you would give it hover balls to lift it at certain points. This whole thing reminded me a lot of the buoyancy spheres I used when creating my ocean, except in reverse. So I created a hover ball game objects that would split the weight of the object among them and then apply equal force to get them the object to float perfectly on the spot. This was way more successful than I original thought it would be and I was even able to split the distribution of force among them to create a sort of procedural animation. I also stuck some fans onto the airship that would speed up or slow down depending on the amount of force being applied to its respective hover ball.
I also had to sort out some AI for the cannons on the side of the airship. This was harder than I thought it would be, but proved an interesting math puzzle. In the end I got it to aim perfectly at the target regardless of the turrets orientation.
Lastly I got some AI onto the airship to get it to follow patrol points, attack the player, or flee. The end result was really cool, as the airship would instinctively perform a 3 point turn to turn around. This was because instead of having the AI move the ship, it moves a virtual joystick that moves the ship. Creating a more natural and less clunky movement system. The video below shows me setting up a patrol route and letting the airship navigate it.
It has been fun programming this ocean, and I want to optimise its use. What I want to use is a method projecting a flat plane from the camera and its frustum onto the ocean, and then use this plane to create my ocean. This would mean that in terms of the mesh i use for the ocean I will be making use of all of its vertices. A really cool method that was also mentioned in the article about the tech behind assassins creeds oceans that inspired me to start this (Assassins Creed Tech Article).
In the image below you can see what i have to do to get this method to work, not only to i have to project onto this invisible plane, but have to account for what to do if the projection does not hit the plane. So all i have to do is reflect the vector off the roof and fire it back down, some fun little math to get this working.
Accidentally left my music on during the video posted below, so enjoy the Persona 3 sound track.
I even managed to take this further by using a really cool site called Desmos to form some equations to force vertices to cluster around the point of focus on the ocean, making even more efficient use of the vertices, meaning i no longer have half of them rendering parts of the mesh being projected onto the horizon. Below you can see the equations on the site and the effect of the clustering.
I wanted to implement buoyancy in order to get object floating on my ocean. The way I implemented this was through buoyancy spheres. This is what was used in Assassins creed to implement buoyancy in an efficient and accurate manner. Multiple buoyancy spheres are attached to objects in order to provide an approximation of the objects shape. Below I have attached some buoyancy spheres onto a cube. I can then check the height of the ocean at each point of each sphere and determine how much of it is submerged to determine the amount of upwards force.
I factoring in 3 forces into these physics, gravity, buoyancy, and drag. I was having a few issues initially with reaching an equilibrium that would have the objects settle and float normally on the ocean. In the video below you can a real propulsion of objects out of the water.
I added some debug arrows to my buoyancy spheres to represent how much of each force was being applied to each one. This helped me find where the issue was in my math and find the point of equilibrium in my buoyancy. The green arrows is the force of gravity, blue is buoyancy, and yellow is drag, and purple is the overall force.
In the end I got some good results, I was really happy with the approach of buoyancy spheres. They provide great results with a low cost and a flexible application.
I love games which can change the entire mechanics of its self by creating a world that is something different. This is what the Mario Galaxy games did by creating planetary bodies to open up a variety of new mechanics that otherwise would not have been available. And this is also something Assassins Creed Black Flag did with its ocean, creating a non-static world that was something I had never experienced before. It was a world with a personality, that could work with or against you.
Ever since I played the game I wanted to figure out how there ocean worked and create it. Lucky for me I came across an article that interviews an Ubisoft employee who explains how the ocean works entirely (Assassins Creed Tech Article).
One of the first thing I wanted to get right before anything else was getting the waves procedurally animating on a plane. With a series of values that I could adjust to change the size, speed, or shape of waves. Before I could do any of this I had to study into Gerstner waves. A Gerstner wave is a wave that forms peaks and troughs. And the collective Gerstner waves is a summation of multiple individual Gerstner waves of different amplitudes and wave lengths to form a fractal implementation.
I decided to work with the Unreal Engine, because I enjoy working with its Blueprint system for creating shaders. The implementation of Gerstner waves into a shader also went rather well with the use of this GPU gems chapter of water simulation (GPU Gems Water simulation Article). Helpful laying out all the equations I need to implement this functionality. Though I came across an annoying issue that I have never seen before. For some reason Unreal Engine shaders do not use radians or degrees. Instead they use a normalised value between 0 and 1. So 2pi (Radians) = 360 (degrees) = 1 (Unreal). I do not understand why it does this, but it took a long time to debug.
I managed to get the shader set up, and a manager that could send down values to the shader in order to control the shape, speed, or size of the waves being created. The end result was very effective, and am quite happy with this first step.
Was messing around with Unity to create a looping world. Bit of a difficult thing without just using dead land and teleporting the player unknowingly to the other side of the world. What I got set up is a series of terrain cells that stitch together and store objects locally, meaning objects move locally to there cell and not the world. They then trade object references with one another whenever they try to cross borders and change the objects local reference. Below is a video where you can see all of this working, including the player jumping around in the object hierarchy on the right and the world shifting to keep the cell with the player in the centre. The effect was pretty cool, and a fun experimentation with Unity’s terrain system.
I designed 2 characters today, one is a paper boy called Maigo, the other is a paper girl called Konan. I would love to do something with these characters at some point, something along the lines of a split screen couch coop game with an Ico feel to it all. With each player needing to depend on one another, and have abilities the other does not, a little like brothers a tale of two sons. Something like having the boy us his hat to protect both of them from the rain that would damage them because they are paper, meaning Konan would need Maigo to provide shelter.
Been a while since I have worked with 3DSMAX, or done much drawing. So I designed this guy here, he is sort of a character i designed to populate multiple npcs in a location. By giving them different faces or fabrics for there body.
Modeled him into 3DS max and set up a good rig. Decided to customly construct the bone structure so i could add some bones into his ears. Turned out pretty well, might have some use for this at some point.
Also designed this hay enemy, came out a slightly creepy, could be really fun to model and rig.