Skip to content

#PROCJAM PuzzleScript + Tracery Tweaking the Content

Thu 7th November 2019

I’ve not been doing lots of #PROCJAM, but I’ve been slightly tweaking things to make the generated scripts feel a bit more complete, and I think I’ll keep doing this during the rest of the jam, as it’s quite satisfying.

Today I added a bunch more names to the possible list for generating the author name (obviously the author needs to be generated, the person clicking the “GENERATE” button doesn’t deserve the credit ;-)).

I also split up the colour lists, so now the background and wall are dark colours, the player and target are regular colours and the “crates” (things you push) are light colours, so now the levels generated have a much better contrast. This is something I’ll tweak further and I hope to build a way of generating colours where relationship between the colours is generated too (i.e. the background could be light and the player dark, instead).

half-decent-gen

I’ve also been brainstorming ways of getting Tracery to produce levels with just 1 player, and also with the same number of targets and crates. Neither are super easy, and I think will require me to manually put in a bunch of permutations that it can select from. It’s not too bad as it is though, as the multiple player cursors makes it interesting to solve the puzzles, and as long as there are more targets than crates, then the win condition (All Crate1 on Target) can be met.

I’ve also been thinking about how I can determine whether the level generated can be solved, either to regenerate the level or even the whole game script. I came across this PuzzleScript solver, which I will try to integrate at some point. Given the game is essentially Sokoban at the moment, with some slightly varied block moving rules, I think there will be plenty of solver code out there I could utilise. I’d rather not write my own solver as this is a jam, though I could consider that option if necessary.

The current code for this can be found at https://github.com/rikkiprince/procjam-puzzlescript-tracery. I refactored it a little, so now it’s in a class called Generator.

The script for above “game”, in case you want it:

title Rule Generation
author Dr Cecil Le Guin MBE

========
OBJECTS
========

Background .
darkred

Wall *
darkgreen

Player P
orange
00000
00.00
00000
00...
00...

Crate1 C
lightbrown
00000
0....
0....
0....
00000

Crate2 D
lightblue

Target T
red
00000
..0..
..0..
..0..
..0..

=======
LEGEND
=======

=======
SOUNDS
=======

================
COLLISIONLAYERS
================

Background
Target
Player, Wall, Crate1, Crate2

======
RULES
======

[ > Player | Crate2 ] -> [ Player | > Crate2 ] (bump)
[ > Player | Crate1 ] -> [ Crate1 | Player ] (swap)

==============
WINCONDITIONS
==============

All Crate1 on Target

=======
LEVELS
=======

*********
*..T.TTP*
*...*..**
*P...CPT*
*TP.*..T*
*.C...TP*
*********
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: