See previous post

Well it’s been about a year. The game has changed massively since then. For starters, we’ve moved into the third dimension and decided we’re going old school Rareware vibe (circa N64 era).

(This video uses textures directly from Banjo Kazooie 64 as an attempt to get a feel for the vibe. They have since been taken out of the game)

The inspiration for this whole project was to allow for multiple hookshots, and the crazy physics things that might be possible as a result. Here’s a few examples I was able to test.

Most of the development work for this project has actually been in the tooling so far. I started by using the phenomenal program Trenchbroom to do my level editing and object placements. It is a wonderful program for quick prototyping.

HOWEVER, it does not natively support vertex colors, which is kinda integral to the entire N64-Rare aesthetic. I shoehorned my own code into the project (thank you open source community 💘) which allowed me to directly color the vertices.

Here’s an overview screenshot of what that would look like inside Godot.

First Glimpse
Note:

My changes continue to live here on github if you’d like to experiment. As a note, I am no longer maintaining this code.

Coupled with vertex colors, I really wanted to use the weird texture filtering that N64 games did. For what I’m talking about, see the shader I uploaded to godotshaders.com. The filtering gives a nice triangular look to the textures. Coupled with the vertex colors, the environments were starting to take shape.

With the above tech, I was able to make some cool prototypes.

During this process, I realized that Trenchbroom was really going to slow me down. So I moved onto another robust open source program, Blender.

Godot’s Blender support is excellent. I am able to modify the blend file directly and it will automatically import into Godot as a gLTF file. First order of business was testing vertex colors

The final (so far) piece of the technical puzzle was that I wanted to try using 2 layers of vertex colors. One that would track which texture to apply to a given vertex, with blending between them, and another for shading of the vertex. This required modifying the godot source code to pass a second color buffer to the shaders when rendering the objects.

I also redesigned the character around this time to make him look a bit more cartoonish.

First Glimpse

To get the blending to work properly, I had to limit the textures to only 4 per object. This way I could use a vec4 in the shader and give each of the 4 a unique coordinate from 0.0 - 1.0. To blend between any 2 textures, the shader just finds out where the current pixel is between two neighbor vertices and blends between them.

First Glimpse

I plan to share the code at some point, but since it only works on my version of godot it’s kind of moot. I suppose it could work if someone didn’t care about using the COLOR value for shading and only wanted to use it for texture. For me, though, and my aesthetic vision, I needed COLOR2 as well, so that’s what I ended up using.

I think we’ll wrap up here. I’ve been adding new animations as well as building levels, but that will wait for the next post. Combat is also on my shortlist, and I’ve already figured out how to string together animations as well as applying root motion to the model for animations that can move the player around.

Until next time!