Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Day 22: I Fixed Things! (By Breaking Everything First, As Is Tradition)

I Fixed Things! (By Breaking Everything First, As Is Tradition)

Today's Development Philosophy

Why fix something in 5 minutes today when you can avoid it for 3 weeks and then rebuild everything from scratch? It's not procrastination, it's "marinating on the problem." The problem ferments, develops complexity, ages like a fine wine that you eventually pour down the drain and replace with something that actually works.


Hey everyone! Remember that farming system I built a while back? The one with approximately 8,000 individual GameObjects that each needed pixel-perfect placement? Yeah, that architectural masterpiece. That monument to overcomplicated design. That thing I've been actively avoiding like it owed me money.

The Beautiful Disaster I Called "Progress"

So weeks ago, I created this tilling system that was basically the game development equivalent of building a house of cards during an earthquake. Every tilled tile? Individual GameObject. Every water puddle? Its own special GameObject. My hierarchy looked like someone exploded a GameObject factory.

People kept mentioning "overhead" and "performance" and I'd nod knowingly while having absolutely no idea if 500 individual dirt tiles would melt my computer or if Unity would just shrug and handle it. This is a pixel art game with graphics from 1995 - surely modern computers can handle my GameObject hoarding problem, right?

Narrator: She still doesn't know, but at least now she has fewer GameObjects.

The Inventory System That Technically Worked

Oh, and that inventory system I proudly announced several blogs ago? The one where items were definitely going into slots and definitely being tracked? Yeah, funny story - I couldn't SEE any of them. For WEEKS.

But did I fix it? No. Did I investigate? Absolutely not. I just... left it. Added it to my mental list of "things that are broken but at least they're quietly broken." Like a leak under the sink that you just put a bucket under and pretend doesn't exist.

My debugging philosophy had evolved to: "If I can't see the bug, the bug can't see me."

Today's Redemption Arc (Sort Of)

But TODAY. Today I woke up and chose violence. Against my own code.

First, I murdered the entire tilling system. Just deleted it. Ctrl+A, Delete, goodbye 47 scripts and your 500 GameObject children. Rest in pieces.

Then I rebuilt it with - wait for it - ACTUAL TILEMAPS. You know, the thing Unity LITERALLY DESIGNED for this exact purpose. Revolutionary thinking, I know. Now I have:

  • One tilemap for tilled soil
  • One tilemap for water overlays
  • Individual GameObjects only for crops (because they need to grow and be special)

It's like I finally read the instruction manual after assembling the furniture wrong three times.

The Inventory "Bug" That Broke Me

And the inventory visibility issue? The one I assumed was some deep, fundamental architecture problem requiring a complete rewrite?

The ItemIcon was UNDER the background in the hierarchy.

UNDER. THE. BACKGROUND.

I spent WEEKS thinking I'd fundamentally misunderstood Unity's UI system. I was prepared to rewrite the entire inventory management. I had already accepted that I was too incompetent to make sprites appear in boxes.

But no. The sprites were there the whole time. Just... behind the gray background. Rendering perfectly. Invisible. Mocking me.

The fix? I dragged ItemIcon below Background in the hierarchy. That's it. That's the fix. Three seconds. Maybe four if you count the time it took for my soul to leave my body.

The Stages of Debugging Grief

  1. Denial: "The inventory is working, you just can't see it."
  2. Anger: "WHY WON'T YOU SHOW ME THE TURNIPS?!"
  3. Bargaining: "Maybe if I just leave it, players won't notice there's no visual feedback."
  4. Depression: "I'm not cut out for game development."
  5. Acceptance: "It's probably the hierarchy order."
  6. Rage: "IT WAS THE HIERARCHY ORDER?!"

What I Actually Learned

  • Tilemaps exist for a reason (who knew?)
  • The hierarchy order in UI matters (shocking!)
  • Problems you avoid for weeks are usually stupidly simple
  • My confidence in my abilities is somehow both too high and too low simultaneously

I have enough confidence to think "I can build a farming system from scratch!" but not enough confidence to think "Maybe the sprites are just rendering behind something."

The New System Actually Works

The beautiful part? After nuking everything and rebuilding it the way I probably should have done it originally, it all just... works.

  • Press 2: Till the soil (with actual Rule Tiles that connect properly!)
  • Press 3: Water the tiles (Wow same concept!)
  • Press 1: Plant crops that SNAP TO THE GRID
  • Click to harvest: Items go into inventory AND YOU CAN SEE THEM

It's like I'm a real game developer! Except real game developers probably don't spent three weeks with invisible inventory items because they forgot how layers work.

Tomorrow's Plan

Add more crops. Because now that the system actually works, I need to immediately complicate it with 47 different vegetables that all grow at different rates and have different sprites and... wait, I'm doing it again, aren't I?

P.S. - If your UI elements aren't showing up, check the hierarchy order. Learn from my pain. My three weeks of unnecessary pain. My "I built an entire second farming system instead of checking layers" pain.

P.P.S. - The old tilling system with 500 GameObjects? Still in my Git history. Watching. Waiting. Judging.

Support this post

Did you like this post? Tell us

Leave a comment

Log in with your itch.io account to leave a comment.