loveapplegames

Ludum Dare 56

Cellspace IDE: create your own games with cellular automata

I just created a "minimal viable product" IDE for Cellspace. In effect: you can create your own games with cellular automata. I improved on the original user interface a lot: a level editor, load/save function, better rule editing, and a nicer tileset. Games are saved in Cellspace format (a human readable text format).

Press "Edit" at the bottom to edit the level, "Run" to run the game if you changed the level or the rules.

At the top you can select the sprite. The green square at the very left indicates "ignore", which can be used to ignore cell positions in a rule. Once you've selected a sprite, you can edit rules as well as the level. Currently you can only edit only one level and you cannot yet change the tile set. Other things I plan to add are win/lose conditions and more user input options.

>>>Play Cellspace here<<<

Direct link to IDE (postcompo)

CellSpace_IDE1.png

Cellspace IDE update: create and share complete games using cellular automata

With Cellspace IDE you can create games without programming, using just cellular automata rules. Cellspace IDE is now updated with the following features: win/lose conditions, more keyboard controls, mouse controls, title, rule delay, clear level, and last but not least, URL sharing.

So you can now create a full game, and share your game using a self-contained URL. Unfortunately there's a bug in the LD site which means you cannot share the full URL via the Markdown features, so I shortened them with tinyurl.

Short instructions:

Press "Edit" to edit the level, "Run" to run the game if you changed the level or the rules. Games are saved in Cellspace format (a human readable text format). "Open Game URL" opens the game in a new tab, with the source embedded in the URL.

At the top you can select the sprite. Once you've selected a sprite, you can edit rules and win/lose conditions, as well as the level. The plain green square at the very left indicates "ignore", which can be used to ignore cell positions in a rule.

Limitations: Currently you can only edit only one level and you cannot yet change the tile set.

More info on how to work will rules is found in the Cellspace LD page and in my previous post.

>>>Play Cellspace here<<<

Direct link to IDE (postcompo)

Below are some games I made with CellSpace:

Cell Pacman

Harvey Wallbangers - draw walls to make the wallbangers pick up the flasks

Boulderdash - get all the diamonds

Cell Shooter - space to shoot

CellSpace-boulderdash.png

Cellspace IDE update, with 8 example games

Last chance to rate: CellSpace cellular automata sandbox and Cellspace IDE (postcompo version).

With the postcompo IDE you can create full games and share them easily. You can now share games that open in the IDE. I created 4 more example games, play and edit them via the links below.

My LD entry contains basic instructions

Some example rules explained in this post

Play and edit the example games

Douse the Fires - click to remove walls

Platform game - you cannot jump, fall onto the monsters to kill them

Escape Room - push the keys to unlock the locks

Tanks - destroy the tanks with fire

Boulderdash - get all the diamonds

Harvey Wallbangers - draw walls to make the wallbangers get the potions

Cell Pacman

Shooter - space to shoot

CellSpace-escaperoom1.jpg

Cellspace game maker postcompo release

Wow, 11th on innovation!

ld56-scores-crop.png

The rest of the ratings suck, unsurprisingly. My goal was to make a game where you can solve problems by defining object behaviours through cellular automata rules. I didn't really have enough time that weekend to make it into something really playable.

My goal was to turn this into a super low code game maker. You can create games by defining tile pattern transform rules with a point and click interface. The last few weeks I've been working on finalising this. It's currently focused on quickly creating one-level minigames that you can share via a data URL or even a QR code. Multiple levels and more features are planned. So hereby I proudly present:

Cellspace IDE and editor

CellSpaceemide/emgrab.png

Check out this QR code which contains an entire game! Use this QR generator with error correction set to low, to create QR codes up to 2953 bytes.

platformgame-qr.png

Ludum Dare 57

I'm in, with some of my own tools

Let's see how this goes. Tools I may use:

  • jgame.js (https://github.com/borisvanschooten/jgame.js)
  • tinyspriteeditor (http://tmtg.nl/tinyspriteeditor/) (https://github.com/borisvanschooten/tinyspriteeditor)
  • animated character generator (http://tmtg.nl/ludumdare/ld53-charactergen/)
  • CellSpace no-code IDE (http://tmtg.nl/cellspace.js/)
  • gimp
  • audacity
  • jsfxr (https://sfxr.me/)
  • LMMS (if I get round to music)
  • Pytorch or tensorflow.js - in case I include AI like last time

Below is an impression of my latest tools!

Cellspace IDE: create a game using cellular automata without any programming.

CellSpaceemide/emgrab.png

My (AI based) animated character generator: here are some sprites generated with it.

5bd5e.gif 5bd60.gif 5bd64.gif 5bd65.gif 5bd69.gif 5bf0b.gif 5bf07.gif 5bf08.gif 5bf09.gif 5bf10.gif

AI generated game ideas

Today I played around with the OpenAI API to create game ideas. I wrote a Python script that uses GPT to generate ideas, and Dall-E to generate corresponding gameplay images.

I fiddled around with prompts and used both Dall-E 2 and 3, so the prompts and images differ in size and quality. If there is interest I will share the source code later.

http://tmtg.nl/ludumdare/ld57-gameideas/

Screenshot 2025-04-05 at 20-38-14 85 game ideas generated by gpt-4o and dall-e 2 and 3.png

AdventureGen: an experiment in AI generated games

In the most recent LDs, I created some very experimental entries, with the goal of doing and learning something really new, even though the result may be a little obnoxious as an actual game. This time round, my entry has no direct connection with the theme, but instead, this is in the hands of the player: you can choose your own theme to generate a game.

Lately I've been playing around with chatbot APIs, so I thought, let's use this to generate games. I decided on a point and click adventure format, which seems to me one of the simplest game mechanics to start with. There are a limited number of actions: go from A to B, pick up object, use object. ChatGPT readily came up with fairly structured descriptions of small adventure games, including location descriptions and walkthroughs, so I thought, let's give that a try.

The basic idea of my game generator is that the AI (GPT-4o) generates a definition for a complete game, given a description of the game mechanic (e.g. the game goal and allowed actions) and a theme. I used OpenAPI's function calling feature to force the AI to create structured output. With function calling, you provide function descriptions to the AI, and then ask it to perform actions in the prompt. The AI then tries to map the desired actions onto available functions, and call them with appropriate parameters. Also it can process function output and tries to correct errors returned by the functions.

For the adventure game I invented some functions:

create_room(self, roomname, description, exits_to) create_item(self, roomname, itemname, description, can_be_picked_up) use_item_to_add_exit(self, itemname, on_item_or_in_room, source_roomname, target_roomname, description) use_item_to_create_new_item(self, itemname, on_item_or_in_room, new_itemname, new_item_description,new_item_can_be_picked_up,description) set_start_room(self,roomname,start_description) set_finish_room(self, roomname, finish_description)

I wanted to add some richness by having items that you can and cannot pick up, and actions can create new items as well as exits. To explain how the game mechanic works, check out the following text, which is taken literally from the GPT prompt:

The game consists of rooms and items. The game's goal is to go from the start room (the room in which the player starts) to the finish room (the room that completes the game when the player enters it). The player has to solve puzzles, which amounts to performing a number of actions to get to the finish room. The only available actions are: go to room, pick up item, and use an inventory item on another item. Using an item always has one of two effects: it creates a new item, or it adds an exit from one room to another.

My first prototype was very plain looking, with no graphics and only a few buttons to click, and a lot of errors, like missing rooms, missing or near duplicate items, and unsolvable puzzles. But the basic concept worked! I was very impressed that GPT could do this at all. I wanted to generate graphics to make the game look more interesting, and found a cheap AI image service that could create an image in less than a second (based on Flux Schnell). I asked GPT to also generate a graphical style that is appended to the image prompt, so as to get a sort of unified style throughout each generated game.

With some prompt tinkering and error correction (both on the AI and user interface side) I managed to generate games that are solvable about 60-70% of the time. The games are very simple and linear, and the puzzles often don't make sense. But at least the graphics are great! Sometimes it also comes up with interesting content. For example, I used "Dante's inferno" as a prompt, and it created Dante's nine circles as nine rooms in the game.

But anyway go judge for yourself! :smiley: I guess the real fun of my entry lies in seeing how the AI reacts to the player's prompts! I added a rating system postcompo, so it's possible to rate the games, to make it possible to find back the nicest games (or at least the ones that suck the least). Maybe each game could even be rated on the LD categories :wink:

I am thinking of what my next project will be. What about a shooter with AI generated enemy behaviour? In this case the AI would provide a piece of code that controls each enemy.

* >>> Play the game here <<< *

Screenshot 2025-04-14 at 09-37-46 Love's Enchanted Garden.jpg

Screenshot 2025-04-14 at 09-47-01 Journey to Valhalla.jpg

Last chance to try: AI based adventure generator

Only one day left to rate games! And one day left to check out my AdventureGen, my AI-based adventure generator. After the rating period is over, I will take the AI agent offline, because it incurs cost and is not quite production ready. I will move the generated games to another server, so they can still be played.

Thanks to everyone who generated and played games, and gave feedback!

Play the game here:

https://ldjam.com/events/ludum-dare/57/adventuregen

Screenshot 2025-04-25 at 15-58-04 Kaleidoscope Chase.jpg

Also check out my write-up on how it works:

https://ldjam.com/events/ludum-dare/57/adventuregen/adventuregen-an-experiment-in-ai-generated-games

I am now working on my next project, which is a IDE for creating shooters with AI-generated enemy behaviour. Which is going to look something like this...

Screenshot 2025-04-25 at 16-03-38 ActionGameGen design a game with AI generated behaviours.jpg

New experiment: shooter creation tool with AI generated enemy behaviour

Hi everyone, right after releasing my AI based point and click adventure generator for LD57, I already started on a new project: a shooter authoring tool with AI generated enemy behaviour. The first playable prototype is here!

You can generate enemies by describing their behaviour in natural language. The AI then codes Javascript files for the enemies, and generates sprites as well. The result can be immediately viewed in the browser. You can enable and configure the enemies through the web-based UI, so you can create suitable levels with the available material. The AI supplies additional behaviour parameters with each enemy (these are the options that start with "extra_"), so you can tweak the enemies further.

It can handle prompts that describe multiple enemies and shooting behaviour. Example prompts:

zig zags randomly, periodically spawning minions that circle around it. The minions shoot bullets that explodes into a spray of shrapnel when they are close to the player.

dashes randomly, either in random direction or towards the player. Fires a single arc of bullets when it dashes towards the player.

alternatively stands still and moves quickly in a random direction. Is invisible when standing still. Shoots a bullet when it starts moving. Bullets explode after some time into a spray of shrapnel.

It's still a prototype, you can define only one level that starts playing immediately, and load/save options are limited. You can create an URL to demonstrate your playable level. No unit testing is done on the AI generated code yet, so you will find some malfunctioning enemies. Some planned features are:

  • each user can create, modify and delete their own enemies
  • multiple levels
  • configurable player, background, and sounds
  • download full game (as a zip containing all the generated code).

Check out the tool here

Play an example game here

ActionGameGenGrab1-sm.jpg

Screenshot 2025-04-25 at 16-03-38 ActionGameGen design a game with AI generated behaviours.jpg

Ludum Dare 58

Level generation for boulderdash-like games

My goal for LD is usually to learn something new. I embark on overly ambitious projects, but usually something nice comes out (although not necessarily within the deadline).

This time, I wanted to do something with level generation and reinforcement learning. I did a lot of level generation in the past, mostly using hand-crafted algorithms.

My inspiration was this paper: https://www.youtube.com/watch?v=ml3Y1ljVSQ8 They use Q-learning to train level generation. Q-learning requires a reward function for every state and action, which is in their case based on the solvability of a level. One of their examples is Sokoban, which I think is an interesting game to generate levels for. I wanted to up the ante a little, and decided to try this for Boulderdash. My eventual goal is to be able to generate levels for a larger class of puzzle-action games, such as CellSpace games (this is a tool I created during LD56).

So I created a level solver for a very basic Boulderdash game, based on breadth-first search. It's basically a brute force search, searching the entire state space. It comes up with the shortest path to complete a level. However, it turns out to be very slow. Even after some optimisations, it would slow down to >20 sec and eventually run out of memory for levels larger than about 6x6 tiles. This is because of combinatorial explosion: every step increases the search space up to 4-fold, because there are 4 possible actions (up, down, left, right).

Boulderdash BFS Solver-sm.jpg

I did not want to add game-specific optimisations to prune the state space. Instead I decided to try and use reinforcement learning to create a more universal (aka "model free") solver for larger levels. Last night, while I was asleep, I had my PC generate a dataset of optimal paths through 2500 random 6x6 levels using the brute force solver, serving to bootstrap my reinforcement learning system. If I can get this to work for larger levels than 6x6, it can generate new training data through self-play and support progressively larger levels (see the figure below).

DQNSolver.drawio.png

Today I trained a neural net (a 5-layer Deep Q Network, based on convolution, with 2 million parameters) with part of the dataset, using Tensorflow JS, which I used before for browser games. TFJS support for CUDA sucks though, so I actually train it in the browser because it's the fastest. After some 20mins of training, it manages to find paths 100% of the time for seen levels, and about 60% of unseen (but known solveable) levels. It's clearly overfitted (apparently it has memorised the optimal paths of some 500 levels), but already has usable performance on 6x6 levels. However, on larger levels, it still falls down, with 10% performance on 8x8 levels and near zero for 10x10 levels. However this is still a first attempt, and there are a lot of things to try out, like hyperparameter optimisation and dataset improvement, so I'll be spending the next 24 hours trying to get this to work, and hopefully come up with a game with interesting generated levels!

Ludum Dare 59

I'm in, for a learning experience with AI

In the last LDs my main goal was to learn something new. AI is a divisive subject, as I noticed with my previous AI projects. However, as a professional software engineer, I use AI a lot to accelerate my work. It's the biggest technical breakthrough since the compiler, and cannot even afford to ignore it. And if it helps me create better games faster, I think I should definitely learn how to use it better, even if it means delegating work to something that's not entirely under my control. In the last LDs I did things like:

  • create my own image GenAI (it sucked, it was my first GenAI, but eventually I turned it into a walking character generator.

  • training AIs in the browser as part of the gameplay

  • use LLMs to let the player create entire games according to a particular structural framework. I got significant hate from that, but I eventually developed this into a new AI toolkit, which I now use professionally.

I am dabbling with the idea of having the player create the game as they are playing it (other than text adventures, which has been done), and with accelerating game development by prompting game components other than images and sound (like generated maps and entities).

I might use AI generated images, but not in the regular way. An interesting challenge would be to create the entire dataset and train the AI within the LD time frame, or train it from user input.

Tools I may use:

  • jgame.js (https://github.com/borisvanschooten/jgame.js)
  • tinyspriteeditor (http://tmtg.nl/tinyspriteeditor/) (https://github.com/borisvanschooten/tinyspriteeditor)
  • my animated character generator (http://tmtg.nl/ludumdare/ld53-charactergen/)
  • CellSpace no-code IDE (http://tmtg.nl/cellspace.js/)
  • gimp
  • audacity
  • jsfxr (https://sfxr.me/) or some such
  • LMMS (if I get round to music, I think not)
  • Pytorch or tensorflow.js - in case I include AI like last time

Happy jamming everyone!

Super Glop Arcade: an exercise in AI code generation

For me, LD59 was an attempt to accelerate my gamedev workflow using AI coding techniques, where my goal was to have my game code 100% AI generated, without losing control over the game design. I am interested in other LD entries that have mostly or fully AI generated code. As of yet I found only one game, called Codevibes, which is described as "vibe coded". So if you have an AI coded entry, please respond to this post and I will play your game!

This experiment is only about AI coding, as the graphics are hand drawn, and the (newly added) sound is generated using ZzFX (an SFXR variant). I managed to create 9 small games with 100% AI generated code in less than a day. These aren't very exciting from a gamer's point of view, but they serve to test my coding technique on different game mechanics.

Years ago did a similar exercise, where I created 8 games in a weekend, to test my (then newly updated) game library. The result is similar (I finished the games but they have some rough edges), but done in less time. So in that sense it was a success.

The rest of the LD period I adapted my game library to be more suitable for AI generation, while enjoying my vacation in Seville, which looks something like this:

laptop-vacation-image-grid.jpg Me having a vacation while the AI does all the hard work

Last week I tinkered some more with the games, ironing out some of the rough edges, and adding sound and particles.

>>>Play the original game and the postcompo here!<<

Now, about the technique I used. I did not use vibe coding, but instead, I use the AI as a 'compiler' to compile technical specifications into code. I split the game into components and then let AI generate each component. I used the WebCogs VS Code extension to specify component prompts via what I call 'prompt buildfiles', and also created a new VS Code extension for quickly generating sounds. The prompt buildfiles include overall technical specifications of the relevant game library functions, and for each component, a description of the component. I also instructed the AI to add configuration parameters (such as entity speed, fire rate, etc), so that each component can be configured by changing input parameters. I modified these manually to tweak the gameplay.

AI generated component types I now have are:

  • map generators: these output maps with ASCII characters, which are converted to tiles and entities by the game library. Example prompt:

Create a function that generates a scramble type level. Each tile is either: wall (@), empty (.), rocket (!), UFO (u), or player (S). The level consists of a horizontal cave/tunnel, with varying position and height, with a minimum height of 6 and maximum height of 12. Rockets are placed randomly on the floor along the tunnel, and UFOs in the middle. The leftmost 20 tiles of the tunnel are straight. The player is positioned at the middle left.

  • entities: describes the behaviour of each game entity after being placed on the map. An entity can spawn other entities, manipulate the tile map, collide with entities, etc. Example prompt:

Create an enemy that shifts slowly and smoothly around in a fixed pattern. Occasionally it swoops down in curved patterns until it encounters a wall, then flies back to its original position. When it swoops down, it shoots bullets towards the player, but only if the player is below or diagonally below the enemy. The enemy dies when it hits a player bullet. Bullets pass through player bullets.

  • particle generators (newly added after the compo): generates particle effects given at a particular position and effect size, like smoke and explosions. Example prompt:

Create a particle generator that generates a flying fish firework effect. There are two types of particles: cloud and fish. The cloud particles are shown on top, are large and white, move slowly, and fade quickly. The fish particles first move away from the center, then veer away at random moments in random directions with angles up to 180 degrees. Choose 2 different saturated colors for every effect. Fish particles have either of these 2 colors.

The maps, entities, particles, and sounds are tied together into a game using a single javascript file with just configuration tables. This defines the ordering of the levels, the mapping between map characters and tiles/entities, and the available animations, and particle and sound triggers.

For example, a level is defined like this: { "name": "Space shooter", def: "stdlevel", "type": "galaga", "tilemap": { nrtilesx: 32, nrtilesy: 18}, bg: "levelbg", "wincond": () => { return JGObject.countObjects(null,enemy_mask) === 0 } },

Entities and tiles are defined like this:

// cave shooter "Q": {entity: function(tx,ty) {createEntity("caveplayer",false,tx,ty,player_mask,"caveplayer")}}, "C": {entity: function(tx,ty) {createEntity("caveenemy",true,tx,ty,enemy_mask,"caveenemy")}}, "&": {tile:4, mask: getTileMaskDef("wall"), onRemove: {particle: {type: "flame",size: 20,sprite:30}, sound: "dig"}},

And animations like this:

"caveenemy": {anim: {start:14,end:14,speed:0.2,always:false,vertical:true, dir:"nodir"}, onRemove: { particle: {type: "fisheffect",size: 40,sprite:30}, sound: "caveenemyexplo" }, },

Altogether a successful result, I think. The generated code was pretty good, considering the straightforward prompts I used, but the AI had trouble generating code for some of the maps, in particular the platform and pac-man levels. This can often be resolved by giving more specific instructions, such as what algorithm to use, but I did only limited prompt tinkering. Another was that in my current setup, I had a lot of maps, entities, sprites, particles, etc., to create all the 9 games, which became difficult to keep track of in the configuration tables. For example, I have about 30 different tiles and entities, which means I started running out of ASCII characters at some point. I tried to do everything from within VS code, with help of some extensions, but I may want to create a dedicated game development GUI at some point.

Cooldown game: the Generative Gungeon

Yesterday I spent most of the day making a new game with my newly developed AI code generation technique to see how well it works for a more complex game. So I present the Generative Gungeon, a hard Roguelike Gauntlet-like maze/dungeon shooter with random levels, featuring 100% AI generated game code.

>>>Play the game here<<<

image-grid-generative-gungeon.png