Breezy Meadows Apiary

(July 2024) GPL-3.0-or-later Daniel Woodworth

Breezy Meadows Apiary is a simple farming game. It follows Lily, a novice farmer and beekeeper, who inherits her parents' old farm, the titular Breezy Meadows Apiary. After so many years, all that's left of it is one struggling beehive, a handful of dull gray flowers, and lots of overgrown grass. With hard work, the right strategy, and a little patience, Lily can not only rebuild the farm but also once again make its flowers and honey the talk of the region. The key is to cultivate better bees by cultivating better flowers, and to cultivate better flowers by cultivating better bees. As her parents were fond of saying:

Happy bees make happy flowers. Happy flowers make happy bees.

I developed this game for submission in the Free-Software Purism Game Jam, following its theme of “symbiotic.“ It turns out I don't really have enough free time in a month to build a whole game, though, so even though I had barely managed to finish implementing the game mechanics by the submission deadline I wasn't able to get everything packaged and submitted in time. I still think it's an interesting concept, so there's no reason I can't still keep working on it and seeing what I can do with it even though it didn't make it into the Jam.

Controls

This game features both touch and mouse/keyboard controls. The touch controls appear on screen the first time a touch event is detected, and include a movement pad to the bottom-left and a couple buttons to the bottom-right. The mouse/keyboard controls are shown in Table 1:

ControlAction
WASD/ArrowsWalk
<Shift>Run
MouseTurn
Left ClickUse current tool
F/<F11>Toggle fullscreen
Table 1: The game's mouse/keyboard controls

Unfortunately, there seem to be some serious bugs in Emscripten and/or SDL's touch event support that prevent the touch controls from working at all on the web version. I'm still trying to track down the cause of this.

There are also some issues with fullscreen in the web browser version: the keys for entering fullscreen mode only change the logical size of the game until you also click on the game too, which is a limitation of Emscripten's workaround for browser security policies. Going into fullscreen by clicking the button in-game isn't affected by this, though. Also, sometimes the game is only able to draw to part of the screen in fullscreen mode apparently because some of the canvas resizing magic Emscripten does is going wrong; I'm not sure how to fix this yet either.

Tools

Lily has a few standard farming tools at her disposal, which she can pick up by walking into the tool shed. They are listed in Table 2:

ToolFunction
Watering CanWatering flowers; periodically needs to be re-filled from the pond
ShovelTransplanting flowers
HoeTilling soil with grass on it so flowers can be planted
SmokerInteracting with beehives
Table 2: Tools available in the tool shed

Flowers

The flowers in this game are not perennials or even annuals, they're “diemials.” They complete their entire life cycle, from sprouting to blooming to going to seed, all over the span of a day. They can only bloom when they have enough water from being planted in wet soil, so it's crucial to water them every day. They also can only go to seed and produce offspring for the next day if they're pollinated by bees, so it's also crucial to plant them within range of a beehive.

Genetically, the flowers are diploid and have three key genes, c, m, and y, which control the amount of cyan, magenta, and yellow pigmentation respectively. Each gene has two possible alleles (represented by capitalization) with incomplete dominance, so a heterozygous pair will show pigmentation between that of the two homozygous genotypes. Table 3 gives an example of this for one gene:

GenotypePhenotype
mmNo magenta pigmentation
MmHalf magenta pigmentation
MMFull magenta pigmentation
Table 3: An example of incomplete dominance in flower pigmentation

Table 4 gives some more examples of how this translates into flower colors:

GenotypePhenotype
ccmmyyWhite (#ffffff)
ccMMyyMagenta (#ff00ff)
CcMmyyLight Blue (#8080ff)
CcMmYyGray (#808080)
ccMMYYRed (#ff0000)
CCMMYYBlack (#000000)
Table 4: Some examples of how flower genetics maps to colors

When a flower is budding or blooming, its genetics will be displayed if Lily is facing it or if Lily is holding it after digging it up with the shovel.

Overnight, between sunset at 7:00 pm and sunrise at 5:00 am the next day, flowers within range of a beehive will go to seed and produce offspring which appear as sprouts in the morning. A pollinated flower will always produce at least one offspring plant; the number of additional offspring produced is random and the cap increases logarithmically with the level of the bees pollinating the flower. The bees don't like flying long distances between flowers if they don't have to, so each flower only has access to the pollen of the flowers nearest to it and for each offspring plant it will mate with a random flower at that nearest distance.

Bees

Bees live in beehives, and can only pollinate flowers within a certain radius of the hive. The area they can pollinate is highlighted when Lily looks at a hive. As bees pollinate blooming flowers, they gain experience points. These are shown in a meter to the right of the hive, and when the meter is full and starts flashing the bees are ready to level up. Lily can level them up using the smoker. As the bees' level increases, they get more effective at pollinating flowers so each flower within range of the hive will produce more offspring.

Starting at Level 3, Lily can also use the smoker to split the colony and place a new hive. Half of the original hive's level goes to this new hive so this will reduce the hive's level, but placing a new hive expands the area where flowers can be pollinated.

Technical Details

This game is implemented in Rust using SDL, which should make it easily portable. It even runs on the web, though this is slightly buggier than on other platforms due to Emscripten issues.

It uses a toroidal hexagonal grid, so if you walk far enough you'll loop back around, but you have to walk really far. Everything is represented in fixed point, so there's a coarse 16-bit hexagonal grid to represent integral hexagonal tiles and a fine 32-bit hexagonal grid to represent fractional positions that aren't aligned with the tiles. This is all a little unusual, but I thought it would be interesting to explore for this game and it ends up working well for it.

The sprites are hand-drawn by me in GIMP. They might be a little rough in some places since this is my first time doing pixel art.

Licensing

The code for this game is licensed under the GNU General Public License (GPL) version 3 or any later version. Art assets are licensed under the Creative Commons Attribution-ShareAlike 4.0 International Public License. This game uses the Pixeloid font designed by GGBotNet under the terms of the SIL Open Font License version 1.1.

Building and Running

Code for this project is hosted on Codeberg and also available on this site here. To build it, you'll need to install Rust and Cargo, and also install the libraries and headers for SDL2, SDL2_image, and SDL2_ttf. The Debian packages for the SDL libraries are libsdl2-dev, libsdl2-image-dev, and libsdl2-ttf-dev. When all of those are set up, you can just clone this repository and compile/run it via cargo as shown in Listing 1:

git clone https://codeberg.org/dascwo/breezy-meadows-apiary.git
cd breezy-meadows-apiary
cargo run -r
Listing 1: Commands to compile natively with Cargo

I've also built some (hopefully) portable Linux binaries for aarch64 and x86_64, plus a web build that almost mostly works via Emscripten that's featured at the top of this page. More details about how these are built are in the source at the end of README.md.