Architect of Strife

"In truth, my artificial axioms are an anomaly. Most natural ideologies are more reactive than active, responding with hatred and love at the sight of harmless symbols."

  • flavour text of the tutorial node explaining Contingencies

The Games Foxes Play

(complete source code - mirror | view all previous posts | play 0.4.3 online in browser on itch.io!)

The overscope is real. I keep having these utterly insane, giga-mass-redesign everything visions of epic proportions, and then come up to the computer only to hit a wall of design problems or programming difficulties. Last Thursday, I quite literally stared into the void for 4 continuous hours, phased out of reality, thinking about all kinds of things I could do.

I hope I have learned my lesson now. I need humility, and the comfort that I'll always be able to build onto what I already have.

Architect of Strife

I welcome yet another JavaScript library to my pile of "things that would have taken weeks to do myself" - Pixi Viewpoint. Following an excruciating implementation process, it has allowed me to transform my zoom animation code (which used to be roughly the coding equivalent to rotting roadkill on an unpaved road after a nuclear apocalypse) into something much, much more presentable, and with a seamlessness I find quite charming. In the future, it will also open up opportunities for drag-and-drop camera panning, mouse zooming, and much more...

Aside from that, it was not a great week. I have undone multiple commits that were going pretty much nowhere, such as letting the player place enemies as they want before initiating combat, a background visual effect for the zoom animation that turned out horribly glitchy, and overall struggled with inconsistent, overly ambitious design.

One of my most "cool on paper, now actually make it" concepts was letting the player design their own enemies using the spell "programming" system already in the game (for example, create an entity with "when taking a step, shoot lasers"). Then, I'd have the player be challenged to defeat their own creations. To prevent players from crafting "when this exists, die instantly"-type pushovers, a squad of NPCs would come afterwards and try to also defeat the artificial enemies. You'd have to make the entities strong enough to beat the NPCs, but weak enough so that you could triumph where they failed.

This has so many problems.

  • What stops the player from crafting "trap" enemies like "this enemy cannot attack, but when it moves, it leaves behind traps that oneshot you"? The player will be intelligent enough to avoid the traps when they play through the challenge, but my NPC squad will get nuked the moment their AI steps where it shouldn't.

  • This implies that a portion of gameplay will be spent watching the NPCs battle it out, how can this part be made interesting and not completely passive?

  • The NPC squad will also get programmable spells of their own, do I just come up with contraptions in a weird arms race against the player to make increasingly broken combos?

I don't think the idea to be irredeemable. This concept of a "sandbox" roguelike - not in the Qud/CDDA sense where "you can do anything" but in the sense of "you can have a part in the world's creation" is not only very thematic with my game's lore, but also lets me secretly distribute some of the design work to the player so they "make my game for me while playing it", so to speak. Tongue in cheek, but I think there is potential here. It's fun to outwit a design and coming up with the "trap" mentioned earlier might be interesting... assuming it isn't some "meta" that should be made every single time.

I am at a turning point. There are so many directions I could go in. I have so many ideas, but many are bad and in the end, only a few can remain. Development might slow a little while I work this out.

Fields of Steel Stretch Forever

"And yet. I know so much, and care so little. Defeaned by chatter, weighed down by revelations - I am all, but wish to be none."

  • Terminal getting pensive about their quest

The Games Foxes Play

(complete source code - mirror | view all previous posts | play 0.4.3 online in browser on itch.io!)

Hiding behind a crevice to escape a passing-by patrol of robots in Cogmind, taking two steps forward and one step backwards to clear the Elven Halls in DCSS... There's a lot to like about sprawling roguelike maps, with their many twists and turns presenting opportunity for crafty adventurers.

So, when I looked at my own game, and considered the loop of "clear square room of all enemies" -> "move to next room" -> "repeat", I couldn't help but feel something was wasted. Due to the structure of the tutorial I initially built my game from, when a room was left, it ceased to exist and entered a state of stasis until the player visited it again.

I couldn't tolerate this any longer.

Fields of Steel Stretch Forever

This has been quite the neuron-frying rework, but TGFP now has full-floor, interconnected maps! The layout is still based off square rooms linked with each other, but the most important feature is that entities other than the player can now move wherever they please.

The implementation proved quite challenging. First, to properly generate a unified map, I randomly generate a 9x9 grid of "walls" and "floors" with no isolated floors, then pave each "floor" with a prefabricated vault, chosen at random among multiple possibilities. Finally, I scrape the data from each "vault" and build a single giga-room (>6000 tiles!) from the extracted data. I was expecting this process to turn my 128 MB VRAM, 8 GB RAM laptop into a miniaturized sun, but everything somehow remained perfectly fluid!

Then, to actually display the giga-map, I thought "let us just render every single tile and move the whole map around when the player moves". Bad idea. There was the miniaturized sun I was after.

Finally, I settled for a 30x30 grid of "projectors" which dynamically update every turn to reflect all tiles in range 15 of the player. It's just like DCSS - the player always remains at the centre, fully enabling any narcissistic tendencies the user may have!

Following this implementation, I struggled very hard to bring back the zooming animation from last week. Initially, it was skewed and caused an annoying lag spike at the end. I worked 5 hours to fix it, butchered my game completely beyond repair and had to undo all changes. Fun.

In the end, some performance testing revealed that the big memory-hog was the function assigning sprites to every single tile, including the black space between the rooms. All it took to fix the lag was a single line of code in the graphics engine: "if tile is not in play area, return".

Cyan Suns Burn the Horizon

The scope for the coming months is... a little imposing. I have a significant addition I wish to add to the core gameplay loop, and I also want to overhaul the pathfinding algorithms from basic-baby Greedy Manhattan Distance to something a little more appropriate for a 81x81 map. So far, the only things tanking my performance have been graphical issues - the back end has never caused any problems. From what I've read about the nightmare A* & friends can be, I expect this may change soon.

I sometimes regret a little choosing JavaScript to get started (but I think harder languages would have demotivated April 2022 me, even though I would be able to handle them now). I am getting frequently trolled by "undefined" types parasiting my data and coming out 5 minutes later to break everything. But, on the other hand, I am massively benefiting from the lack of compile times (offset a little UI element by 3 pixels and instantly see the difference!).

These next weeks will either be glorious or a train wreck. No in between.