Saturday, June 8, 2019

Blake's Vacation Adventure (1 / 2)

I've said this in a few places, but just in case you were unaware, I'm currently on vacation! I started vacation on the 5th of this month and I'm currently in the upper peninsula of Michigan visiting my dad & sister.

It's been insanely relaxing to finally take some time away from everything. To not have to worry about the RTS, YouTube, contract work, web development, anything!

So I've taken this opportunity to practice some of my more favorite parts of game development. Now, sitting down and studying programming as part of vacation might sound like hell for some people, but it's actually quite relaxing. Procedural generating and code-heavy game development are some of my favorite things to do.

First I started on a 3D voxel engine. I hadn't done it in a while and I wanted to see if I could make it equal to if not more optimized than my perlinia one (https://perliniagame.blogspot.com/).

The answer was absolutely no, this engine froze and took awhile to generate anything, but it was still fun:


I was actually trying to generate caves in this, but they ended up just being long cliffs so I decided to make the bottoms blue and call them rivers lol.

For my next coding adventure, I wanted to work on something 2D. I took more screenshots this time so I can explain my progress.

First, I created an engine that was able to render chunks. For testing this I set every tile to be one of 5 random colors (black, white, red, green, blue):


This was able to be rendered in 14 seconds (16x16 tiles per chunk, 16x16 chunks in the world, for a total of 65,536 tiles).

Now that I had rendering working it was time to do some generating. First I generated some noise and made the dark half blue and the white half green:


I didn't log how long this took, but I'll estimate around 15 seconds. Now that I had noise working properly, I needed a reason the player couldn't leave the borders of the map so I added a gradual falloff map which resulted in an island:


At this point I had also added seed support, so entering new seeds would result in different maps. This map in particular is the seed "Hello World!".

With that update also came being able to define what noise values rendered which color. So I added a couple more to polish up the map:


And finally, I'm going to want to know where key locations such as cities will generate, so using the same technique I used to find spawn locations in the RTS (Poisson Disc Sampling) I created a series of random potential points:


With that update also came increased density. Chunks are now 64x64, still 16x16 chunks total. Which makes this map size 1,024x1,024 or 1,048,576 tiles.

This is the most optimized 2D procedural engine I've ever written, so you can imagine just how happy I was when the times reflected that:

Generated & Rendered In-Editor: 40s
Generated & Rendered In-Standalone: 20s

And I'm working from a slow Windows 8 laptop (Bc on vacation). So as you can imagine I'm very very happy with how this has all turned out.

I was laying down on my bed with my laptop eating some cheez-it's, and suddenly I became very nostalgic. This is the first summer since I graduated High School, but yet here I am at my dad's practicing programming just like I did the last 4 years.

I'm calling this part one because I'll still be on vacation for 1~4 days (Depends on some currently unpredictable factors), so I'm sure I'll have more done by then to warrant a second post.

I just thought I'd make this to keep you guys up to date! I'm not really sure what game I'm making with this 2D engine but I'll figure it out!

Sincerely,
Blake Gillman

1 comment: