{"id":11192,"date":"2022-03-18T13:53:51","date_gmt":"2022-03-18T11:53:51","guid":{"rendered":"https:\/\/www.tuni.fi\/playlab\/?p=11192"},"modified":"2022-03-18T13:53:51","modified_gmt":"2022-03-18T11:53:51","slug":"imagining-mechanics-and-typing-pixels-in-puzzlescript","status":"publish","type":"post","link":"https:\/\/www.tuni.fi\/playlab\/imagining-mechanics-and-typing-pixels-in-puzzlescript\/","title":{"rendered":"Imagining mechanics and typing pixels in PuzzleScript"},"content":{"rendered":"<p><a href=\"https:\/\/www.puzzlescript.net\/\">PuzzleScript<\/a> is an open-source, browser based tool for making small grid based games by indie game developer <a href=\"https:\/\/www.increpare.com\/\">Stephen Lavelle<\/a>. Published already in 2013, it\u2019s still the lesser known gem among the other small game makers.<\/p>\n<p>I can\u2019t quite remember when or how I was introduced to PuzzleScript, but I was immediately hooked. I had sort of been wanting to at least try out making games, but hadn\u2019t really come across a tool I would feel comfortable with. Unity and Godot felt daunting in their complexity. Twitch was simple, but I had no interest in writing text based narratives. PICO-8 still feels more like a thing for programmers to show off their coding skills rather than a tool for newcomers. Bitsy is charming, but very limited in what it can do.<\/p>\n<p>The first look of the editor view might not feel that inviting or intuitive. The right side of the screen shows a playable preview of the game, with plenty of example games available. Below that is a console for error messages and a little widget for creating sound effects. Everything that makes the game is written on the text panel on the left, under separate headings for objects, sounds, rules, levels, etc. Even the graphics are \u201cdrawn\u201d in text, with numbers representing different colored pixels, like so:<\/p>\n<p><a href=\"https:\/\/www.tuni.fi\/playlab\/wp-content\/uploads\/2022\/03\/cat.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-11196\" src=\"https:\/\/www.tuni.fi\/playlab\/wp-content\/uploads\/2022\/03\/cat.png\" alt=\"\" width=\"523\" height=\"246\" srcset=\"https:\/\/www.tuni.fi\/playlab\/wp-content\/uploads\/2022\/03\/cat.png 523w, https:\/\/www.tuni.fi\/playlab\/wp-content\/uploads\/2022\/03\/cat-300x141.png 300w\" sizes=\"auto, (max-width: 523px) 100vw, 523px\" \/><\/a><\/p>\n<p>PuzzleScript takes pixel based retro aesthetics to the extreme, with objects only 5 by 5 pixels in size. This restriction is somewhat emblematic of the general design philosophy of the platform. The focus is on making it easy to implement ideas into something playable without getting sidetracked into visual finessing. My pleas on the forum for better resolution sprites have met with a verbal equivalent of a shrug. But now that forks like PuzzleScript+ have made this possible, I usually end up using the original version for both the simplicity and for the challenge of making pleasant looking graphics within the constraints.<\/p>\n<figure id=\"attachment_11197\" aria-describedby=\"caption-attachment-11197\" style=\"width: 833px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.tuni.fi\/playlab\/wp-content\/uploads\/2022\/03\/adventuregame.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-11197 size-full\" src=\"https:\/\/www.tuni.fi\/playlab\/wp-content\/uploads\/2022\/03\/adventuregame.png\" alt=\"\" width=\"833\" height=\"517\" srcset=\"https:\/\/www.tuni.fi\/playlab\/wp-content\/uploads\/2022\/03\/adventuregame.png 833w, https:\/\/www.tuni.fi\/playlab\/wp-content\/uploads\/2022\/03\/adventuregame-300x186.png 300w, https:\/\/www.tuni.fi\/playlab\/wp-content\/uploads\/2022\/03\/adventuregame-768x477.png 768w, https:\/\/www.tuni.fi\/playlab\/wp-content\/uploads\/2022\/03\/adventuregame-320x200.png 320w\" sizes=\"auto, (max-width: 833px) 100vw, 833px\" \/><\/a><figcaption id=\"caption-attachment-11197\" class=\"wp-caption-text\">Figure: Work in progress in the Puzzlescript editor: Small adventure game with randomised world, line of sight and mapping.<\/figcaption><\/figure>\n<p>The script part in PuzzleScript is in fact extremely simple and easy to grasp. The mechanics are defined by a list of simple rles, basically if \/ then statements based on the movements and positions of the objects in relation to each other, with no variables or numeric calculations involved.<\/p>\n<p>Let\u2019s take an example. Here are the mechanics for the classic box pushing puzzle game Sokoban, expressed in one line.<\/p>\n<pre>[ <span style=\"color: #ff00ff;\">&gt;<\/span> <span style=\"color: #008000;\">Player<\/span> | <span style=\"color: #008000;\">Crate<\/span> ] <span style=\"color: #ff0000;\">-&gt;<\/span> [ <span style=\"color: #ff00ff;\">&gt;<\/span> <span style=\"color: #008000;\">Player<\/span> | <span style=\"color: #ff00ff;\">&gt;<\/span> <span style=\"color: #008000;\">Crate<\/span> ]<\/pre>\n<p>This basically says \u201cif a player is next to a and crate moves towards it, move both one step to that direction.\u201d Add a win condition that crates need to be moved on targets, draw some levels either with characters or a simple level editor, and you have a game.<\/p>\n<p>Add another rule, and now the player can pull the crates too.<\/p>\n<pre>[ <span style=\"color: #ff00ff;\">&lt;<\/span> <span style=\"color: #008000;\">Player<\/span> | <span style=\"color: #008000;\">Crate<\/span> ] <span style=\"color: #ff0000;\">-&gt;<\/span> [ <span style=\"color: #ff00ff;\">&lt;<\/span> <span style=\"color: #008000;\">Player<\/span> | <span style=\"color: #ff00ff;\">&lt;<\/span> <span style=\"color: #008000;\">Crate<\/span> ]<\/pre>\n<p>Make three gems in a row disappear? Poof!<\/p>\n<pre>[ <span style=\"color: #008000;\">Gem<\/span> | <span style=\"color: #008000;\">Gem<\/span> | <span style=\"color: #008000;\">Gem<\/span> ] <span style=\"color: #ff0000;\">-&gt;<\/span> [ | | ]<\/pre>\n<p>It\u2019s very easy to learn the script by tinkering with rules, sometimes coming up with interesting new mechanics. Once you get more familiar with it, the script is surprisingly versatile, though some things are still easier than others: I can implement randomised labyrinths or flawless pathfinding in just three rules, but have no idea how to even get started drawing a circle.<\/p>\n<p>PuzzleScript is not just for making puzzles either. Designing a walking simulator is very similar to making one in bitsy, but with the benefit of being able to add more complex features if needed. While designing games that are not turn based is a bit tricky and smooth multiframe animations might not be worth the trouble, any genre that can be implemented on 2D grid is certainly possible.<\/p>\n<figure id=\"attachment_11195\" aria-describedby=\"caption-attachment-11195\" style=\"width: 480px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/www.tuni.fi\/playlab\/wp-content\/uploads\/2022\/03\/ezgif-4-8f3d13b570.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-11195 size-full\" style=\"margin-bottom: -1ex;\" src=\"https:\/\/www.tuni.fi\/playlab\/wp-content\/uploads\/2022\/03\/ezgif-4-8f3d13b570.gif\" alt=\"\" width=\"480\" height=\"360\" \/><\/a><figcaption id=\"caption-attachment-11195\" class=\"wp-caption-text\">Figure: Older grid based games are fun projects to remake in PuzzleScript. Here&#8217;s my version of Boulder Dash.<\/figcaption><\/figure>\n<p>I am not a game designer, at least in a sense that I would go advertise it as a skill on my LinkedIn profile. Yet, I make games. For me, PuzzleScript is something between a hobby and a pastime, and definitely one that has changed and deepened my relationship with games in general. I\u2019m much more tuned to analysing the gameplay from a developer perspective and find myself thinking, how could the core of that mechanic be implemented in PuzzleScript? Or even, what would that visual style look like reduced to 5 by 5 pixel tiles? For me, making games has become a game in itself.<\/p>\n<p>Some of my games are demakes or variations of older ones, some are more original in their concept, some just simple experiments. Most are unfinished, and will remain so. Though I\u2019ve not been active making my creations available to others, many have. Itch.io currently lists <a href=\"https:\/\/itch.io\/games\/made-with-puzzlescript\">over 1200 games made with PuzzleScript<\/a>. Pick a random one and the changes are that it is the first game the designer has made. Maybe they are taking their hobby further, perhaps not. That\u2019s hardly the point. For anyone interested in games, making even small ones can be a truly rewarding experience.<\/p>\n<p><strong>Pictures:<\/strong> Screenshots from games made by the author.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The charm of small game makers is in making game development an accessible hobby for everyone.<\/p>\n","protected":false},"author":135,"featured_media":11198,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[1296],"tags":[1635,1639,1637,1440,1636],"class_list":["post-11192","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-toys-and-gadgets","tag-game-developmen","tag-hobbies","tag-pixel-art","tag-puzzles","tag-tools","entry","has-media"],"_links":{"self":[{"href":"https:\/\/www.tuni.fi\/playlab\/wp-json\/wp\/v2\/posts\/11192","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tuni.fi\/playlab\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tuni.fi\/playlab\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tuni.fi\/playlab\/wp-json\/wp\/v2\/users\/135"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tuni.fi\/playlab\/wp-json\/wp\/v2\/comments?post=11192"}],"version-history":[{"count":0,"href":"https:\/\/www.tuni.fi\/playlab\/wp-json\/wp\/v2\/posts\/11192\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tuni.fi\/playlab\/wp-json\/wp\/v2\/media\/11198"}],"wp:attachment":[{"href":"https:\/\/www.tuni.fi\/playlab\/wp-json\/wp\/v2\/media?parent=11192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tuni.fi\/playlab\/wp-json\/wp\/v2\/categories?post=11192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tuni.fi\/playlab\/wp-json\/wp\/v2\/tags?post=11192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}