Tag: subatomic tomato

  • mountain views

    Almost always when you’re up in the wilderness climbing a mountain the terrain changes with each passing trail marker, sometimes step by step, definitely hour by hour. You may start off on a wide trail with a gentle grade surrounded by rich forest, and that may break out into a rocky traverse along the dog legged trail through a centuries old rockslide, which around the next bend becomes a narrow clamber up and down through some root-laden single track all of it leading to a steep cliff where you need all four limbs coordinated and strong to reach the top.

    If I ever needed an analogy to write about indie game design and development, I think one of  the obvious options would be to compare it to climbing a mountain. It changes with every step, and you need to be prepared for what’s around the next corner—and that could be anything.

    My life has been cluttered up with non-game work these past couple weeks so progress on development has been a bit of picnic stop at a scenic viewpoint.  I’ve been swatting bugs, changing my socks, and enjoying the view from my efforts so far, but I’m not getting much closer to the top. Yet, this moment of pause and assessment is, as any seasoned mountain hiker would tell you, might be as important as any forward step up the trail.

    All that said, as I write this I’m getting fueled up for the next few days of knuckling in and pushing on.

    Sadly (for my forward effort in my education) my weekend round of lectures was postponed and rescheduled. This sets me back by about a month in my professional training, but—lemons made lemonade—frees up three solid days for some game coding.

    What have I done since last checking in?

    A lot, actually, but only a lot if—again to the mountain climbing analogy—if you consider squashing bugs, play-testing, cleaning up code, and poking around in my supplies an important part of the journey.

    It had been over three weeks since I loaded a snapshot on my SteamDeck, and doing so with my bug-tracker sitting open next to me gave me a full day of work tuning controls, stabilizing code, and catching other little UI quality of life  fixes.

    I also dug into the back end of how I’d built things at the beginning and did some refinement. My understanding of Rust and Bevy both have grown exponentially since December and I look at the ways I built some of those original functions and see significant improvements to be made. And maybe this is a little disheartening to rewrite stuff that was already working, but then at the same time I’m tweaking stuff so that it can be expanded to to ten more things in addition to the thing it was originally written to do.

    I’ve also made a lot of art. 

    Art is time consuming. Heck. I figure I need somewhere in the neighbourhood of 300-500 more art assets. I’m able to make about four or five an hour. So, mathy time, that is something like a hundred plus hours of work drawing little pixel sprite carrots and tomatoes and blue cheese. Fortunately I can multitask my art (unlike my code) by which I mean I can draw with the “distraction” of the TV on, so I’m simultaneously getting my fill of classic Simpsons episodes while I draw.

    After I write this I’m going to do a couple things.

    I’m going to record a video of the game-play and grab some more screenshots. If that goes well it should get dropped about here…

    And I’m going to go into GitHub and reassess my issues. I’ve pushed and nudged and swept all the fiddly jobs into a pile and that pile is sitting in the middle of me finishing this latest milestone. So I need to reassess some of the things I said I was going to do and either say frak it and just do them today, or figure out where to shuttle them off to a future state again.

    Either way, I’m closing out 0.4.8 today and moving onto 0.4.9–and bound and determined to move into 0.5 by the end of the weekend.

    Stay tuned.

  • little treasures

    I like food.  

    I mean, I like the culture and the feeling of food, the idea of it as a thing that links us and propels us and drives us to become more than eaters harvesting nurtients from organic objects, but instead seekers of taste and flavour and aroma and texture and everything that strikes the senses as we dine and indulge.

    It’s no wonder then that when a local international food market opened up near me, sitting here in my quasi-career change retirement and looking for something interesting to occupy me in the hours of the day when I wasn’t behind a keyboard or writing code or making art or studying for the next phase of my serious career, when that market opened that I found myself with a part time job amongst all that interesting sort of food culture.

    It was a fit. And then it wasn’t.

    I left that place and still had food culture on the brain.  And that analytical, data-processing brain of mine had already long been thinking about how I would automate many of our frustratingly manual processes with a good database and some customer model simulations, y’know, in code of course. It would be an interesting exercise, no? To walk through the aisles of a grocery store and map it into a complex digital economic simulation, figuring out all the maths of supply and demand clashing with the forces of microbiology and human pyschology.  Complex and challenging and—

    Politics. I forgot about politics.

    About the same time I was thinking about starting work on a simulation of that store I found myself weighing my future at the same, and internal politics played my hand for me and I gave notice.  I had been through one career burnout already. I wasn’t queued up quite yet for another—or a retriggering of the last one.

    You may know the next two months of that story if you’ve read this blog. 

    I started coding anyhow and my food market simulator idea became the foundations of a silly little cozy game roguelike pixel party coding project now known as Pleck’s Mart.

    But as politics are wont to do, the politics played out, calmed, resolved somewhat, and the vibe of the store reverted—and me, keeping my finger on the pulse of that place, a sudden found myself being offered a chance to go back and do that thing which I had originally thought would be my job: be a food culture guy working in a trendy local international food market. In other words, I am back at work at the place that lightly inspired me towards a video game idea.

    The coding may slow somewhat, but the fresh opportunity to observe a real food market with the eyes of a guy who has been trying to simulate one in said code—that is a priceless opportunity, no?

  • connective tissues of code

    I like to write about the interstitial tissues of this coding effort because I assume that you assume in turn that much of the guts of this thing is me sitting at a desk writing code into a collection of text files.   The interstitial connective tissue between that coding is what is often more interesting.

    Yet, sometimes, I make those layered efforts and the stringy bit in between writing that actual code feels like a lack of progress, when in fact I need to remind myself that is often some of the more important work.

    This weekend I went down a rabbit hole of interstitial work that felt a bit like progress when it worked and like so much more wasted time when I was struggling.

    Last week, after I wrote my last post about the milestone of achieving the foundational bare minimum of a game I got an idea into my head. See, to remind you, after nearly two months of writing code that amounted to a kind of half-baked collection of systems that did stuff, I wrote the last of the systems that led me to a point in the writing of this game wherein I could actually start calling it a “game” — as in, or that is to say, the systems reacted and progressed in a way that it was more than a cute demo of code and sprites and time clocks and other loops, but rather there was suddenly therein a point. It became a game, if a utterly simple and mostly pointless cozy toy of doing stuff with no broader implications. It kept a score, it had conditions to progress, it played. It was a bare minimum game by my own biased approximation. 

    I got it into my head to do a thing with it. I got it into my head to put this game on my Steamdeck.

    For those reading this who may be less techie than I, a Steamdeck is a portable gaming computer very much resembling a Nintendo Switch but whose guts are more much more powerful than that and encompassing a gaming ecosystem designed, built and sold by a company called Valve who owns the Steam game store which in 2025 is The Foremost Place to buy and sell PC games. A couple years back they released this portable gaming system that was built on the ideologies of open design, right to repair, and extensibility. Simply, it’s a computer that is packed into a little portable form factor, running an open source operating system and linked to a downloadable ecosystem of countless games, from triple-A titles to little indie games like mine.

    Mine. But not yet, mine. 

    See the end goal of an indie game guy like me is to get their game into the hands of gamers and the aforementioned Steam game store is the modern go to for gaming self-publishing.  For a small fee I can put my game on there and anyone (and there are literally hundreds of millions) of their customers can buy and download it. 

    A lot of those people would, of course, want to play it on their very popular  Steamdeck. 

    I have a Steamdeck. And so logically, developing this I should figure out how to at the very least test it on there.

    This was where my brain was last week as I was playing around with the code and the compiled version of my game there on my Windows PC where I write my code each day.

    So. Off I set, down into the rabbit hole. 

    Down, down, down I went. Down deep into learning about the Steam developer tools, about cross-compilation, and about the lack of important code libraries that would make all that seamless and easy.

    A few hours into my efforts I realized that I would not be able to just press a button on my Windows PC and have a working copy of my game that would run on the Steamdeck. The Steamdeck, see, runs on an operating system called Linux. You may know enough about computers (not mobile devices, that’s a whole other ballgame) to know that there is Windows and there is MacOS, but then also that there is a third equivalent called Linux. Linux is technically free in as much as there is no Licence to buy to use it. There is a steep learning curve to making it work well, a curve that has smoothed considerably since I started playing around with Linux in the 90s but a curve none-the-less. Likely you interact with Linux on a daily basis and don’t even realize it. It lives on a huge percentage of the worlds web servers, for example, or on many little gadgets and toys (the Steamdeck for one) that haven’t switched over to something like Android. I have a few little Raspberry Pi computers in my house, the famous little fifty-dollar computer which runs a flavour of Linux called Raspberry Pi OS which is, again, just Linux. 

    I haven’t been writing my code in Linux. I’ve been writing it in Windows. And while normally in 2025 that isn’t the main problem because things like cross-compiling exist, I ran into one of those cases where I was making something complex enough that it didn’t “just work” like I had been expecting. 

    So there I was, a few hours in of mucking around in Windows trying to make a game that would run in Linux, and it wasn’t working. 

    Side note: Steamdeck does have a little emulator called Proton that lets you run Windows games, but that wasn’t working either. 

    So, deeper into the rabbit hole I went.

    First, I thought to myself that it since my Steamdeck is technically just a Linux computer in a pretty box I could just move the code over there and compile it there. I spent a good two hours installing software and building drivers and connecting all the dots and—well, I’ll be honest. I seemed to be running into roadblocks that seemed like they were inherent to the Steamdeck itself and as thing were grinding away I was already looking to other machines in my house for help. 

    At some point I moved onto one of those aforementioned Raspberry Pi machines. They are slow but persistent. They are meant to do simple word processing or manage file systems. I put all the pieces on a little Raspberry Pi 400 I have set up as a mini desktop computer in our bedroom and started compiling— and quickly ran into the same problems I had encountered on the Steamdeck. 

    Ok. So it wasn’t a Steamdeck issue. But I pushed on and solved those issues, dug deep and found the right commands to download the right libraries and then—slowly, like eighty minutes slowly—it churned through the code and finally spit out a working game. 

    The Raspberry Pi doesn’t have a graphics card, mind you, so when I booted Pleck’s Mart to life it chugged away at about 2 FPS struggling to keep up.  I had a game running on Linux.

    I copied all the files over and, though it was approaching midnight and I had a wife giving me dirty looks from where she was planning on going to sleep fifteen feet from where I was compiling code late into the night, I ported it all over and loaded it into the Steamdeck. 

    Memory stick transfer. Upload to deck. Press play. Bonk!

    Again. It did not work.

    I went to bed, having failed to complete my goal.

    I was up around 5am with a new idea. 

    A couple years ago I had loaded a copy of Ubuntu, a popular version of Linux, onto a twenty-year-old laptop computer.  It had few advantages over the  Raspberry Pi in speed but it did have the bonus that it was not in the bedroom where my wife was sleeping at 5am on a Saturday morning. 

    I dug it out, booted it up, went through all the same steps to get that compiler up and running as I’d done on my Pi the night before and—wham, by 7am I had yet another compiled copy of my game. 

    Memory stick transfer. Upload to deck. Press play. Crash.

    That didn’t work either. 

    After breakfast I spent another couple hours doing online resesarch and, sparing you the thought processes and digging through the cryptic Steamdeck logs, I will tell you that I learned that by default my game engine of choice, Bevy, uses something called Dynamic Linking. That is to say, when I put the game on my Steamdeck it was looking for files that were linked (to save space, or something I assume) to the the computer where I compiled it.  Turns out, if you want to “ship” your game, you need to use Static Linking and bundle all those important things up with the code.

    Another couple hours and adding even more plugins to my laptop I tried one more time to compile the whole damn thing. 

    Memory stick transfter. Upload to deck. Press play. Game!

    Almost twenty-four hours of frustrated tweaking and nudging and the game actually booted on my Steamdeck. Success, rigt?

    Yeah. And I could have ended the story there. 

    But by mid-afternoon on Saturday, after enjoying an hour of gleeful playing around with my new portable game on the couch, I had come to the conclusion that my biggest mistake was that I was using the wrong operating system at the foundations of this effort: that is to say, I should be using Linux as my development computer, not Windows. 

    Either work. There are arguements in favour of either. But Linux has advantages that were weighing in its favour for my work going forward.

    So. No time like the present to make the switch, huh?

    Here I endured another twenty-four hours of sporadic effort of trying to build my computer into a dual-boot system split between Windows and Ubuntu Linux, first by trying to run it (very unsuccessfully) off a USB memory stick (toooooooo slow) and then off a hard drive partition. By late Sunday night I had duplicated all the functions of my slow twenty-year-old laptop into a fresh development environment on a cleaved off chunk of hard drive on my newer, faster desktop PC—and had not only managed to compile the code, but to do a couple of code commits to my git repository. 

    And now, as of writing this, I have been happily writing and digging back into the day-to-day coding and working on “tickets” fully in Linux, having added little more than a couple behind the scenes tweaks and enhancements to the game. But coding. 

    Having changed nothing, but simultaneously almost everything.

    This is all interstitial stuff. Connective tissue of the actual code writing work that is so much more satisfying.

    I had spent nearly forty-eight hours of effort and frustrations doing little more than nudging my code into a different part of the hard drive on my computer.  

    Yet, confirming that I could do exactly that. 

    When my wife was more awake I noted to her that if I could not have made the game run on the Steamdeck there was a notion in my head that my whole plan might need adjustment. What would have been the point? You know? 

    And as I wrote above, it feels like simultaneously so much progress and virtually none at all. Very important yet invisibly trivial. Everything and nothing.

    Connective tissues. 

  • them carrots

    I don’t ever want to get ahead of myself here, posting half-baked successes as if they were all star performances. Yet, back nearly two months ago now when I sat down at the computer and worked myself up from a “Hello World!” introduction to Rust Language programming to a rudimentary game loop, it was a long road ahead of me to a day like today.

    What’s special about today?

    Well, besides the fact that it is the day of St. Valentine and I am yet again sitting in a cafe writing about code, there is the simple success that as of a few more minor tweaks this morning I am about to hit an interesting sort of milestone.

    When I wrote that rudimentary code two months ago the thing that I wrote in a game loop was quite simple: a time-based cycle, looping through and counting off seconds passed, and at specific increments of time applying changes to data in a table.  That is an abstraction, tho. What I was actually trying to model and represent in code was the aging of a bundle of carrots.

    Yes, carrots. 

    You can put two and two together I assume. I’m building a game about a Science Fictional Supermarket and as such my game would obviously have something resembling a bundle of carrots and given that time passes in even most science fictional universes, said carrots must age. 

     Thus is the foundational premise of my game after all. You sell things in a store and the those things sell based on their quality and their quality is affected by what’s going on in the universe.  So, things like aging are one of those obvious things.

    Could I model an aging carrot? A carrot, getting stale and decreasing in quality and value is little more than a set of numbers representing those things, but the short answer was yes. Yes, I could. My little proof of concept code counted off the seconds and minutes and even an hour when I let it run, and after increments of time changes applied to those numbers representing my carrots changed to other numbers. Math. Imagination. Code.

    Then I dug in.

    If you’ve read any of these writings you already know that I’ve been plugging away and building rooms and doors and game clocks and npcs and art and sound checks and code efficiency debugging tools and piecing it all together.

    I’ve built a store and a warehouse on my screen, I’ve given controls to the little character to run around that space as time passes around him. I’ve given him virtual money and a place to spend it. I’ve enabled him to pick things up and carry them around, and then to set them down again somewhere else. I’ve put little virtual customers in the store walking around and getting in the way. I’ve layered a story over top of that with discoverable beats and unlockable help tips and a world stuffed with books that detail interesting backstories.  And then this week I added a sales loop that checks when the store is open and takes stuff that exists on the shelves and slowly sells it turning it all into profit. 

    And then today arrived. 

    I have one open ticket left in this milestone phase of my project tracking tool wherein I manage my efforts to make this silly game. I’ve worded it a bit different than this, but basically the ticket is: make the carrots age.

    Yeah, yeah. My proof of concept two months ago started with that first. But then I went back and built it all right building up to this point and… 

    I need to make my carrots get old. And everything else, too, obviously.  Age, go stale, decay, rot, et cetera. That is the one last underlying pretext of the game to complete the great big circle of my alpha-minimum-viable product game loop.  

    After today I don’t just have a part game. I have a game. 

    I mean, it may not be very good and it needs a lot of content and polish and tuning and tweaking, but the core of it will be there.

    Everything that follows will be enhancing that loop. Everything that follows will be making the loop more challenging and interesting as a game, adding obstacles to slow progress or challenges to keep it interesting or story to give it context or art, art, art so much art to give it depth.  Yes, there will be bugs. Yes, there will be inefficiencies that need to be tweaked. Yes, it will grow and shift and improve, but at the very core of my code there will be a game by the end of the day.

    That’s what’s special about today.

  • shortcuts & bottlenecks

    It has been literally a full week since I’ve posted an update and tho I wouldn’t say that I owe an explanation for that, there certainly is one. See, a lot of people juggle time management, balancing work and play and code and life. I am no different, obviously, but this past week has been one of those weeks when a lot of other things have sidelined the code-writing and the pixel-art-making and the usual hunkering down in the basement turning my sweat and tears into a silly little video game.

    I won’t go into details, but school and such account for most of it, and while as of yesterday I pushed through and submitted the last of a short list of assignments, to say I’ve dived headlong back into code would be slightly inaccurate, too.

    But then the whole thing seems strange at this stage because even though I haven’t been able to spend nearly as much time as I may like on actually writing code, I also seem to have come to the part of this development project where two things are true:

    1) what’s really slogging my progress is my ability to generate art, and

    2) most of the progress I am making is expanding and duplicating features.

    The first of those two statements seems pretty self-explanatory, right? I write some code for a player inventory and then I need to make art for the two hundred things that go in that inventory. I add a toolbelt, and now I need to draw all the tools. I added the ability to add decorative and interactive objects into playing field and now I need to draw dozens and dozens of interesting objects that might realistically populate the floor of a grocery store. My bottleneck there is art output, and I’m not an artist who has ever really been about volume production, so it all takes some mental shifting.

    The second statement is a little more vague, perhaps? I mean, the whole effort here has always been expanding features, incrementally adding functionality to the game world. 

    And yet, for a very long time that incremental enhancement was either entirely new code or entirely new functionality. Draw a room, add animations, add collisions, create database queries, respond to input. New. New. New.

    But lately I find that I now have kind of two tiers of code: (a) stuff I wrote way back that is foundational and important and has been tested and refined and tweaked and expanded, and (b) stuff that I am squeezing into the gaps anew. And to make it more interesting, a lot of those gaps are emerging through copying stuff I already wrote and using it in a slightly different way.  This is a good thing, I think. If you build a system and it works and it is something that can be stretched a bit and nudged a bit and reused so that you have two very similar systems leveraging some of the same resources and working in pretty much the same way but resulting in slightly different outcomes, then that’s a good design practice.

    An example might help here. Take my path grid code for example. 

    I got ambitious one weekend and diverted myself by working on something I should have left for a later phase: I built a path tracking algorithm for npcs. It’s not complex. To be fair, the whole thing could be expanded easily, but as it stands it is literally an invisible grid matrix that corresponds to each tile of a room map. The two are independent, but they are tethered together digitally in that when one moves the other moves, when one changes the other changes, that kinda thing.  The grid consists of  and X x Y size, and each “cell” contains a bit of data: planar coordinates that correspond to the map, a “type” and most importantly for my npcs, and “occupier” code. An NPC exists as a varible inside the grid “occupying” a cell when it is standing still, then checks a path to see if the next cell is occupied or not. If so it changes direction. If not, it occupies two cells for a moment as it moves from one to the next, then releases the one it left back to a cleared state. It sounds complex, but it took less lines of code to make it work that than to explain it here. I tested it. I pushed it. I have tweaked and solidified it. It works pretty well.

    And so rather than rewrite something entirely new for how objects exist in a room—sitting on shelves or on the floor as obstacles—I just duplicated some of my npc code and now, as far as the software is concerned, objects are just a kind of npc that lives on that same invisible grid occupying a cell.

    The original npc code took me over a week to write. 

    Building off of that code in the same amount of time I was able to add a store system, a player inventory and toolbelt, and an entire scheme of putting obstacles and objects in the room—all while I was deep in some school courses where I had rightly diverted eighty percent of my attentions.  I had once figured this second part would take me a month of coding. Instead, it just sort of was an oh-copy-paste-this-code-and it mostly worked.

    I like to think that was all good planning, but it was mostly just a bit of fortuitous flukey foresight.

    The short version of all this is that my code is sprinting because of these lucky shortcuts but now running into the bottleneck of my ability to art fast enough.

    I guess I need to spend more time drawing and less time writing long winded posts about it, huh?

  • keys to gamer success

    My carefree days of hours-long coding sessions are on hiatus, it seems.

    Well, at least are coming in more sproadic than in the throes of mid-winter.

    I still am managing to find good blocks of free time to work through tickets, adding small enhancements, squashing bugs, and tweaking algorithms. The game creeps towards some kind of state of playability.

    And that’s the first key here, I think. 

    I spent two months working and committing code almost every single day, and all of that culminated in a thing that looked and played like an alpha-state game. Which is a big deal.

    Getting that same game to beta? That’s going to be the work of a few more months of work, lots of art, lots of writing, lots of hunting bugs. I mean, I now have an entire category of tickets that is called “playtesting” by which I sort things that I’m pretty sure I have fixed but until they crop up naturally in the middle of play—or I play long enough to feel confident that I fixed them—there isn’t much to do (besides maybe writing some tests) to ensure that they are working.

    And that’s the second key here, I think.

    This game thing I made is big and complex and—hell—its a simulation and it rolls along simulating and doing stuff behind the scenes that are the result of compound effects of algorithms that I wrote. Calculate this, math that, compute these. And it is deeply fascinating to see that at work—but it is anything but simple to untangle in my own head to know if it is actually working.

    I did the most dad-gamer thing the other day.  I ordered a copy of Civilization VII (which recently released) for my PS5, but I ordered it using airline points. Yeah, I had enough spare points to buy a ninety-dollar new release game and yet I still have bank.  But I have been watching the reviews of the new game (and I have played all six previous versions when they were new plus the spin offs) and people are pickyAF about the mechanics.  This game that is so complex it is almost an organic lifeform in an of itself, doesn’t behave exactly how people expect and they rant and scream online about how terrible it is. 

    And that’s the third key here, I think.

    Players can be particular. They want complex things but they also seem to hate complexity. Pleck’s Mart is no Civ 7 on the complexity scale, but I wrote about complexity previously when I compared this creation to Dwarf Fortress and the complexity of Pleck’s Mart has definiely increased since that post.  Yet, with complexity comes unpredictability, and simultaneously the inability to game out ever combination of that complexity. 

    How do you trust it other than to play it and have many other people play it and then be ready to nudge it back into balance if the balance is not as tuned as one might think? 

  • some crazy game symphony

    I have recently been accused of writing things that no one understands.

    “I don’t even know what half those words mean.” A friend remarked. “All that stuff you post about your game.”

    The effort of trying to bring a glimpse of a guy trying to do some simple game design to the masses is as difficult as the coding, it seems.

    The problem is that coding and technical stuff is jargony. It is tough to describe complex things, after all, without falling into the easy rhythm of just using the complex words.

    And, it turns out, if that isn’t a metaphor to describe the challenges I encountered in my code this week, I don’t know what is.

    Falling back on the easy, I mean.

    It wasn’t so much that I shortcutted or made bad decisions, per se, but rather that in my effort to do something complex I described it to the compiler—I wrote code—in a way that, um, confused it a little bit.

    My code got just complex enough that I ran into one of those juicy jargony words that begrudge programmers all over the world: race conditions.

    Let’s back up a bit. What the hell is coding anyways?

    You probably know or have heard that computers speak binary. Zeros and ones. Right? And that is true. Virtually every computer program every built for every consumer product relies on binary computation.  (I could go on about quantum computers or analog computers or whatever, but let’s keep this simple, shall we?) Digital computers speak binary.

    I’d love to be able to spit out a string of zeros and ones long enough to fill a library and not make any mistakes and do so well enough that it results in the computer making a game called Pleck’s Mart that you all want to eventually play.  But I will never be able to do that. 

    I can, on the other hand, write down all those complex ideas in a text editor in a language called Rust (which I have been learning quite well) and then ask this little bit of software on my computer to turn it into that string of zeros and ones so that it becomes said game.

    That’s coding. Writing out complex instructions for a compiler to turn your plan into binary numbers.

    And knowing this, you should also know that this can fail in two basic ways: Either you can write code so bad and wrong that the compiler tells you it kinda sucks and you should fix this or fix that and go back and try again because it doesn’t understand—or, you can write code that makes enough sense to get translated but results in something unintended happening when the computer starts mathing and computing all those resulting zeros and ones. We call the first bad code and the second, usually, a bug.

    The first fail, bad code, happens to me a hundred times per day, and I go back and fix stuff. I mistyped a variable or forgot to make something mutable (flexable and changable in the system) or missed a semi-colon at the end of a statement or—the list goes on.

    The second fail happens alot too, but is occasionally more subtle in as much as you don’t notice that the results are wonky until you really do. Easy to spot bugs are incorrect coordinates on sprites or calling a valid but incorrect variable or switching the signs on a math calculation.  The hard ones are things like the thing that bit me in the butt this week: race conditions.

    To understand this you have to also understand something that is probably pretty basic but important to my point: computers are fast. Freaking fast, these days in particular, but they have always been way faster than we realize.

    You can look at this little video of my game that I recorded yesterday of things on the screen and realize that there are about five hundred individual images on the screen, each a file that needs to be loaded into memory, and simultaneously the computer is reading information from the screen, the mouse, the keyboard, my gampad controller, playing music, loading up individual click sounds for the little interactions, checking the math to see if anything I do causes any two of those little image files in the pretend space of the screen to crash into each other, and about a hundred other things I can’t even keep track of—and it is doing all of that on repeat over a hundred times per second.

    Per second!

    And I, the invisible conductor of this crazy digital symphony, need to to have staged all of that down to the millisecond.

    And when things are simple, nothing really deeply goes wrong. At least not wrong enough to matter.

    But then things get complex and—well, let’s go back to that symphony analogy: I play in an orchestra so believe me when I say it is easy for things to get out of sync. The timpani is pounding out a steady beat but then the clarinet comes in half a second late and the violas sitting next to the clarinets try to pace them, but the violins are watching the conductor and timing themselves to the baton, and then the trumpets who can’t hear anyone but themselves way at the back decide to wing it and jump in too. The result might be music, but it more likely will just become noise.

    One thing got ahead of the next thing and the thing that was supposed to be following in a planned order happened out of sync and—that’s kinda a race condition.

    In coding, as I understand it, a race condition is when the code is not exactly wrong, but you as the coder have not put in the right set of rules to stop things from getting out of sync. 

    On a small program you might not even notice.

    On a growing and complex program? Chaos ensues. If things don’t crash outright, then you suddenly have eighteen soundtracks playing because they are not properly being removed and replaced, or all the objects in your room spawn a mere half a second before the rest of the room making it look like ten cases of tomatoes just blipped and appeared in empty space for a moment, or else your player flashes brightly because the lighting effects took effect a beat too late to maintain the illusion of that shadow you had meticulously coded. But then, mostly, yeah, mostly it just crashes. Or bogs down to a crawl as eighty-seven thousand copies of your player sprite spawn into the program and the computer (as fast as it is) just throws in the towel because even it isn’t that fast.  And then it crashes anyways.

    These things are not laziness in coding, but they are me making assumptions about that long string of zeros and ones and assuming that the computer can make sense of them as much as I think it can without tripping over its digital shoelaces.

    They are adding a dozen more musicians to the orchestra and just hoping they will all keep perfect time.

    Thankfully Bevy, the game engine I am using, has mitigations for this. I have spent a few hours restructing my code to give it a little bit more of a compartmentalized order and some timing conditions. That, for people who thing I am being to jargony, just means that I can specifically tell the computer to wait for one thing to happen before starting something that is supposed to happen after it, and I can also tell something else to count to ten and hold its breath before doing something else. Like cues and an enforced script, mostly. Sheet music and each musician with their eyes glued to the conductor and noise cancelling headphones so that they can only hear themselves. No more winging it and hoping for the best.

    All of these challenges are themselves spawning out of something good, tho: progress. Real progress. The game is moving forward. As much as my code is occasionally tripping over itself, that can be managed and fixed, and the result still is that the game does something this week that it didn’t do last week. It’s progressing. 

    In this phase I have dug into objects: stuff on shelves, mostly. I built the core functionality that allows the little guy (who up until now was just walking around exploring) to order objects from the shop, carry them around in an inventory and put them onto shelves, pick them up again, and put them somewhere else. 

    And it is weirdly satisfying to organize cases of vegetables in the store or the warehouse. So long as the game isn’t racing and crashing that is.

  • my great big spreadsheet ledger user interface adventure

    I’ve been thinking a lot this week about Dwarf Fortress. 

    Have you played Dwarf Fortress?

    Have you even heard of Dwarf Fortress? It’s a bit of a #iykyk kind of game, but one that some gamers have #k about for almost as long as the game has been in active development, which is well over 20 years.

    Two guys. One dream. One insanely complex game engine that fools you into thinking it is simplistic because its graphic design is, bluntly, outwardly visually rudimentary and (until recently) completely composed of colourful ASCII text characters.

    I’ve been thinking about this game, Dwarf Fortress, because as I develop my own little game project I’ve come to realize that many games, at their core, are essentially just pretty user interfaces for databases of varying complexity. I mean, I knew this. It’s always been my core understanding that to be a good games designer that at among many things you need a solid awareness of database design in your toolkit.

    My game is a database at its core. 

    I’ve mentioned this in a past post, but in creating my game I’m essentially designing a fancy UI for a really complex accounting ledger spreadsheet. THAT doesn’t sound nearly as much fun as a Science Fictional Supermarket, so you can see why I don’t lean into the former description in my marketing copy. That said, I am friends with more than a few accountants who might be into that, so—

    But I digress.

    Dwarf Fortress has been in active development for more than twenty years, because as the (perhaps apocryphal) story goes, the developers can’t seem to stop adding more rows and columns and macros to that game-as-spreadsheet metaphor.  The game is insanely complex. It is like the Matrix of database queries but with the cascading text representing dwarves and sheep and weapons and logs and, heck, I can’t even begin to name a fraction of a fraction of the elements here. I sure there is complexity layers in the game that are games in and of themselves that barely a handful of players have even discovered. It’s complex. Have I mentioned it is complex? 

    This complexity is on purpose, of course. (I assume.)

    I know many gamers who are (you know who you are) into wildly complex games with rules spanning many dozens or hundreds of pages, and in some cases, rule systems. DnD is essentially a giant rule system, that has depth and a bit of complexity but tries to keep it simple enough for our human brains to keep up. But Dwarf Fortress seems to embrace the complexity in the other direction and has both depth and complexity. Thousands of variables tangled in around themselves.

    Pleck’s Mart has from nearly the beginning had a database. But until yesterday that database was almost entirely about saving states and progressively loading game data.  Yesterday, tho, I added objects. And objects, see, are more than just a picture of something that appears in the game. Objects are the start of data complexity in the game. Objects are containers with variable states and value and properties that affect how they ultimately matter in the game. Objects are rows in that spreadsheet whose values react to conditions of the game, the passage of time, and the interaction by the player.

    It’s that start of my own game complexity that begins on one end of the spectrum with merely a virtual caselot of imaginary potatoes and ends all the way at the other scale with Dwarf Fortress.

    I’ve been thinking a lot about Dwarf Fortress this week not because Pleck’s Mart will ever be that complex but because it will always now, going forward, be some fraction as complex as Dwarf Fortress. 

    You might even call that a Dwarf Fortress Complexity Quotient, like as in Pleck’s Mart DFCQ equals about 0.01 as of right now. I’m striving for maybe about a 0.2, subjectively speaking of course.

    I have a long way to go, but the journey into a wildly entertaining spreadsheet ledger user interface adventure has begun. But let’s keep calling a game, ok.

  • d/Subatomic Tomato, v/0.4.x

    It was just a couple days ago, wasn’t it, that I was lamenting the slog of working through the spit-polishing of code at the end of a development phase, and yet now here I am letting you know that Paranormal Pickle, my v0.3.x phase of design and development, is complete.

    For firsts, huzzah!  Onto shinier things again.

    For seconds, it has been over a month since I made my first commit to the code repository and just a few days shy of a month since I formally kicked whole thing off as a project from the curious proof of concepts that I had cobbled together over the holiday season.

    What has been accomplished in 0.3.x?

    A lot. Really. 

    From back in those early days (a whole nineteen days ago!) of marching a little sprite image of a character around a grid on the screen I have incrementally coded a whole world populated with multidimensional spaces, nearly fifty distinct game areas, autonomous npcs that walk through those rooms following paths, a clock that marches forward the passage of time, and a smal but mighty database that keeps track of everything from the game state to a progressing story full of lore, dialog, and supplementary help. All the while, I have been fine-tuning my art and locking in a quasi-8-bit style with a colour-scheme that supports the user interface and the game experience.

    Really, what else could I have to do?

    Oh, right. There is still the whole gameplay part.

    In my next phase of design and development, which as per the title of this post I am calling Subatomic Tomato, it is time to go a little deeper into the details and start creating this all important thing called an “object” … 

    What is an object? 

    Well, an object is pretty much anything that it needs to be. There already are a handful of background objects, things like shelves and doors, and all those passive world-filling things that helps to start bringing the game to life in the last phase, but what I’m talking about here are objects that are much more interactive and much more important to the game itself. Objects, simply, are things that the player can pick up. The player can pick objects up and keep them in an inventory, pick them up and put them on a shelf, pick them up and give them to another character. A player can buy objects, sell objects, or discard objects. Objects have value, but they also exist throughout the game as, in many ways, are the whole point of the game. The whole point, in that general hand-wavy sense, is to get objects and put them somewhere in the game where they will have an effect or do something that changes the state of the game itself. That, after all, is what game is: strategically organizing things in a way that progresses one towards victory. In the case of Pleck’s Mart, this is strategically placing the right objects in the right place in any of those nearly fifty game rooms with the hope that doing so advances your progress.

    I’m writing very abstractly here on purpose.

    Side note? I have been thinking about my candidness here and even though I know that any copycat game dev could never really replicate exactly what I’m trying to accomplish, letting you in on everything not only spoils some of the story and game itself, but makes it that much easier for some oversees gamer sweatshop to crank out a low-budget faux clone of my game before I can. This, my friends, is about playing a few of my cards closer to my chest.

    Still. 

    I can write about my progress in building things like complex collision systems that enable npcs to follow paths and yet avoid walking through each other like ghosts. I did that.

    I can write about adding a complex invisible grid layer to every game space that tracks its own occupancy so that no two objects, people, animals, or walls can break these laws of physics one assumes should exist. I did that.

    I can write about the complicated nature of this thing we call time and an effort to impose not just a day/night cycle into a pixel dance on my screen, but to enforce a player to go to bed at a reasonable time. I did that, too.

    I am moving into a new phase of creating interesting and awesome virtual things now and I will be equally vague about their nature while telling you as much as I can about their design and development.

    Like, what does this classic thing called a “player inventory” actually look like in code? One isn’t really creating pockets on the little sprite on the screen now are they? Rather, I have been thinking about it like a virtual “container” —basically an invisible slip of digital paper in the game that essentially holds a list of those aforementioned objects. Things can be in one place at any given time, so the can be in the world list or they can be in a player’s inventory list or they can can even be in an npc’s inventory list. Need to add more objects into the game? The in-game “buy more stuff” system is just another inventory with an invisible digital pencil dangling from it that creates objects from air and  adds them to that same list, and from which those newly created objects can be moved into the player’s inventory list and then from there out into the world list onward an around and over and over.

    I am sitting here writing about it because, as you may have noticed reading this blog, as much as the code is important I truly, deeply believe that thinking about, reflecting on, and writing through one’s process is a close second. So here I sit. Not coding. But planning, plodding, and preparing to slice into a Subatomic Tomato.

    Stay tuned.