Showing posts with label world. Show all posts
Showing posts with label world. Show all posts

Wednesday, July 30, 2014

Story of a Failed Indie Dev

I've been posting on this blog for about ten months now. There's a summary of my story in the about section, but I haven't told the whole thing.

The story starts while I was still in college. I majored in Real-Time Interactive Simulation; a fancy way of saying video game development. A friend of mine introduced me to a game called Dwarf Fortress. In Dwarf Fortress, you oversee a colony of dwarfs as they work the land and build a city. The map is divided into a 3D grid, and any space can be mined out or built upon. The game is insanely detailed, to the point where you can examine what kind of nerve damage your dwarfs have suffered. This detail combined with the flexibility of building however you like makes the game incredibly engrossing, but also daunting. Dwarf Fortress is also rendered in ASCII characters, like an old Rogue-like game. This is nostalgic and charming, but one can't help but imagine a full 3D version.

Just as I started to entertain the idea of making such a game myself, Minecraft appeared out of nowhere and quickly rose to fame. I quickly abandoned the game ideas that had taken root in my mind. Minecraft had beaten me to the punch, and spawned countless rip offs hoping to cash in on the trend. I, myself, was a huge fan of the game, despite how it had dashed my hopes. So while I would sometimes daydream about the game I'd like to make, I focused on finishing my education.



One year, I had the opportunity to attend GDC. While there, I had the opportunity to meet the creator of Minecraft (Notch) and talk with him for a while. I conveyed my story to him, including both my appreciation for his game, and how I envied that he had beaten me too it. Notch, being the incredibly cool guy that he is, took it all in good stride and encouraged me to pursue my own ideas. Something along the lines of 'there's room in the world for more games like this'. Don't quote me on that though.
Eventually, I did finish school. I was fortunate and managed to land two job offers right before graduation. One was a fairly typical, entry level, game development position. The other was from a company that makes slot machines. The second job hadn't at all been the sort I'd been looking for. The manager that had come to recruit people was looking for fresh young talent to bring his company's technology into the 21st century. It was also in Reno, Nevada; somewhere I had never imagined living. Especially so because I have a hard time dealing with hot weather. Give yourself a biscuit if you're genre-savvy enough to figure out which job I picked.

I enjoyed my time in Reno. It was my first time living on my own and I relished the freedom. The heat didn't bother me at all, much to my pleasant surprise. One time, I biked into the desert to watch an eclipse. My job afforded me freedom as well, for the most part. Perhaps just enough to be frustrating. I had neigh unlimited freedom with the code I wrote, but practically none when it came to integrating that code with what the company already had. But despite frustrations, I still enjoyed my job.


However, after a little more than a year, I began to feel restless. Reno is a nice town, but the days seem to blend together there. The frustrations I felt in my job were reflected in my life as well. I had more free time than I had ever had, but it wasn't enough. It was almost enough, and somehow that drove me crazier than not having time at all. I began to think about what I wanted to do with my life, how I could get more time without becoming a hermit. I concocted a plan: I would become an indie dev.

The idea was simple. My job was high paying, so I saved up money for several months. I would use that money to leave the working world for a year. In that time, I would make a game. If it succeeded, I would use the profit to fund my next game. If not, I'd simply return to normal working life no worse for wear. I started designing a game that sounded interesting. A game where you'd colonize Mars with self-replicating robots. When the time for my break drew near, I began telling people about my plan. I got a lot of people excited, received lots of encouragement, and a fair share of (justified) doubt.

Part of that break was moving back to Washington. I missed my home, my friends, and my family. While in Reno, I met my current boyfriend. He, too, wanted to get out of Reno, and Washington had been one of the places he was considering. And so it happened. We packed up our things, took a nerve wracking drive across three states in a 20 foot U-Haul with a car in tow, and embarked on our new lives.

Settling in wasn't easy. It took my boyfriend a long time to find a job in the area. Having him at home when I had been looking forward to eight hours of isolation per day... well, it wasn't exactly how I had pictured things going. There was a lot of tension in our relationship at that time, and the only thing really deserving of blame was the economy.

I soon became stressed in my work as well. Progress was slow, which only made me determined to do better the next day. Worrying about it made me less productive, and lacking productivity, I became more stressed. The cycle built upon itself for nearly three months. It was at this point that I finally admitted to myself that I was no longer invested in the game I was working on, and allowed myself to explore other projects.

The transition was hard. I still worried about finishing a game, even if it wasn't the one I had set out to make. I was worried about wasting the opportunity that I had made for myself. I didn't want it to be for nothing. And ironically, it was this fear that had been slowing me down all along. The worst part, I think, was that on some level I understood that the whole time. But it's one thing to understand a fear, and another to conquer it.

It wasn't until only recently that I really managed to do that. In part, I think it was because I had given up on my original plan. My time was up, and I needed a job. Perhaps also because I was starting to fear real problems, like running out of money. But whatever the case, I started moving forward. I realized once and for all that I had known the game I wanted to make all along, and it was time I let myself make it. Who cares if it's dismissed? Played by a handful of people and written off as another Minecraft clone. I'm not making it for the approval of others. I'm making it because I want to. Maybe I won't even finish it, but I won't know if I don't try.

And that brings me to now. I made more progress in a week than I had the last few months. Job prospects are looking good, and I'm hopeful for the future, if somewhat cautious. Tomorrow will bring what it may, and I'll do my best to keep on moving.

Tuesday, March 18, 2014

It's a Small World After All

I'm still working on large-scale terrain. I decided to try a hexagonal grid rather than a square one because it seemed more natural. Plus, it avoided the awkward question of whether or not I should have water flow diagonally. Here's a screenshot. The terrain itself looks more natural, but lakes and rivers no longer form quite as easily, which I have to work on.


Here's a screenshot showing the hexagonal cells. Each vertex is one cell. The lines show the connections between them.

One thing that's changed is that the different layers can now mix together to a degree. I'm not sure if this was a good move. It's more realistic in some ways, but the results aren't quite as interesting. Feels like two steps forward and one step back. There are still a lot of things I want to add (temperature, humidity, snow and ice, plants, etc), but I'm trying to get the parts I have now working as well as possible before adding more complexity.

Interesting fact: the area I'm simulating is roughly four square kilometers, but this can be scaled up.

Tuesday, February 25, 2014

Please Save This For Me

I'll come back for you, love, I promise to.

This week I've been working on saving and loading the world as you move through it. Until now, the world has been procedurally generated as needed. You could make changes to the world, but if you left and came back, the terrain would be re-generated.

A simplest way to handle saving and loading is to divide the world into parts and save/load each part to a file. However, this can incur a lot of hidden overhead. File reads/writes are very expensive. They're pretty much the most expensive thing a computer program can do short of accessing the internet.

So I decided to (once again) take a lesson from Minecraft. I originally implemented a format that was more or less identical to the Region file format used by Minecraft. After doing all that work, I suddenly realized that the Region format wouldn't work for me, and there's one important difference between my project and Minecraft that makes this a problem: Minecraft has a fixed height limit.

My project, on the other hand, does not. The game world extends infinitely in all directions, including up and down. The reason this is a problem is because the Region file format stores world chunks in vertical columns. This is fine in Minecraft since moving up or down can never trigger loading/saving. This is not the case in my project. If I used the Region format, I would have to store twice as much data when the player is straddling a vertical boundary.

So I decided to modify the format to suite my needs. Instead of working with columns of the world, I'm working with large cubes. I chose a size that was large enough to take advantage of compression (using run length encoding), but small enough not to incur a huge memory overhead. I ended up settling on 64 x 64 x 64 block areas.

Unfortunately, this change created a problem. In the Region format you're unlikely to get an entire column compressed down to significantly less than 4096 bytes. This number is significant because most modern computers read from hard drives 4096 bytes at a time (it's more efficient to have a few large reads than a lot of small ones). Region stores its data in a way that minimizes the number of reads/writes.

When you store the world as large cubes, you end up having cubes of solid air or rock. After compression, these only take up a few bytes. Basically, this would mean using 4096 bytes for something that requires less than 10. This wouldn't be so bad if these sort of regions were few and far between, but they actually make up the majority of the game world. My solution to this problem was to store multiple small chunks in a single 4096 byte area. Large chunks are still stored the original way. The end result isn't quite as elegant as the Region format, but it did, inadvertently, result is a larger maximum chunk size (255 MiB vs Minecraft's 1).

I finished all the code for this, but I still have to fix a few bugs before I can say it's done.

Tuesday, February 18, 2014

Vegetation


Another short post this week. I added some vegetation! Importantly, I can use the same code to create other objects. Although, for the time being, I have to hand write object meshes, so I probably won't add many more until I have a way to import them. I added a minimap. This is just for testing purposes and will eventually be taken out. I also did some more optimization that allowed me to increase the render distance quite a bit.

Tuesday, February 11, 2014

Snow Stickers


Gonna be a short update today. You can now create and destroy blocks (look, I made a castle!). Additionally, I added decals. This lets me slap additional textures on blocks. I could even layer several on a single block. In the above screenshot you can see me experimenting with snow decals. This will cut down on a lot of work that I would otherwise have to do by hand, and opens up a lot of possibilities. I was pleasantly surprised to find that the decals didn't impact performance, even without any optimizations. There's also some water visible, but this is purely for looks.

Tuesday, February 4, 2014

Grounded

I've been making progress on my project! I finally got some basic physics implemented (after three days of debugging), so you can walk around the world now. I also did some optimization; things are running a lot faster now. Sections of the world are now generated on demand, so you can walk around indefinitely. I'm not saving or loading sections yet though. I also added in some variation in the terrain, so now there are patches of snow and snow capped mountain peaks.


This week I'm going to talk about how I'm generating the world.