Devlog #29: World Synthesis
Greetings, pioneers! We’re back with another devlog, all about the new world generation and reworked map expansion. We’ll also give a preview of a new crafting mechanic that’s in the works. Let’s dive in!
New World Gen Algorithm
When you start a new game in Automation Station, all you have is a single island to call home. But before long, you’ll unlock additional chunks of land, gaining access to new resources and space to build your factory.
Until now, these islands have been perfectly hexagonal. This shape works well with the hex grid of the game, but it’s super boring and feels artificial. The other issue is that hexagonal grids have no long straight edges, so even with a rounded tileset, you get these repetitive squiggly island borders that make it feel even more artificial.
I always wanted the islands to have a more organic shape, but I wasn’t sure how to achieve this. It’s easy enough to do this for a single island, but once there are multiple islands, they need to all fit together, kind of like a jigsaw puzzle. (I should clarify here that when I say “island,” I really just mean a chunk of land that will be unlocked as a single unit, but there is no requirement for water to separate the chunks of land.) I tried to find how other people solved similar problems, but none of them quite fit all the criteria I was looking for.
After a lot of failed attempts, I finally came up with an algorithm that was able to produce the organic shapes I was looking for. And on a technical level, the algorithm checks all the boxes I was hoping it would. The islands are approximately the same size, they slot together seamlessly, and the result is completely deterministic based on a seed. Best of all, it is extremely fast and cheap to generate an island, so it can be done on the fly when the player unlocks a new island. Here is a look at some of the shapes it can generate.
We are still tweaking some of the world generation parameters, but we’re really happy with how these look and feel in the game. Now every player has a unique world to call their own.
There are a lot more technical details that I’d love to share about the world generation algorithm, but I’ll save that for another time since we have a lot of other stuff to talk about.
Reworking Island Unlocking
The idea of unlocking new islands has been in the game for a long time. Previously, this worked like so:
- Players would find a pylon on the edge of an island.
- The base of the pylon would have different “locks” to deposit items.
- Once all locks were unlocked, the pylon could be activated.
- Activating the pylon would raise a new island out of the water.
Here is a post from way back in 2022 showing off the island unlocking:
The progression in Automation Station will be tied to unlocking new islands. Thought it would be cool if the island emerged from the depths.#screenshotsaturday #madewithunity #indiedev pic.twitter.com/SGpdHSWoVn
— Scott Daley (@GravitonPunch) December 17, 2022
While this approach worked, there were a few problems with it. Firstly, it wasn’t super clear to players how they should interact with the pylons or even what they were. Without an explicit tutorial, players might not figure out that they should be filling up the locks to activate a pylon and unlock an island. It also required these big pylon structures on the edges of each island, which didn’t look great and took up a lot of space on smaller islands.
Rather than heavily tutorializing this mechanic, we decided to scrap it in favor of a new Map Mode. In this mode, players can hover over adjacent islands and hold to pay and unlock the one they want. This removes the need for any pylon and lock structures and is much more intuitive to use.
I took this opportunity to juice up the animation when an island is unlocked. Here is what it looks like slowed down:
If you want to see a technical breakdown of how I achieved this effect, I explain it in more detail here:
The animation is pretty much all done in a shader. I pass a shader properties that specify the origin position and the animation start time. Then the shader uses the distance from the origin and the time since the start to animate each vertex.
— Scott Daley (@GravitonPunch) June 27, 2024
Expansion Cores
In addition to the new map mode, we decided to add new items specifically designed to pay for unlocking the islands. These items are called Expansion Cores and must be crafted.
The design of these expansion cores is still a work in progress, but there will be different tiers, each requiring a more difficult crafting process. Each tier of expansion core unlocks a new tier of islands which will contain new resources needed to craft the next tier of expansion core. And you’ll need a lot of these cores, so setting up an automated factory will be essential.
Dynamic Resources
One of the motivations behind the new world generation algorithm and removing the pylons was to allow for a smaller starting island. We love the cozy feeling of starting with a small space and slowly expanding it and making it your own. However, a smaller starting island means limited space for resources. To unlock the second island, you need iron, copper, stone, and coal. Previously, we made sure that an infinite node of each type would spawn on the starting island, preventing any kind of soft-locking scenario. But this isn’t possible on a small island. Instead, we decided to spawn rocks randomly over time:
Destroying rocks is a lot more fun than manually mining from an infinite node, so this makes for a much more enjoyable early game. However, we are still figuring out the best spawn rates such that the player doesn’t have to wait for more to spawn without it feeling overwhelming. Once you have access to infinite nodes, the spawning rocks can be a little annoying and distracting, so we’re still figuring out if this is the best choice.
Let us know if you have any ideas for early game resource collection!
Synthesis Crafting
Automation Station already features two different crafting machines. The first is the Fabricator for turning single items into new items, such as iron ingots into iron gears or copper ingots into wire. The second is the Assembler that can craft a stack of items into a new item, such as circuit boards. Both of these crafting machines work well for a certain set of recipes, but we realized that we wanted some multi-ingredient recipes in the early game, prior to unlocking stacking and the Assembler.
One of the design hurdles of supporting multiple ingredients is that each building in Automation Station can only hold a single item or stack at a time. So how would we support a crafting machine that can use multiple ingredients without holding multiple items or a stack? One option is to make the machine modular by splitting it into multiple buildings. For example, smelting requires a crucible filled with ore and a burner next to it filled with coal. This effectively takes two ingredients, but each goes into a different building.
We tried applying the same idea to crafting. Instead of a single crafting building, there would be multiple ingredient-receiving buildings connected to a central crafting building that would produce the final product. For now, we have decided to call the input buildings Depots and the central crafting building a Synthesizer, but we are still deciding if these are the best names.
Here is an early look at how you would craft the first expansion core from iron gears and copper ingots. Please note that the models for the Synthesizer, Depot, and Expansion Core are all placeholders, so expect this to look different in the final game.
Each Depot can hold a different ingredient but must be connected to the Synthesizer. Once all Depots are full and the ingredients match a valid recipe, the Synthesizer will craft the product.
Requiring multiple buildings for crafting is a bit unconventional, but we hope players will like this crafting mechanic. And we think there are a lot of exciting opportunities to expand on the idea in the future.
Buoyancy
With the game starting on an island surrounded by water, one of the frustrations that playtesters quickly experience is an item falling and sinking to the bottom of the ocean. We never added a way to prevent this or recover those items, so it can be especially annoying if you just spent a bunch of time crafting that item.
It was finally time to fix this once and for all by simply making items float.
Now you can chuck items into the water and then jump in after them to pick them back up. No more lost items! And the player can float too, but we’ll need to add in a proper swimming animation at some point in the future.
Conclusion
That wraps up this devlog! Thanks for reading to the end! As always, let us know if you have any thoughts or suggestions in the comments below or in our Discord. We like to show off features early in development so that we can iterate based on your feedback.
Cheers!
-Scott
Changelog:
- Created world generation test setup
- Created new world generation algorithm that produces organic island shapes
- Removed 1 tile gap spacing between island chunks
- Created new island generator to generate the shape and height map for a single island
- Dynamically added chunks to the world when a new island is generated
- Added "Map Mode" where the player can unlock new islands
- Highlighted hovered locked islands while in map mode
- Animated hovered island outline in map mode
- Created SDF-based shader for drawing island shape outline in map mode
- Generated tile meshes for locked islands to render island shape outlines
- Exposed world generation settings for island shape noisiness, island shape noise scale, and height noise scale
- Added new control prompt when hovering over a locked island in map mode
- Added support for hold control prompts with animation
- Created "ripple" shader effect when unlocking an island
- Increased outline animation speed when actively unlocking an island
- Created models for expansion core items
- Created icons for expansion cores
- Showed cost when hovering over an island in map mode
- Added new system to track the number of expansion cores the player has in their inventory
- Automatically added expansion cores to expansion core inventory when manually picked up
- Showed expansion core inventory in new UI panel while in map mode
- Required sufficient expansion cores to unlock an island
- Consumed expansion cores after unlocking an island
- Made objects "spawn" on newly unlocked islands, synced with the unlock ripple animation
- Added destructible rocks for stone, copper, and coal
- New world generation authoring settings to control static and dynamic resource spawning
- Added support for spawning a fixed or random number of resources on an island
- New system to dynamically spawn certain resources (like rocks) randomly over time
- Created new authoring workflow that allows each island to specify different resource spawning settings
- Added new depot and synthesizer buildings (using placeholder art)
- Added new system for tracking connections of certain buildings (like depots to synthesizers and burners to crucibles)
- Created new authoring workflow for synthesis recipes
- Implemented new synthesis system to handle crafting with a synthesizer
- Created new UI elements to show synthesis recipes in the codex
- Dynamically populated the codex with synthesizer recipes
- Created new buoyancy system so that items and the character can float in water
- Allowed character to jump out of the water
- Prevented player from auto-picking up items immediately after throwing them
Leave a comment