StoneSpace: the last crafting game


DrBPW


StoneSpace is a comprehensive pure crafting experience with hundreds of recipes covering every type of crafting, from metallurgy, to cooking, to erecting structures.

It’s written in C# using Monogame (XNA). I’ve been working on it single-handed for about 18 months, learning everything from scratch (coding, pixel art, sound design, etc.), so I’m on a very challenging learning curve.

The first biome (plains, pictured above) is slowly coming together. The visuals are starting to look… passable, I think. Though there are still hundreds of small details I want to improve.

The world is procedurally generated (the algorithm needs tweaking a bit to get the density right), and you can specify the seed when starting a new game if desired.

The player can explore and gather various resources, which unlocks new crafting recipes. Each biome has its own collection of spawnable items and distribution of spawn chances across them. Certain items only spawn in specific sub-areas (such as branches only appearing near trees) or are more likely to appear in some zones (like rocks and flint appearing more often on riverbanks).

The player can forage fallen nuts or collect berries from bushes to replenish their stamina. Many more food types and cooking recipes will be added over time.

Trees can be felled with an axe. Branches and logs can then be harvested and used as early crafting ingredients. All the trees have the same shape currently with some varying colour palettes for variety, but in future I’ll add two or three additional species.

I recently finished adding the day/night cycle. The screen fades at dusk and lightens again at dawn. The player doesn’t know the exact time, but they can judge the approximate time of day using the position of the sun in the sky. A visual representation in the top left corner shows the sun rising, moving across the sky, and setting, and mousing over it gives some flavour text for what time of day it is (example below).

I’ll start experimenting with localised lighting effects soon, when I’m done adding fire to the game.

I’ve got a few more mechanics already fully coded that I’ll showcase in future dev updates.

« Last Edit: September 13, 2024, 07:03:15 AM by DrBPW »
Logged

DrBPW


Thanks! ☺️ I’ll post some more details and show off more of the mechanics I’ve been working on soon.


Logged

DrBPW


StoneSpace is quintessentially a crafting game, so the crafting mechanics are paramount.
I’m fairly happy with the progress I’ve made integrating the many aspects of the crafting system into a single menu (above). A quick rundown so far:

The player selects the item they want to craft on the left side of the menu.
They can select a category, such as masonry or textiles, to see a scrollable list of known items in that category, or type all or part of the item’s name into the search bar.
There are filters that can be toggled to further refine these lists, like only seeing items the player hasn’t crafted yet (only 1 filter type has actually been coded so far).
The player can also favourite items (e.g. the starred flint wedge above), which adds them to a special list for quick access.
If a category contains a newly unlocked item, it has an exclamation mark on it. A new item is flagged as such (e.g. the flint blade above) until the player mouses over it and sees its description.

Clicking an item displays it’s recipes on the right side of the menu.
Many items can be made more than one way. The player can cycle through every recipe that includes the selected item as an output.
Recipes have inputs, which are consumed when starting to craft, and outputs, which are gained when the recipe is complete.
Many recipes also require the player to possess specific tools. Many tools have durability and wear while being used. If a tool breaks before the recipe is completed, progress is paused.
Some recipes also need the crafting station being used to be supplied with sufficient power (e.g. the electrolyzer), or to be burning at a minimum temperature (e.g. the blast furnace), and sometimes the fuel used must satisfy a certain purity threshold. These three mechanics will be fully implemented in a future update.

There are 3 types of output:

  • Normal outputs: the player always receives an exact number of the item.
  • Variable outputs: the player receives a random number of the item between two values (e.g. between 4 and 10 leaves).
  • Possible outputs: there is a chance to get this item but it is not guaranteed (e.g. certain ores from breaking down stone).

The player crafts the recipe by holding down LMB on the big green craft button, and releases LMB to pause.

Each recipe also has an associated skill (e.g. blacksmith or tailor) and most require the player to be a minimum level in said skill to craft it. Completing a recipe rewards the player with experience points in its corresponding skill. More on skills another time.
The player can also queue a recipe to complete it multiple times in a row with one click.
Paused recipes can be cancelled (pictured below).

Recipes can be pinned to the right side of the screen, allowing the player to track what they need vs what they have (example in top-right above). Pinned recipes can be quickly unpinned or opened in the crafting menu using the cross and book buttons. The player can pin as many recipes at once as they like; once they no longer fit the screen, they become a scrollable list.

I may create a short video demonstrating these crafting mechanics, host it on YouTube or somewhere, and link it here.


Logged

DrBPW


In addition to crafting various items, the player can also construct many types of building, from workbenches, to pottery wheels, to beds, to blast furnaces. Most buildings double as crafting stations, so erecting them unlocks additional crafting mechanics. For example, the player can use a smelter to refine various ores into metals.

There is no dedicated ‘build zone’ in the game; the player can build anywhere there aren’t obstacles, and almost all obstacles (like rocks or trees) can be cleared with the right tools. They can therefore create as many bases as they like, wherever they like, or just place buildings arbitrarily around the map, depending on their play style.

It’s important to me that the player be able to see the size and shape of a building, and plan where they want to build it, even if they don’t currently have the materials to construct it. This makes it easier for them to plan and visualise their base. It also spares the player the frustration of saving up resources to build something, only to find that it’s much larger than they expected or doesn’t look good anywhere in their current layout (many games have this shortfall).

I achieve this with what I call the build site mechanic: the first step to constructing a new building is placing a build site where you want to erect it. The player can do this as soon as they know the recipe for making that kind of building, even if they don’t have all or any of the required construction materials.

Build sites are represented by a semi-opaque greyscale version of the building texture (known as a ‘blueprint’) and can be deleted at will (example pictured below). The player can place as many build sites at once, and therefore have as many incomplete buildings on the go, as they like.

When placing a new build site, the blueprint snaps to a grid, making it easier to line everything up neatly and create organised base layouts. I’m considering giving the player the option to toggle this on or off for ad hoc placement if they’re that way inclined.

The player can also rotate build sites while placing them, flipping between different orientations. This gives them more freedom when laying out their base(s).

The ability to line things up on a grid, and rotate them, are two features that again a lot of games lack. But I really appreciate having them when they are there, so I wanted to go the extra mile to include them.

When placing a build site, the building’s blueprint will have a green highlight over it if the proposed site is clear of obstacles, and a red highlight over it, as well as over the obstacle(s) that it overlaps with, if the placement is invalid. An example of this visual feedback while placing a new build site is provided below.

The player can also queue multiple instances of the same building, just like queuing multiple instances of the same crafting recipe, and place multiple build sites all at once. So, for instance, you could place 5 smelter build sites in a row all at once, without going into and out of the menus.

After placing a build site, the player needs to gather the required materials to erect the building and then construct it. I’ll run through where I’ve got to with those mechanics in a future update.

« Last Edit: August 29, 2024, 02:13:17 PM by DrBPW »
Logged

DrBPW


For the past 3 weeks, I’ve been working on the game’s save system. There were certainly a few interesting challenges to work through, but in the end it didn’t take a long as I feared.

The player can now Quicksave/quickload near-instantaneously using keyboard shortcuts.

The save system is quite comprehensive, in the sense that it remembers basically everything, even which pages were open in which menus, so the player can pick back up right where they left off.

It’s also dynamic; it will automatically adapt to any new content I add, and is intended to be maximally compatible with future versions. I’m planning ahead for playtesting, Early Access, and DLC, and doing all I can to save people the annoyance of having to start over after every major update.

The save data itself is currently stored in an easily-editable format, making it simpler to set up specific circumstances for playtesting and probing edge cases.

There are no screenshots to show off here, as visually the only difference is a popup message saying the game has quicksaved or quickloaded.

In future, the game will also autosave every time the player sleeps (specifically, when they wake up). This is simple enough to do, but I don’t plan to implement it just yet.

Full disclaimer: I did have a working save system about a year ago, but it was extremely basic and quickly became outdated as the project grew. It was mostly a proof of concept in the very early stages of development. I thought it would be best to wait until all of the game’s core mechanics had been implemented before coming up with a save system that could handle all of them.

The next big step is to add the manual saves as well, and the save/load menu. Currently, the player can load with the keyboard shortcut, but not access a list of different save files. There’s a few quality-of-life features I want to include here that I’ll run through when they’re done.

After a code-intensive month, it’s likely I’ll go back to making the game look a bit prettier before returning to the save/load mechanics.

« Last Edit: October 03, 2024, 10:39:55 AM by DrBPW »
Logged

DrBPW


I recently expanded upon the game’s notification mechanic (pictured below).

Notifications appear in the bottom-left corner of the screen and provide a passive confirmation/reminder of what is happening. They let the player know, among other things:

  • What item(s) they picked up, crafted, dropped, ate, or ‘consumed’ (used in a crafting recipe).
  • When their inventory is full.
  • When they learn to craft a new item.
  • When they’ve levelled up a skill.
  • Why they cannot craft a recipe (or why a crafting attempt failed).
  • When they’re out of stamina.
  • When their tools break.
  • When they don’t have a specific tool they need to do something (e.g. if they try to chop down a tree without owning an axe).
  • When they have successfully saved or loaded their game.

I previously had a simple text-only system that I always planned to upgrade.

Notifications are now accompanied by a sprite (such as the texture of the item they have just picked up, or a save symbol).

Some are also accompanied by a specific sound effect, such as the level-up SFX or the error SFX.

Notifications are also colour-coded:

  • Neutral ‘information’ messages, such as saving or loading, are black.
  • Positive messages, like gaining or crafting items, are green.
  • Negative messages, like breaking a tool or failing to craft an item, are red.
  • Special events, like levelling up a skill or learning to craft a new item, are blue.

Sorry if these updates seem a bit all over the place – there are lots of elements to this project and hopping from one thing to another keeps me interested and the progress flowing! I’ve got lots more to talk about, but work on the game comes first  Grin


Logged

DrBPW


Yeah, one of my big goals for this project is essentially creating my own ‘crafting game maker’ that will allow me to just add as much new content as I like: items, tools, recipes, biomes, etc. Everything is set up to be dynamic and automatic, so  I can expand as much as I want and the code will know what to do.  There’s still more work to do, but I’m close to that magical moment where I can just focus on adding content and expanding the world. It also gives me the power to one day overhaul the whole thing with different biomes, graphics, items, etc., essentially remaking a different style of crafting game without needing to recode any core mechanics. This ‘game maker’ may even be a marketable piece of software in itself… maybe.

I can definitely see the appeal of doing it your way too though. I’m investing a lot of time and effort now to make things easier later, but it means waiting a long time to even get the first area of the game ‘done’.

Anyway, I’m so glad you find it interesting  Smiley


Logged

DrBPW


The game’s inventory system has been practically finished for a while now. There are a few mechanics, including several quality of life features, that I’m quite happy with, so here’s a quick rundown.

The player has 10 hotbar slots, shown at the bottom of the screen. The active slot is highlighted by a border. Clicking the LMB or RMB will trigger the primary or secondary action of the item in the active slot (if any), such as using an axe to chop a tree, eating a consumable, or emptying a bucket. A slot can be set as the active slot by clicking it, pressing its associated number key (1-0), or scrolling the mouse wheel to cycle up or down through the hotbar slots.

In addition to these, the player also has up to 30 backpack slots, which can be accessed by opening the main inventory screen.

The player can click and hold to drag the contents of one slot to another, allowing them to merge 2 stacks of the same item, swap the contents of 2 slots, or drop an item by releasing it outside the inventory area. When the player drops an item, it will automatically merge with any other nearby stacks of the same item.

There is also an auto-sort mechanic that merges all items in the inventory into the fewest possible stacks, then groups them by category (e.g, all tools together, all metal parts, etc.). This can be done separately for either the hotbar or the backpack, allowing the player to, for instance, keep their hotbar how they like it but sort everything in their backpack by type.

The player can also use the ‘Add to stacks’ and ‘Take from stacks’ buttons to instantly transfer all items from the hotbar to any matching stacks in the backpack, or vice versa.

Various hotkeys can be used to quickly perform common actions, including:

  • Open and close the inventory,
  • Drop 1 item from a slot,
  • Drop all items from a slot,
  • Transfer 1 item from a hotbar slot to a backpack slot, or vice versa,
  • Transfer all items from a hotbar slot to a backpack slot, or vice versa,
  • Sort the inventory

There are 2 factors limiting inventory capacity. The first is the number of backpack slots the player has access to. Additional slots can be unlocked by crafting and wearing bigger, more durable backpacks.

The second is the player’s current maximum carry weight. All items have weight, and carrying more than your maximum encumbrance slows you down, first by disabling the run mechanic, then by decreasing walk speed, until the character can no longer move at all. Max carry weight is proportionate to the character’s strength, which can be increased in a number of different ways.


Logged



Source link

Leave a Comment