# A Breath Away

## Overview
The title comes from the dystopian existence of the "in-present" character in a cyberpunk dystopia. (S)he finds a portable game console (think: GBC) that contains one game: A Breath Away. It's both the title of the in-game handheld, and the idea that this game is the only respite the player's character could get.

## Features
* Random worldgen - want ABA world to feel big
    * Pre-built areas/interactions for crapsack world
* No husbandry - sorry, no horses/chickens/cattle/single cat
* Can grow plants from seeds
* Can harvest plants, get food/seeds
* Can kill/cook wild animals - this is a harsh reality in-game-game too
* Can kill/cook monsters - maybe with a random % of adverse effect?

## Resources
* Wood
* Plant fiber
    * is tough
* Sap
    * is sticky
    * is flammable
* Seeds
    * can attract birds
    * can grow shit

## Craft Items
* Metal (ingot?)
    * Metal Ore
* Axe
    * Wood
    * Metal
* Hoe
    * Wood
    * Metal
* Workbench
    * Wood
* Furnace
* Sword
    * Leather
    * Metal
* Bow
    * Wood
    * ???
* Rope?
    * Plant fiber
* Shield
    * Leather
    * Metal

## Entities
Pile of wood
Metal ingot
Player
Bunny
Wolf
Chicken


## Tile types
All ground tile types have a (very small) chance of containing a randomly chosen [thing (treasure/curse?)] when naturally occurring. Said "thing" is exposed when tilling the dirt or cutting the grass.

* Dirt - base type
* Tilled dirt - tilling exposes the potential item
* Tilled watered dirt
* Tilled, seed planted
* Tilled, sprout
* Tilled, mid-size
* Tilled, full-size
* Grass - Smooth (mowed)
* Grass - Rough (wild)
* Tree
* Rock
* Ore
* Wood log
* Wood plank?
* Stone

## ABA Player
Health - starts at 3 hearts (6 health)
FoodLevel - max of 20
FoodSaturation - max of FoodLevel, starts at FoodLevel
FoodTickTimer - cycles of 80, at cycle health is +/- depending on saturation/starvation
FoodExhaustionLevel - added to depending on action, when reaches 60 it resets and deducts one point from FoodSaturation
Tiredness - Starts at 0 when starting or waking

### Exhaustion
The following actions generate exhaustion points for the player:

* Swing sword - 3
* Hoe a tile - 1
* Harvest - 1
* Mine a block - 5
* Chop a tree - 4

## IRL Player (Reverse Tamagotchi)
Treat the game like a reverse tamagotchi. The "player" in the game is the "virtual pet" that must have its basic food/bio/sensory stimulation/? needs met, or the game is "lost" (player is dead).

When the player is in the real world, they can receive emails on the computer (maybe in-game).

Maybe IRL they have to scrounge for food? Maybe it's hard to do and they have no combat, so it's fraught with danger. In this way, endless play can be gated through difficulty.

FoodLevel - max of 10
FoodTickTimer - cycles of 80
BioLevel - max of 10
BioTickTimer - increments by FoodLevel/5 (moves faster when full), cycles at 80 - if BioLevel is already at 10, increment BioOverflow
BioOverflow - at max of 5, player gets stick (Game is exited, FoodLevel is set to 1, FoodTickTimer is reset, SicknessLevel is incremented)
SicknessLevel - max of 20

Eating rotten food - FoodLevel increase half non-rotten amount, SicknessLevel incremented
Eating normal food - FoodLevel increases by food value

### Stats
These numbers will likely change based on mechanics:

* Health: Starts at 100
* Hunger: Baseline is 0, counts up 1 per game tick
    * 50% of starvation max: minor ui notification
    * 75% of max: warning notification
    * 90%: start thinking occasionally about starvation
    * 100%: regular starvation thoughts; starts dying
        * every 5000 ticks, lose a health
* Waste: Starts at 0, counts up 1 per game tick

#### Replenishment
Eating reduces Hunger by 50,000 to min of 0. sub-standard sources can give less. Eating also increases health proportionately.

Waste is reduced by going to the bathroom. Unfortunately, the game can't be used in there.


## Scoring
* Days survived
* Days survived comfortably (no starvation)
* Days survived IRL

## Implementation
* Pico-8 palette in-game, either DB16 or Sweetie16 rest of the time
    - `0000001D2B537E2553008751AB52365F574FC2C3C7FFF1E8FF004DFFA300FFEC2700E43629ADFF83769CFF77A8FFCCAA`
* DB16 palette otherwise
    - `140c1c44243430346d4e4a4e854c30346524d04648757161597dced27d2c8595a16daa2cd2aa996dc2cadad45edeeed6`
* pmem can only contain 256x32b (8192b) - no world saving :(


## Game Balance
- Metrics:
    - Sanity
    - Hunger
    - Thirst


## Media
![wip-01](wip-01.png)

## Lets write a plot
Player should be able to "skip intro" which will take them straight into gameplay and not prompt for hunger, thirst, etc.

### Prologue
The first rays of the morning sun filter through the narrow alleyway, rousing you from your restless slumber on a tattered cardboard mat. As you sit up, your back aches from the unforgiving concrete, a constant reminder of the squalor you've been forced to endure. Rotting piles of garbage, the stench of urine, and the ever-present hum of the city's machines are your constant companions.

As happens most mornings, you begin to reflect on the circumstances that brought you here. You were once a respected professor at the city's prestigious university, imparting knowledge and shaping young minds. Being a proper servant of society, you wanted for almost nothing; your food coming out of the very walls of any room you were in.

It sure doesn't work like that for everybody else, though. The ruling party changed hands and suddenly "teaching history" is out of favor. Your position was deemed "non-essential," and you found yourself cast out into the streets, another casualty of politics and wealth.

Your bed is now cardboard - dry if you're lucky - your walls the grimy brick of abandoned buildings. The stench of decay and human misery permeates every breath, a constant reminder of the harsh reality of the "non-essential."

### Chapter 1
Your stomach rumbles, a hollow, aching reminder of the harsh reality you now face.

> Your hunger levels are running low. If left unchecked, this will start to deplete your health. Better start scavenging for any scraps of food you can find before starvation sets in.

Player gets some nasty food:
> Welcome to the high life! Your new diet consists of whatever scraps and moldy morsels you can scrounge up from the city's overflowing dumpsters. Bon appétit!

Player walks around some more:
> Staying hydrated is a must, but good luck finding a clean source of water. That puddle in the alleyway might have to suffice, unless you're feeling adventurous enough to sample the contents of those rusty pipes.

Player gets beat down:
Your will to live is slipping away. Without an outlet, you risk losing your grip on existence entirely. What's the point of going on? 

Player finds ABA game:
> Incredibly, you've found something to briefly take your mind off your constant struggle to survive. Finally, something to live for!

After playing a round of ABA:
> In this hellish existence, the only thing keeping you tethered to reality is this game. It's a good thing the battery on this thing will probably outlast you, because it's now the only thing keeping you from joining the compost pile.

Sanity restored a bit, search for food:
> Just when you think you might finally have a glimmer of hope in your bleak existence, a sharp pain lances through your foot as you step on a jagged piece of metal.
> 
> You've sustained an injury that is now draining your health. While getting hurt is unavoidable in these streets, infections and blood loss can prove deadly if not tended to quickly...

Player tends to their wound:
> You've treated your wound, but the experience itself is harrowing. It's taking a toll on your mental state, and you're not sure how much more of this you can take.
> 
> You could ignore the injury for your sanity's sake, but the toll it takes on your bodily health can't be ignored.

The player's best bet is to try to balance periods of regaining sanity against regaining health in various ways. Sometimes those will be mutually exclusive.

It's sounding like more and more that sanity will be the limiting factory for the game. In order to manage sanity, negative life aspects need to be minimized while game-related aspects need to upgrade quickly. To wit:
- the longer you survive (through gameplay), the greater chance of finding things that allow longer gameplay
- in game-game gets harder over time, requiring more attention
- eventually, a failed run could be an existing savegame on the device
- glitch mechanics? some way to upgrade game, but higher risk
- some sort of amiibo-style system that allows things to be found and upgrade in various ways (appearance or mechanics), but risk is super-high for player
- some sort of high-risk/high-reward upgrade (RAM?) that enables gameplay modification - maybe cheats