Genetic Trials

"Evolution is war. The prey wishes to escape, the predator wishes to catch - one will inevitably suffer, from hunger or fang."

"When you step in a flowery meadow and frolick in joy through the bushes and butterflies... You are blind to the agonizing battlefield raging all around you. Each blade of grass strives to choke its neighbour, each insect would love to devour you whole had you been a hundredth of your size."

"Fu! And you say nature and its diversity is beautiful. With affection, you lick the hand which chokes you by the throat. We would laugh, had we not been feeling infinite pity for you in this moment."

The Games Foxes Play

(complete source code - rust source code | view all previous posts)

The advancements of this week are highly experimental and possibly insane. Given repeated troubles related to the player constantly breaking the smooth flow and design of the game, I am attempting the obvious: removing the player.

A grid of tiles contains a certain number of creatures. Each one operates as follows:

  • It receives some Senses, defined by the player, like the distance between itself and the yellow X Beacon, or the angle between itself and the Beacon.
  • The Senses pass through a simple neural network (only 1 hidden layer as to not turn my computer into a miniaturized sun)
  • The neural network chooses one among a list of Axioms, also defined by the player, and casts it. This could be moving one tile, or doing some cool ability.

These creatures are then tortured over and over again in my test chamber. Every 100 turns, each one is judged according to an efficiency score. The player defines the criteria, like "get as close to the Beacon as possible".

Through some genetic algorithm technomagic, all the creatures are returned to their start position, and their neural networks are tweaked to look more like those of the best performers, with some random mutations thrown in there for science.

Eventually, the creatures "learn" how to complete the objective defined by the player! I believe the buzzword for this technique is "neuroevolution".

In order for things to remain smooth, the game window actually makes you watch a re-enactment of a simulation that already happened while the game is simulating hundreds of 100-turn sequences in the background. This means that even if the CPU is choking through the neural networks, there is no visible FPS drop, only a mild slowdown of the training speed. Thank you, Rust, for this so-called "fearless concurrency".

While I find this educational and entertaining, the complexity of this design is ramping up very fast. I am currently trying to set up a paintball minigame of sorts where two factions of creatures compete to paint the map in their colour. I may fail and give up, or I may succeed and be inspired. We will see.

Videos:

An oddly satisfying anthill.

A tango line caused by a poorly thought out efficiency score formula. (walls disabled)

A well-trained population. (walls disabled)

Interplanar Travel For All

An endlessly giggling mess of ribbons under which some creature probably exists. Any hope of unveiling their identity is lost in their constant lunges and twirls across the pollen-tainted air.

"Ignorance and submission seem so comfortable... If I did not have the far-away beacon of enlightenment to guide me, I would have been lost long ago."

  • Ecstatic Ribbondancer flavour text

The Games Foxes Play

(complete source code - mirror | view all previous posts)

It has been a little harder cranking out code this week, but the forges of creation still blaze with maintained interest.

Dastardly Traps

Some new devious creatures have been added to the world generation pool:

  • the Arctic Phobist sits alone at the centre of empty rooms. Their constant dread of hypothermia permeates through surrounding minds, inspiring all to huddle and cuddle around it in search of warmth... Which tends to create dangerous piles of stacked foes, unleashed as soon as the Phobist is deactivated by a misfired ability. Its ability also extends to the player, making escape difficult when one is constantly being reeled in...

  • groups of Ecstatic Ribbondancers gather in small and cramped areas, and chaotically bounce all over the place like they are super rubber balls. Getting through these gauntlets without getting trapped requires careful steps... which one may not always afford to take when one is being chased by a horde.

Demonstration of the latter.

Interplanar Travel for All

  • A non-negligible quantity of techno-wizardry has now allowed me to keep loading and simulating creatures even when they are not located on the same Plane (floor) as the player. The technique used, which I like to call the "yellow pages", keeps an index of all specific creatures which are allowed to take input even if the player is not on the same Plane as them, and simulates their actions in a way that is accurate, but does not nuke the game's performance.

    • This is huge. I can't wait for the applications this new development will have, from banishing foes into pocket dimensions to programming bots to clear far-away Planes for you.
  • A new special teleportation Axiom allows one to "astral project" into a pocket dimension from your current position, which may be extremely dire. It reminds me a little bit of DCSS's Okawaru Arena, but with a little more interdimensional flair. I've been thoroughly enjoying the related animation...

Once again, demonstration. Ignore the minor graphical bug.

I am currently in the process of rekindling Epsilon, the multi-tile snake boss, with some extra new zaniness. A fearsome foe awaits...