I started playing around with building a new game in my free time again, and I've got to say it feels really good!
I've tinkered with game development for over 20 years, though I've never put together anything I felt was good enough to publish. I've always been a solo developer and while it would be really cool to build a game that even a few dozen people play regularly, I've always treated it as a hobby instead of a goal.
The game I've started building is a rewrite of a project I was playing around with a few years ago called 'Thrive or Die'. It will be a high fantasy sandbox survival RPG with an in-depth crafting system, a "living" ecosystem, and open character development.
The geography of the world (the shape of islands, mountains, forests, etc.) is mapped by hand, but the environment (the placement of trees, shrubs, enemies, etc.) is procedurally generated. Each time a new world is created it will be different from the previous, with just enough being the same that I can create lore and players can become somewhat familiar with the map of the world.
First Steps
The first thing I wanted to do was get a "test island" set up. I just quickly defined some basic terrain tiles so I could lay out the world that I'll be developing. I've set up special "generation" tiles that will determine what to spawn and where when the world is created.
My map editor looks like this before the game is started.
The labels on the tiles will disappear at runtime but help me view at a glance the different biomes and the "level" associated with them while I'm building the world.
A Whole New World
Now that I've got all the biomes laid out for the test island, I can start writing the code that spawns everything in those biomes.
World generation is pretty straight forward. The code searches for tiles of a given type and level, and there's a chance something like a tree will spawn on that tile.
Each level of each biome should be generated differently and include higher level resources and enemies. For instance, higher level forests will be more dense, thus have a higher chance of spawning trees on each tile than a lower level forest would.
The example below is the beginnings of the generation for a beach biome:
Every "Beach Generation" tile on the map has a small chance to spawn a tree, a little sprout, or some pebbles. Each time I compile and run the code, I get a fresh new world to discover:
While the map stays the same in a general sense and a player may always know where the highest mountain is, the best or rarest resources won't always spawn in the same places. This should help keep people on their toes when joining or starting a new world.
There's lots of work to be done
As it stands, this "game" is pretty bare. There's no item/inventory system yet, no character stats or attributes, no interaction. Nothing but the ability to walk around a randomly generated world with sparse vegetation and a few rocks.
This is the fun part in my opinion. Now is the time to start writing systems to interact with the various things that get spawned into the world. Cutting down trees, picking up items, crafting, leveling up. Each time I put a new system in place new avenues open up for further advancement.
First things first, though. I'll need to get a basic GUI set up to flesh out the inventory system. Only once I can pick items up should I be worried about being able to do anything with them.
I'm having a lot of fun working on a game again and I'll write some more about this when I've got the next part finished. If anyone would like to know more about the engine I'm using, I might write up a full post explaining what it is and how it all works.
Thanks for Reading!

