Weekly Game Jam #264, Day 2
July 30, 2022
Read Day 1 Here
Read Day 3 Here
I'm participating in the 264th Weekly Game Jam, a recurring game jam on itch.io. The theme this week is "Many Islands", and yesterday I brainstormed ideas, followed by putting together a small archipelago of islands in an infinitely expanding sea. Now we move on with Day 2!
A Quick Note on Physics Body Composition
I knew that, given the scope of the work and the time I had today (I didn't get started until the evening), I wouldn't have time to model any islands today. However, to satiate my curiosity with regards to that work, I decided to see if I could add additional meshes and collision to the Island KinematicBody nodes I already had.
As it turns out, it worked! Walking over to that extra sphere had exactly the collision I needed it to. And when I experimented later with getting the islands to move, I found that the sphere moved along with the island just fine and even carried my character along while it was standing on it.
The main takeaway is this: physics objects in Godot will take collision from all
CollisionShape nodes below them in the scene tree, whether they are added inside or outside any instantiated scene. For me, this means that when I do get around to modeling islands, I can model the entire island in Blender, export it to Godot, and make it a complete kinematic body, allowing me to use Island kinematic body logic (such as general migration, swarming, and keeping proper distance from other islands) while keeping the node itself empty inside the scene tree.
Fixing the Water
After doing this, I spent some more time tweaking the water, and after about an hour of banging my head against the wall, I decided I was finally sick of it, and I should go online and see if anyone had more successfully done a water shader. As it turns out, not only did I find a good realistic water shader, I also saw that someone had managed to recreate the Wind Waker water that I was originally trying to evoke.
The only thing I needed to do to make it work with my project was change the way it was sampling to work with my infinite tiling system. This turned out to be easy enough - the shader uses
UV to sample the surface from 0 to 1 in both directions across the mesh, and it already had provisions for repeating the waves and tiles infinitely, so what I needed to do was get the world vertex position as before to get the tiling position (essentially, replacing
(WORLD_MATRIX * vec4(VERTEX, 1)).xz and changing some of the scaling constants).
And that's it for day 2! I unfortunately didn't get a whole lot of time to work today, but hopefully tomorrow will be more full with some goal addition and island modeling!