Categories
Game Design Game Development Geek / Technical

Freshly Squeezed Video Progress Report: Grabbing the Flashlight from Under the Bed

Here’s the companion video for Monday’s Freshly Squeezed Progress Report: Grabbing the Flashlight from Under the Bed:

Enjoy! And let me know what you think by replying below!

Categories
Game Design Game Development Geek / Technical

Freshly Squeezed Progress Report: Grabbing the Flashlight from Under the Bed

In my last report from three weeks ago, I created inventory slots visible on the screen for the player’s party and created furniture with its own inventory for The Dungeon Under My House, my second Freshly Squeezed Entertainment project.

Since then, I have not been terribly productive. Between preparing for my tax appointment, grieving over my cat Gizmo passing away, producing updated versions of my leaf-raking business game Toytles: Leaf Raking for the Spring Sale, dealing with a minor cold, and participating in various family outings and obligations, forward motion on this project took a pause.

But I am slowly getting back into the game dev habit.

Sprints 2024-8 and 2024-9: Intro sequence game play

Planned and complete:

  • Allow player to search objects in room

Unplanned and incomplete:

  • Flashlight automatically lights up dark dungeon

As I predicted, viewing the furniture’s inventory was straightforward, but interacting with it took some effort.

I did some fun math to dynamically create the grid for a furniture’s inventory. The bed has 4 inventory slots, and other furniture might have a different number. The more slots available, the smaller they can be, but with fewer slots, the slots themselves can take up more real estate on the screen.

The Dungeon Under My House - furniture inventory view

I liked the way it becomes obvious that it is the focus of the current screen’s interaction.

As for actually interacting with the furniture’s inventory slots, what I decided to do was allow the player to select two different inventory slots to swap them.

This decision nicely solves the problem of what to do when a character’s inventory is full, as the act of dropping something to make room for it becomes a natural part of the interaction.

At least, it does for individual items such as a Flashlight. I haven’t addressed what should happen if the item has a quantity, but that’s for Future Me to worry about.

Also, Future Me, when you read this, don’t forget that we’ll need to figure out how the player should interact with the party’s inventory when not actively viewing furniture inventory. Thanks, you’re the best!

The Dungeon Under My House - furniture inventory interaction

The Dungeon Under My House - furniture inventory interaction

Once I had the ability to acquire items from furniture, another key part of the intro game play was completed: the party can get a Flashlight to illuminate the darkest parts of the newly discovered dungeon.

An obvious game play thing to do is to allow the player to interact with the item, and in this case, toggle the flashlight on and off at will. Then I can introduce the need to conserve the flashlight’s batteries and provide a means of replenishment of those batteries, either by recharging or replacement.

But while those mechanics sound kind of neat, and maybe in a different game they would be interesting to play with, in this game? I think requiring the player to manually turn the flashlight on and off would be tedious.

Instead, I’d like the flashlight to turn on and off based on the current light conditions. So if the player is entering an area that is getting darker, then the portable light source turns on automatically, and once the player enters an area with getting brighter, the portable light source turns off automatically.

And to avoid the tedium of having the light flicker on and off when crossing over a single light boundary, I think it would make sense to have two different thresholds. So the light turns on when entering a dungeon cell that is starting to become quite dark, but if you immediately leave that cell, the light doesn’t turn back off right away. You have to enter into a slightly brighter area before that light turns off.

But I’ll playtest it to see if it feels weird.

And naturally, the biggest concern is that if the flashlight is on, then the player should be able to advance into the darkest areas of the dungeon because they won’t be dark anymore. Which means rendering the dungeon by incorporating this temporary light level.

While the regular light levels spread out to adjacent cells, I think the effect of the flashlight on the light levels of the dungeon grid cells should mimic what a flashlight does. It will be a directional light, so the only cells affected are directly in front of the party.

Of course, what happens when the player turns to the left or right? I am sure I can mimic the arc of light that would occur naturally, but it might be a bit tricky.

But by the end of the week, most of this work was only on paper, so expect to see how I actually implemented it in my next sprint report.

Thanks for reading!

Want to learn when I release The Dungeon Under My House, or about future Freshly Squeezed games I am creating? Sign up for the GBGames Curiosities newsletter, and download the full color Player’s Guides to my existing and future games for free!

Categories
Games Marketing/Business

GBGames Turns 18! Let’s Have a Sale to Celebrate!

In 2006, I formed GBGames, LLC.

Next week will be the 18th anniversary. That’s a long time!

To celebrate, I will be doing something that I have never done before: I’m having a sale!

I know it is spring, but you miss the colorful leaves of the fall, right? Well, here’s your chance to relive that wonderful season at a very rare discount.

From now until the 22nd, Toytles: Leaf Raking will be 50% off the regular sale price.

Get my leaf-raking business simulation game, Toytles: Leaf Raking for Windows, Mac, and Linux today!

Toytles: Leaf Raking

During the 90 days before winter, you’ll:

  • Seek out neighbors who need your services and turn them into paying clients.
  • Make key purchasing decisions, such as which types of rakes to buy and how many yard bags to keep in your inventory.
  • Balance your energy and your time as you seek to keep your clients happy without overextending yourself.
  • Visit the kitchen to ask your parents for their advice and wisdom.
  • Learn about personal responsibility and the importance of keeping your promises.

Toytles: Leaf Raking weather forecast

Toytles: Leaf Raking - gaining a new client

Toytles: Leaf Raking - buying supplies at the general store

Toytles: Leaf Raking - client's yard view

NO ADS, NO IN-APP PURCHASES, AND NO VIOLENCE

Have peace of mind with an ad-free, safe game that may inspire your own entrepreneur.

Want to learn more about Toytles: Leaf Raking? Go to https://www.gbgames.com/toytles-leaf-raking/.

Available for Android, iPhone/iPad, Windows, Mac, and Linux

Get your copy of Toytles: Leaf Raking today, and see if you have what it takes to run your own leaf raking business!

Categories
General

A Goodbye to Gizmo, My Hacker Cat

On Friday, my family and I said goodbye to our cat Gizmo. She was about 21 years old, and she was in my life for 18 of them.

Gizmo

Her brother Diego died in 2018, and I thought she would follow close behind him. For years I have been preparing myself for this day, trying not to take her presence for granted.

It still hits hard.

Despite eventually learning that Diego was the greeter, I knew Gizmo was always the brave one. When I first met the cats, she was the one who came out of the carrier first. And each time I’ve moved, she was the first one out to explore the new home.

And I recall my first time meeting Gizmo. My friends let out their own cats to meet them, and Gizmo promptly lay down and, without directly looking at their big cat, growled an amazing growl.

She was the chillest, most calm cat. She never bit anyone, and yet when she did have a rare growl, it was a good growl.

Gizmo doing her "I'm Batman" impression

The only time she ever came close to biting was after I had been away for a long trip. Upon my return, she meowed and licked my fingers, periodically nibbling at them. I took it to mean that she missed me and was upset that I was gone for so long.

Gizmo seemed to enjoy car rides. She always liked to see what was going on outside the windows. On her first drive, I remember her sitting in the console, looking out the front window before eventually finding her way to the side windows, with her paws up while she watched the world go by.

She was mostly quiet and kept to herself, especially around strangers, but when she wanted to cuddle, it would not matter what you were doing. She would let you know, and she would get in your lap, or on your chest, or in your arms.

Or at least with me. My wife says that it took three years before Gizmo would sit on her lap.

And even then, if I showed up on the couch, often Gizmo would make her way to cuddle with me.

Often when I was at my desk, she would jump up and get into my lap, and sometimes she would sit facing the computer as if she was the one at the keyboard. So I called her my hacker cat.

Gizmo the hacker cat

Gizmo the hacker cat

Gizmo the hacker cat

Gizmo and Diego were adorable together, especially when they slept. And often they would sleep draped across me.

Gizmo & Diego

Gizmo & Diego

Gizmo & Diego

Gizmo & Diego

Right before her brother passed away, we learned Gizmo had high blood glucose levels, and after changing her diet, she bounced back.

And that was the theme for her health woes for the next handful of years: she would be relatively fine, then one day she would seem to get terribly sick or otherwise seem to be in a poor quality of life, then we’d think, “This must be the end,” and then she’d bounce back, albeit sometimes at a lower baseline than before.

When the COVID-19 pandemic hit, and I started working from home regularly for the day job, Gizmo became a minor celebrity on my team calls. People would sometimes greet her before they greeted me, in fact. B-)

Gizmo getting involved in my team meetings

Our routine was that I would get her breakfast, clean her litter boxes, then get to work in my office, and she would join me on the chair next to me, sleeping there or cuddling on my lap.

Gizmo my on-site remote coworker

If I took too long of a break, she would let me know to get back to the office.

But sometimes she would be an enabler and take breaks with me.

Gizmo taking a break with me

Over the last few years, I’ve seen her health decline very slowly. She had a lump on the back of her neck, and it grew to be pretty big, and it turned out it was a slow-growing cancer. The vet removed the lump but they said they couldn’t get everything, and so we had no idea how long we had with her.

Each time her behavior changed in a way that made me worried, I was at the vet with her. They always said she was incredibly healthy for her age.

But Gizmo started slowing down. I used to worry about her jumping up and eating my plant by the window, but eventually her attempts to jump up failed, and after awhile she stopped trying.

She used to jump up into my lap, or the chair next to me and the desk, but there were days when she wouldn’t make the jump successfully. For some time now, I would pick her up when she came into the office and looked up at me expectantly, and when I was on the couch, which was lower, the same story played out. One day, it just became too hard for her to jump up, so I would need to pick her up.

Our neighbors have little children, and when we would leave town, they would sometimes cat sit for us. Their children called our house “Gizmo’s House” and, despite her being such an old cat who mostly ate and slept, they loved her, and she was very tolerant of them showering her with attention.

Sometime back she became quite deaf, and while I could tell she could still sense the vibration of a loud noise, she wouldn’t necessarily be able to detect where it was coming from. Like with Diego, I used to whistle and she would sometimes come to me, but then came the day when I realized she was getting startled because she didn’t know I was right behind her.

Sometime in the last month or so, I think Gizmo lost some of her eye sight. She seemed to lose track of the laser pointer dot in a way that I didn’t expect, and I noticed that when she walked up stairs that she seemed to get startled with each step when her face would brush against it.

Her blood work recently showed issues with her kidneys, and she was already standing awkwardly. Her tail tucked to the side. We could tell she was in pain, probably due to the combination of her kidneys, the slow-growing cancer which has had years to grow, and general arthritis, and she had been for some time.

She was still eating and using the litterbox, and I was told by friends that I’d know if things were at the end if she had more bad days than good. We had seen her bounce back from what seemed like death’s door multiple times. She didn’t seem like she was so bad that euthanasia made sense yet, and I definitely didn’t want to end her life prematurely.

But one day last month she seemed weak and struggled to stand, and despite bouncing back for a few weeks after that, we knew her quality of life was getting bad and would only get worse. Last week she tripped getting out of her bed, and she didn’t land very well when she jumped out of my office chair. Both were things that were seeming to happen more often. Her quality of life was clearly deteriorating.

So we made the hard decision to say goodbye before she suffered for much longer, a decision I wish I had made with Diego at the end of his life.

I called the vet in the morning to make an appointment for that evening. It was a weird feeling to know with so much certainty that it was the last day I would spend with her. I took off the afternoon from the day job so I could spend as much of her remaining time with her.

Gizmo, I love you. I’ll miss the sound of your purrs when I held you close to me. I’ll miss singing Stray Cat Strut to you. I claim it was your favorite song, and while I don’t know if it actually was, it was my favorite one to sing to you. I’ll miss the way you would press your head into my hand when I was petting you. I’ll miss needing to worry about accidentally rolling over you in my office chair since you sometimes hung out behind it and waited for me to notice you on the floor next to me. I’ll miss how sometimes you didn’t wait for me to notice and would paw up at my chair to let me know you wanted me to pick you up. I’ll miss seeing you shortly after you finished eating with a little bit of food on your nose. I’ll miss the way you would lie across my chest or my arm when I was doing my morning exercises on the floor, and I miss sleeping next to you on the couch, or on the floor.

Me and Gizmo

I hope you felt loved right until the very end, and you didn’t feel pain anymore.

After 18 years of having a pet in my life, there is a hole in my daily routine, and in my home. I no longer have Gizmo to greet first thing in the morning. The place where her food and water used to be is now a blank space. Eventually her Boppy pillow that she used as a bed will also disappear, and so will her basket of toys.

My wife said that she thinks I might not realize it because I didn’t grow up with pets, but my relationship with my cats was special. She has never seen cats with such a devotion to their human, and she said it was this amazing co-dependent relationship “in a good way.” She said my cats were spoiled and had such a good life.

And I hope they did.

Categories
Game Design Game Development Geek / Technical

Freshly Squeezed Video Progress Report: Items & Inventory

Here’s the companion video for Monday’s Freshly Squeezed Progress Report: Items & Inventory:

Enjoy! And let me know what you think by replying below!

Categories
Game Design Game Development Geek / Technical

Freshly Squeezed Progress Report: Items & Inventory

In my last report, I prevented player navigation in the dark, then started working on the inventory system for The Dungeon Under My House, my second Freshly Squeezed Entertainment project.

I continued the inventory work this past week.

Sprint 2024-7: Intro sequence game play

Planned and complete:

  • Party member can carry items

Unplanned and incomplete:

  • Allow player to search objects in room

I started the week my rendering the inventory slots for individual party members. For now, each party member can have three items in their inventory, and you can see it in the HUD.

The Dungeon Under My House - inventory slots

And I created a sprite for the Flashlight and made sure that it displayed in those slots if a party member had it in their inventory.

The Dungeon Under My House - inventory slots

That worked when I temporarily coded it in, but the next thing was to have furniture in the room that the player could search and find items such as the Flashlight.

So I created the concept of Furniture. Right now, everything in the room is just drawn as part of the background, but now you can click on something such as the bed in the bedroom and get a description.

The Dungeon Under My House - furniture

Now the other interesting thing about Furniture is that it can have its own Inventory. I had trouble getting things to persist properly until I simplified my code and data structures a bit, unfortunately.

So by the end of the week, I still needed a way for the player to view a given furniture’s inventory slots, then allow the player to take items and put them into their own inventory.

I imagine that this week I’ll find the former is straightforward but the latter will require some effort to handle edge cases and user interface issues.

For examples of things I anticipate needing to worry about, how should the game respond if the player’s inventory is full? Can the player transfer items to the furniture as well? Can I create an interface that allows someone to either use the mouse or a keyboard?

Thanks for reading!

Want to learn when I release The Dungeon Under My House, or about future Freshly Squeezed games I am creating? Sign up for the GBGames Curiosities newsletter, and download the full color Player’s Guides to my existing and future games for free!

Categories
Game Design Game Development Geek / Technical

Freshly Squeezed Video Progress Report: Dungeon’s Too Dark, Can’t Proceed

Here’s the companion video for Monday’s Freshly Squeezed Progress Report: Dungeon’s Too Dark, Can’t Proceed:

Enjoy! And let me know what you think by replying below!

Categories
Game Design Game Development Geek / Technical

Freshly Squeezed Progress Report: Dungeon’s Too Dark, Can’t Proceed

Last time, I reported that I was replacing my test dungeon with the first actual locations for The Dungeon Under My House, my second Freshly Squeezed Entertainment project.

I set out to allow the player to interact with the new environment.

Sprint 2024-6: Pre-production and initialization

Planned and complete:

  • Prevent player navigation if dungeon area is pitch black

Unplanned and incomplete:

  • Party member can carry items

Last week started out quite productive, and I was able to knock out a feature that impacts the player’s navigation through the dungeon. If you are trying to move into a grid cell that is too dark, the game stops you from proceeding.

The way it does so is by treating the darkness as an obstacle, much a wall or closed doorway that prevents movement and tells you why.

The Dungeon Under My House - too dark to proceed

And in this case, it hints at the next set of features I need to implement. You need a flashlight to proceed, and that means the characters need to be able to carry items, which means the game needs an inventory system.

I created an inventory system that allowed for two different types of items: individual items that take up an entire slot, and items that represent quantities.

So a Flashlight exists as an individual item. If you get a second Flashlight, it takes up a second slot.

But a Pickle Jar represents not just a jar but also the contents of the jar. Maybe you eat some of the pickles but not all of them at once. The original Legend of Zelda game had two kinds of potions, and one of them was basically “you can use it twice.”

I like the idea that using up all of the pickles results in an Empty Pickle Jar, which can come in handy.

But that can come later.

I spent a little bit of time trying to figure out how complex adding items to the player’s inventory should be. What if you have get a second jar of pickles? Does it add to the quantity of the original jar, or do you just get two jars, each with a set quantity? Most games do the former, but practically speaking, who wants to merge pickle jars together? Ew.

But I decided that such design decisions can come later when I need to decide them. For now, I created a simple Inventory which I can assign to entities in the game. So I did, and my next job was to ensure that inventories can get persisted when the player saves.

Which did not work, and it was incredibly bizarre because the code looked like it should. Yet running the tests was telling me that it wasn’t.

So I ended the week by losing productivity because I had accidentally introduced a bug that was manifesting in weird ways. I had one unit test that kept insisting that as soon as I added an item to an inventory that the inventory was still empty, and other seemingly unrelated tests would inconsistently take up a ton of memory on the system, seeming to lock everything up for minutes at a time.

Ultimately what was happening was that I was initializing my inventory’s internal std::vector and the internal integer that initializes its size in the wrong order, which meant, well, most likely it is undefined what happens, but it includes in the realm of possibilities initializing the size of the vector of Items with a very, very large value.

Once I figured it out, partially due to lots of logging statements and mostly thanks to the amazing tool valgrind highlighting the exact problematic code (and thanks to my Past Self for having high standards so that there wasn’t a lot of other noisy output due to other problems to wade through), I corrected the mistake, but by that point, it was a few precious hours of development later.

Never code tired.

Anyway, this coming week I anticipate finally adding the ability for the player to inspect the inventory of a particular party member as well as find items in other parts of the game, such as the bedroom where the flashlight will be.

And once the player can acquire a flashlight, being able to light the way in the darkest areas of the dungeon comes next.

Thanks for reading!

Want to learn when I release The Dungeon Under My House, or about future Freshly Squeezed games I am creating? Sign up for the GBGames Curiosities newsletter, and download the full color Player’s Guides to my existing and future games for free!

Categories
Game Design Game Development Geek / Technical

Freshly Squeezed Video Progress Report: The Real Dungeon Appears

Here’s the companion video for Monday’s Freshly Squeezed Progress Report: The Real Dungeon Appears:

Enjoy! And let me know what you think by replying below!

Categories
Game Design Game Development Geek / Technical

Freshly Squeezed Progress Report: The Real Dungeon Appears

In my last report, I continued optimizing the dungeon rendering code for The Dungeon Under My House, my second Freshly Squeezed Entertainment project.

I decided to finish it up and move on to more interesting work for this past week.

Sprint 2024-5: Pre-production and initialization

Planned and complete:

  • Render dungeon based on light levels

Unplanned and incomplete:

  • Prevent player navigation if dungeon area is pitch black

So, right away, I took a lot of my optimizations for drawCeilings() and applied them to drawFloors().

I even applied a new optimization. When I apply lighting data to a given pixel, I multiply the light level by a value to indicate gradations in lighting, then multiply that value by the light color’s red, green, and blue values.

Well, since lighting data is basically precalculated anyway, why not precalculate that math, too?

So now, in my code that gets called for each rendered pixel, I went from this:

    // Apply lighting 
    Color color = lighting.lightColor;
    color.redness *= lighting.lightLevel*.1;
    color.greenness *= lighting.lightLevel*.1;
    color.blueness *= lighting.lightLevel*.1;
    convertedPixelColor.tintInline(color);

to this:

   convertedPixelColor.tintInline(lighting.processedColor);     

It saves not only the creation of a Color object and the various multiplications but also on any subtle data casting/conversion that might be going on between doubles and ints.

While drawCeilings()/drawFloors() are still the major bottlenecks in my dungeon rendering code overall, the major bottleneck in those functions is no longer the code that applies color changes.

It’s funny. Every time I think I’ve hit a limit with optimizing this code, I keep discovering new ways to either entirely eliminate unnecessary calls or moving them so they aren’t called as frequently.

And I know that each time I do, it makes the game less taxing on player hardware and conserves the player’s battery life on laptops and mobile devices.

But, for now, let’s say that optimization is “done enough” and move on to the work of making the actual game!

Since I started working on dungeon-related code, I have had a test dungeon in one form or another. For a long time, it was two rooms, one with the dungeon entrance in the form of a ladder, with a short hallway connecting to a door that opens into the larger room which features a small closet and a column.

The Dungeon Under My House - test dungeon layout

It allowed me to experience navigating the dungeon, opening and closing doors, and most recently see how lighting works.

Well, that test dungeon is now gone.

This past week, I set out to design the opening layout that you’ll actually see in the finished game. While I anticipate iteration and tweaks, I envisioned the ladder from the basement of the house descending into a long, dark hallway.

The Dungeon Under My House - early dungeon space

The only light source is the opening in the ceiling at the entrance itself, which means that as you look down the hallway, it gets darker and impossible to see what is beyond a certain point.

The Dungeon Under My House - early dungeon space

What’s at the other end of the hallway? You can’t find out yet…

Well, technically at the moment you can.

Currently, the game doesn’t actually prevent navigation into the darkness yet, because I had spent much of my time finally making it easier for me to actually create the dungeon spaces. Until now, each cell in the dungeon was individually defined in code. Each wall tile, floor tile, ceiling tile, and door or ladder or light source was coded to make the test dungeon.

So I wrote some helper functions in my dungeon creation code. Now I can define entire arbitrarily-sized rooms at once, as well as defining columns, which are like inside-out rooms, with walls defined in the adjacent cells to enclose a space.

To create my test dungeon, I was able to remove over 30 lines of code and replace them with 7 lines.

The entire time, I was also envisioning the creation of a tool to let me use a GUI to create the dungeon so I wasn’t writing it in code. Even with these helpers to reduce the code needed to generate all of the grid cells, it still gets hard to picture exactly where on my graph paper a particular cell will end up. Plus, it would be nice to have a tool that can generate walls, ceilings, and floors with variations in textures automatically that I can then tweak manually.

I’ve looked briefly into existing tools such as Tiled, and I should dig a bit more to see how I can leverage them rather than spend time on creating my own editor. Either way, having such a tool will pay dividends as I continue designing and creating spaces in the dungeon throughout the remainder of this project’s development.

Thanks for reading!

Want to learn when I release The Dungeon Under My House, or about future Freshly Squeezed games I am creating? Sign up for the GBGames Curiosities newsletter, and download the full color Player’s Guides to my existing and future games for free!