How to use continuous preview

2

Stats

6,320 visits, 11,313 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 9 Apr, 2013. Last updated 19 Feb, 2019

Continuous preview is a feature in Construct 2 that allows you to preserve the gameplay state when previewing. This also makes it possible to design levels as you play through them. Normally pressing Preview will restart the layout or project from the beginning. Continuous preview allows you to make a change then apply that update to the currently previewing game without resetting it.

Here's a quick video by Tom demoing the feature:

Subscribe to Construct videos now

How to do a continuous preview

Just hold Shift while clicking Preview or pressing the keyboard shortcut (F4 or F5). When the browser opens for previewing, the URL will end in ?continuous to indicate a continuous preview, e.g. http://localhost:50000/?continuous.

If you press the browser refresh button while ?continuous is in the URL, you'll reset it to where you were the last time you pressed Shift+Preview.

If you don't hold shift and preview again, you'll get a normal preview (resetting to the start) and the ?continuous part of the URL in the browser window will disappear.

How continuous preview works

A normal preview just reloads your game, which resets it. However a continuous preview first saves the game, then reloads it to use your new events and other project changes, then loads the game again. This happens quickly, so the impression is an update while continuing to play the game.

Note this means your first preview can't be continuous - there's nothing saved yet. Your first preview will always be a normal one from the start (even if you try to continuously preview),

Using continuous preview effectively

Continuous preview loads the previously saved game, and this means there are a couple of limitations on what it can do. If you change your events then continuously preview, everything should work fine - the game will carry on from where you left off with the new events in effect. However if you add some new scenery or backgrounds, those will not appear in a continuous preview unless you give them the No Save behavior.

The reason for this is after a continuous preview, the 'Load game' phase will simply restore all objects exactly as they were when the save happened. If the objects weren't there when it was saved, they still won't be there after it loads. Adding the No Save behavior gets around this; they are neither saved, nor affected by loading. This is only suitable for static objects like scenery and backgrounds. If you add 'No Save' to the enemies or powerups in your game, they also won't be loaded and so will reset even when you continuously preview. On the other hand, we want scenery and backgrounds to reset, since it's then possible to edit them live while playing the game.

So a limitation of continuous preview is that currently it doesn't allow you to change objects that are saved in the editor, unless you do a normal preview again which resets everything. It does still allow you to design levels as you play them, though.

It's good practice to add No Save to static objects anyway - it helps make the savegames smaller, and save and load more quickly.

The Pause on unfocus project property is also useful with continuous preview. Setting it to Yes will cause the game to pause when you switch focus back to the Construct 2 editor. This prevents your player dying, running out of time, etc. while you make changes in the editor, so you can continuously preview from a sensible point.

  • 2 Comments

  • Order by
Want to leave a comment? Login or Register an account!