Proc Jam Blog 1


Hallooooo! This is my first proc jam. I am entering the week without much knowledge into procedural generation techniques, though I have experimented a bit over the years (more in my art than in my game dev). In order to take advantage of this time and opportunity, I outlined a few goals to keep in mind while working on my submission.

  1. Complete an experimental feature for Traverse The Void using procedural generation.
  2. Better understanding of existing techniques and projects in proc_gen.
  3. Read a chapter of https://thebookofshaders.com/ every day during jam.
  4. Blog daily.

I decided to start each day with an hour warm up, as a time primarily for learning concepts from the field.  I figured the concepts and lessons from shader programming may extend nicely into general concepts about procedural generation, so I am starting with The Book of Shaders, and will follow threads that come up every day during development to learn about more specific concepts.

Day 1

I am not sure yet what I want to build, so yesterday I started playing around with some code based off of this tutorial http://www.procjam.com/tutorials/en/ooze/ . I extended the code into 3D, and got something up and running.


I realized that my solution for “types” and texturing won’t work with the biomes code, as I don’t really have a way to blend between biomes, as my types are not currently designed for that. This is something to think about as I add more types, but for now I decided to move in another direction.

I modified the biome code to write to my mesh generation system that uses marching cubes. I got some interesting looking behavior, though the surfaces were pretty ugly.


Curious if I could smooth them, I looked up image smoothing, which led me to gaussian blur , and box filters. I applied a box filter and voila, I was able to convert the mesh into something nice and organic. I played around with this for awhile, and substituted gaussian for box, to get a slightly more detailed surface.


At this point I was happy I had something working, though I still lack an idea for my goal for the jam. I figure this is not a problem, exploring some possibilities this weekend may be a solid way to discover something interesting and learn more. So I decided to continue on my current direction, and thought it would be interesting to define areas of high density (large mesh) to connect separate islands together through some vine or bridge system. Not sure what to do, I wrote a quick method to reduce my 3d array from 40x40x40 to 5x5x5. I figured any new cell that is still dense enough to draw a mesh can be considered a node.


It worked! ...kinda. There are issues, like nodes not getting picked up, and clusters of nodes when there ideally should only be one or a few. I have a few ideas to address this. a) increase array from 5 to 8 b) a second pass where I look at neighbors to valid nodes and combine into larger nodes, b) a different method of reducing the array to try and preserve more data I want.

This was it for the day. I started reading into Minimum Spanning Tree (MST) to connect my nodes together, but it was too late for me to follow what was being said. Task for tomorrow!

Day 2

Started day two working on nodes. I grab random nodes, and avg position of it and all its neighbors, then remove the nodes and replace with the avg node. It works well enough for now.


Spent my morning spiraling downward on one stupid bug I could not figure out. Just trying to swap the material of the mesh to make a video, and spent hours banging my head against the wall. Turns out the way the mesh generation is implemented, a mesh is not tracked by the level until it is seen by the player (another bug...). For now I moved the player far away to test without interference of some shaders on the player that draw over top of everything (I am working in my Level Editor scene and turning the player off causes lots of bugs I don’t want to deal with right now). So my solution is to put the player up in the air looking down :) 

Another bug burned a bit of time. Turned out I was flipping my x and z index when saving an index during the smoothing phase, which was causing incorrect smoothing. This does explains why I noticed some peculiar symmetries at times :) The effect is pretty cool, I might look into symmetry in a cell, or between cells, along an axis , in the future.

Once I got the existing code on track, and added a step to combine nodes together, I looked up MST to connect my nodes.  Turns out my read before bed the night before had stuck a  bit, and I was able to work through the process conceptually. I read through the code and plugged it in, making some minimal changes to fit it in my project, and I had to create the initial graph of verts and edges -- I calculated weights based off of distance for now -- and voila!

Errors.

Turns out my logic in the loop where I construct the edges was wrong, so I fixed that and a few other errors in the loop where I visualize the graph and it worked. 


At this point I was excited about what I had and the potential directions, but with so many directions I felt a bit overwhelmed, unsure where to go next. So I stopped for the day to let my mind wander and consider different possibilities...or to play the original half life in between sessions of Half Life: Alyx with the dev commentary turned on.



Till next time.

Get Traverse The Void (proc jam)

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.