The Hunger/Thirst System in DESERT OF ASH: a Post-Apocalyptic Gay Sex Simulator


This devlog focuses on technical aspects of the Ren’Py game DESERT OF ASH: a Post-Apocalyptic Gay Sex Simulator. As you might expect, the game is NSFW. However, I have kept this devlog SFW so it is accessible to anyone who might find it helpful. Just be careful of clicking away to the game’s main page. Also, as DESERT OF ASH is yet unreleased, everything here is subject to change.

As a writer, I came to DESERT OF ASH: a Post-Apocalyptic Gay Sex Simulator with a narrative-forward attitude. But I am also, by necessity, handling all technical aspects of the game as well. This hasn’t been too challenging overall, as Ren’Py makes most things quite straightforward. However, DOA does have three unique gameplay elements that needed a lot of extra work to implement, and those are its hunger/thirst, inventory, and trading systems. In this devlog, I’ll be going over how I created my hunger/thirst system, with separate devlogs on the related inventory and trading systems coming later.

While I relied on a variety of different tutorials and tips on reddit, Lemma Soft, and elsewhere, no single tutorial did exactly what I needed, and I had to cobble a lot of different aspects together myself. Therefore, I thought it would be useful to document the way I did that, to show how everything came together. I am by no means an expert programmer, and this is surely messy and non-optimal.

Feel free to use or alter any of this code for your own projects; however, any actual content contained herein, including images and substantive text such as item descriptions, cannot be used.

If you want to see how these systems play before diving into the code, go ahead and download the demo for DESERT OF ASH.


The hunger/thirst system is the simplest of these three connected systems, but it is the driving force for the inventory and trading systems. In DESERT OF ASH, if you don’t keep your hunger and thirst down, you will die and get a game over, so carefully managing your inventory and trading with other characters to get necessary items are vital.

First, hunger and thirst themselves are variables. They need default values to begin with, which I’ve defined in my script along with the rest of my variables.

default hunger = 100
default thirst = 80

Because I want to emphasize the danger of starving to death or dying of thirst, I’ve made these numbers quite high to start, but you should make the values in your game whatever you deem appropriate.

Players will manage these values by using inventory items. I will go into much more detail on the inventory system in the second devlog in this series, but for now, just note that using an item will reduce hunger and/or thirst by a certain amount. In DESERT OF ASH, players have opportunities to use their inventory at set points in the story, and cannot simply browse it whenever they’d like. After each of these instances, if they’ve failed to reduce their hunger and thirst, they are shifted onto the path towards a game over.

    if hunger == 100:
        jump gameover
    if thirst == 100:
        jump gameover

Hunger and thirst values are also not always visible, and are only changed internally just before the player is allowed to check their inventory. I increase hunger and thirst at every one of these intervals.

    if hunger >= 80:
        $ hunger = 100
    else:
        $ hunger += 25
    if thirst >= 80:
        $ thirst = 100
    else:
        $ thirst += 25

It will be up to you to determine how much to increase these values and when in your own projects. In DESERT OF ASH, they both go up by 25 every in-game day, unless the player is close to 100 in either value, then it will be changed to 100 rather than being allowed to go over.

So, how do players know what these values are? Through the hunger and thirst gauges!


These gauges are visible every time the inventory or trading screens are open. When the player consumes a food item, they can see the gauge change in real time. When trading, they can see the gauges as a reference for what kind of items they need to prioritize. However, nowhere do I reveal the actual numerical values of each variable. This is to create a sense of uncertainty, to reflect a real-life experience of hunger management. The average person would describe themselves as “really hungry” or “not very thirsty,” and that’s the kind of language I want the player thinking in as well. If you have different goals, you may wish to make these numbers explicit somehow.

(Internally, these values are a little confusing. As the hunger value increases, the gauge seems to deplete. When they eat, reducing their hunger, the gauge fills. This is what I determined would be most intuitive for the player, especially since they’re not seeing the actual numbers. Feel free to do things differently in your own project.)

    vbox:
        xpos 67 ypos 170
        bar value AnimatedValue(hunger, range=100.0):
            xmaximum 398
            ymaximum 55
            left_bar Frame("gauge_empty.png", 10, 0)
            right_bar Frame("hunger_full_flip.png", 10, 0)
            thumb None
    add "gui/hunger_label.png" xpos 200 ypos 230
    vbox:
        xpos 67 ypos 285
        bar value AnimatedValue(thirst, range=100.0):
            xmaximum 398
            ymaximum 55
            left_bar Frame("gauge_empty.png", 10, 0)
            right_bar Frame("thirst_full_flip.png", 10, 0)
            thumb None
    add "gui/thirst_label.png" xpos 200 ypos 350

As for the gauges themselves, they’re made using Ren’Py’s functionality for bars, which can be found in many other places, such as this tutorial here. Follow that, and you’ll be good to go.

Like I said up top, the hunger/thirst system is the simplest of my three interconnected systems in DESERT OF ASH. Next time we’ll be covering the inventory system, which will include how to program items that the player can consume to alter their hunger and thirst values. Stay tuned!

Get DESERT OF ASH: a Post-Apocalyptic Gay Sex Simulator

Leave a comment

Log in with itch.io to leave a comment.