#let post_slug = "gamedev"
#let post_preview_image = "flying.webp"
#let post_summary = "Creating an open world multiplayer terrain destruction game in Godot and Rust"

= Game Development

I am currently developing an underground-submarine openworld multiplayer
physics inspired game. As a gamer and enjoyer of large, rich maps and
depth to gameplay, I would really like to say thats what I started out
trying to create. Instead, the story goes that I had this random idea
for terrain manipulation. Games like Minecraft and Terraria use squares
and cubes, which just feels boring in my opinion. I thought I could do
something much more precise. As a sort of tech-demo/proof of
concept I programmed a shape that could be modified by boolean geometry
operations, mainly union and subtract with a second polygon. This led to
a very interesting, but quickly boring "game" to hop around in. However,
since I could drill through and place prettymuch any shape I wanted to,
it felt like I could "fly" through the land, much like a submarine
"flies" through water.

I implemented some modularly built
vehicles with use of graphs theory and object oriented programming, and
terrain generation using cellular noise. The reason I used cellular
noise is because if you look at the lines between cells, they form a
network without dead ends. Then by applying an algorithm using a density
function on depth I am able to fine tune the width and density of the
caves without impacting their interconnectedness. By using this method
chunks can generate completely independent of their neighbor, which is
optimal.

"Multiplayer is the hardest part of game dev, maybe
release that later" I have been told by a lot of people. However, as a
hobby-server configurer and network security nerd, I thought I could
take it on. I was right, however as a network security nerd I have more
layers of firewalls than I do braincells. Every single time I have an
issue with networking, its a firewall. Once I found which ports were
blocked, yes multiplayer was easy.

The result? I could fly
drilling vehicles through terrain, pop out of the ground or into random
caves, mine materials, play hide and seek with friends, and even orbit
the planet. One of the things important to me in this game was accurate
physics: thrust, torque, gravity, mass, all the fun stuff. While I am a
physics minor, I am more importantly a heavy player of physics and
rocket science games such as Kerbal Space Program. I was able to glide
through AP physics simply because it
_just part of the games world_, it included everything we would
learn in the classroom. Realistic physics also added to the depth of
gameplay I was looking for.

After some formal computer
science education, I discovered new ways to more efficiently implement
many of the algorithms I had initially generated and rewrote them
...multiple times. Currently everything runs _buttery smooth_ and
framerates are high due to efficient caching of unloaded chunks,
multithreaded chunk generation, gpu accelerated compute shaders to
modify chunk density, enhanced use of object oriented programing and
graph algorithms to build massive modular vehicles, authoritative server
networking to disable hackers, and other performance tweaks.


So this sounds amazing, where's the game? Well, a game needs graphics, audio,
a sound track. As much as I'd love to release it now, its unplayable for
these reasons along with a few minor implementations left such as NPC's and
reworking the tech tree.