Let's Get Crafty! | BYOND Game Development #3

Missed the rest of the series? Catch up here:
Part 1 - Part 2

You can actually DO something in my game now!

Goals, goals, goals. Every game needs goals, right? Either goals that are built into the structure of the game itself (something like the main quest), or systems by which a player can create their own goals.

I've personally always preferred the latter. I love playing sandbox games like Minecraft, Skyrim, and Grand Theft Auto where there's no reason to confine yourself to the goals laid out in your quest log. I enjoy a game that gives the player the ultimate freedom to decide how the game unfolds.

In the last part of this series, I showed off the fact that a player could aimlessly walk around the map collecting as many sticks and tufts of plant fiber as they could possibly find, but that's about all you could do. While there could technically be a goal built around that, it would get very boring very fast. That's why I knew the very next thing I needed to work on was a way to turn all the "junk" you can collect into something useful and give the player a sense of progression. In other words, I needed a crafting system!

invandcrafting.png


Intricate Interface

I want to take a second to applaud myself for the interface (the windows that hold/display data) I've got so far. Building interfaces with BYOND has certainly been made much easier in recent years, but it's never been my forte, and I've always pieced together clunky, raggedy-looking, barely functional ways of displaying a player's stats and inventory.

Without using the recent interface editor (which really only lets me lay out windows to control with code), making a choice like what to craft would look something like this with a simple "input()" command...

basicinterface.png

Nope. Nope. Nope. I might be an amateur, but I'm better than that!

Using the pretty interface controls require WAY more code, but at the end of the day, the player's experience is much more important than the amount of time I have to spend building things the way they should be.


Now about that crafting system...

Sticking to the KISS rule, I'm using a system that will work for many different types of crafting, setting up "instructions" for specific crafts to be passed through a procedure that checks whether the player has the materials, tools, and/or crafting level required.

It would go without saying that inventing a single tool you can repurpose for a multitude of different tasks is much more efficient than inventing a new tool for every job.

instructioncode.png

What you see above is an "instruction" entity that I can use to store all the information about a given craft. These entities lie dormant until the player tries to craft something, at which time a temporary instance of the entity is created in order to reference the information within.

These instructions work just as well for holding information about gathering skills like botany or mining as well. Instead of a list of required materials and the product one is crafting, I can list the required skill level to harvest from something, what tool would be required, and the product of harvesting.

Work smarter, not harder.

In order to craft a length of Rope, the player will need 3x Plant Fiber and must be at least level 1 in their Crafting skill, but they won't need any tools. Skills aren't implemented yet, but it will be next so I needed to think a couple of moves ahead when coding the crafting to include a check for skill level.

When the player clicks a button within one of the crafting windows, it is passed through one of these procedures depending on what exactly needs to be checked. Some crafts don't require a tool, and using an axe to cut down a tree for logs would only require a tool and no materials, so certain checks in those cases would bounce back with an error if I ran a check on an empty list.

createcode.png

The create() procedures here call up each of the checks required (like the material check below) and if they're all successful, runs a command to actually give the crafted/harvested item to the player.

This is one of the checks called up to ensure you have the right materials for what you're trying to craft:

checkmaterialcode.png


Keeping everything organized

I could have simply lumped ALL the crafts into a single menu and added labels on crafts that required a certain tool, but instead opted to create a much more user-friendly system.


craftinggif.gif

For anything that can be crafted by hand, the player can easily access the basic crafting menu by pressing the 'C' key. This window separates crafts by item type and there are multiple tabs to help organize everything.

In order to access the menu for crafts requiring a certain tool, the player will need to click that tool while it's inside their inventory. Clicking the Crude Knife or Crude Chisel one can craft with a branch, rope, and sharp rock will open the carving or chiseling window respectively.

carvewindow.png

chiselwindow.png


Creating opportunities, not obligations.

In order to craft the Crude Axe and Pickaxe, the player will need to use all of these menus. They can craft the tools themselves by hand but will need to carve a proper Tool Handle from a branch and use the chisel to create heads for each tool out of rocks.

This gives the player a sense that there are levels to progress through. You must create this before you can create that. Goals, but without the game saying "go do this".

So now I have a game where one can collect grass, sticks, and rocks to create rudimentary tools. A player could potentially set a few simple goals but there's no real challenge yet...

I definitely intend to set up trade skills next like mining and woodworking next so the player has something to do with the tools they can now craft. After that, I think I might plop the first wild animals into the world. This will require me to flesh out the character stats like health, and a battle system to hunt the animals. Then we might actually have a real challenge, and the potential of death...


Thanks for reading!

I hope you're enjoying the series as much as I'm enjoying creating this game. If you want to know more about a particular part of the development or just want to share your opinion, leave a comment below!

Ad:
1607931559_lnq5YxO1.webp

followsweeney2021 (1).gif

sirsweeneysolutionsbanner (1).png

Sort:  

Every game definitely needs goals! 😄 Look forward to the next update.

Hi thatsweeneyguy,

This post has been upvoted by the Curie community curation project and associated vote trail as exceptional content (human curated and reviewed). Have a great day :)

Visit curiehive.com or join the Curie Discord community to learn more.

Yay! 🤗
Your content has been boosted with Ecency Points
Use Ecency daily to boost your growth on platform!

Support Ecency
Vote for Proposal
Delegate HP and earn more, by @kunschj.

Nice progress!

!PIZZA

Connect

Trade


$PIZZA@thatsweeneyguy! I sent you a slice of on behalf of @enjar.

Learn more about $PIZZA Token at hive.pizza (1/20)