Best practices

Back up regularly!

Neither the hardware nor software in your computer is perfect. Computers fail and software can crash. Back up your projects to protect yourself from losing work. It is essential to also maintain off-site backups. If all your backups are in the same computer or saved to disks all in the same building, catastrophic events like fire, floods, theft or simultaneous hardware failure can cause you to lose all your work and backups together.

Construct 2 has built-in features to easily make automatic backups, including off-site backups using Dropbox. For more information see the tutorial Keep your work safe with Construct 2's backup options.

This advice is not specific to Construct 2. It is vital to adopt this practice for any work on a computer which is important to you. Do not wait until you've lost work before starting to do this. People lose work regularly from having poor backup practices. Don't be one of them!

Test on multiple browsers and devices

It is highly recommended to test your game works as intended in a range of different browsers. While HTML5 is a standard which in theory is implemented the same by all browsers, in practice there are variations between browsers (e.g. in performance, features, text rendering, etc). You should install a range of browsers and test with them all to ensure your game will work well for everyone. Use the Preview browser property to test desktop browsers and preview on a local network to easily test mobile browsers.

Support touchscreen devices

Many users now browse the web with touchscreen devices with no mouse or keyboard. If at all possible, you should design your game to also support touchscreen devices, perhaps with on-screen touch controls. For more information, see the tutorial on touch controls.

Recommended file formats

You may wish to prepare artwork and audio in other software before importing to Construct 2. The best formats to use are:

32-bit PNG (Portable Network Graphics) for images. Be sure to select 32-bit if you are given a choice; the 8-bit or lower versions will degrade quality. 32-bit PNGs are lossless and fully support alpha-channel transparency. Note the default Windows Paint does not support PNG transparency. Use a different editor instead, like Paint.NET.

You can choose different export formats like JPEG inside Construct 2 to reduce the size of your finished project. However when importing you should still stick to 32-bit PNGs if possible, and leave Construct 2 to recompress them when exporting. For more information on how images are optimised for you see Construct 2's export-time optimisations. It is unlikely that any third party tools or services will be able to beat what Construct 2 already does unless they degrade the image quality, and remember there is no point optimising images before importing them to Construct 2 since it stores them in projects as 32-bit PNGs with default compression settings.

16-bit PCM WAV for audio. These are typically .wav files, but note that not all .wav files are 16-bit PCM. Providing you are on Windows 7 or newer, importing a 16-bit PCM .wav file to Construct 2 will automatically encode it to both AAC and Ogg Vorbis. These are the two formats necessary to support audio in all browsers. For more information see the manual entry on the Import Audio dialog.

Security

Never, ever enter usernames or passwords in to events. These will be visible in plain text in the exported Javascript, and malicious users will very quickly be able to take control of the account. If you need to connect to something like a database, write a server-side script that talks to the database, then connect to the URL of the server.

Performance

There are a number of best practices in regards to game performance (ensuring the game always runs fast). Perhaps the most important is when developing for mobile, test on the target mobile device from the start. Your computer could be 10 or 20 times faster than your mobile device, and something which runs fast on your computer may be unplayably slow on the mobile device. For more information see the section on Performance Tips.

Memory use

Some designers are tempted to design entire levels from lots of large image tiles. This method should be avoided at all costs since it is extremely wasteful with memory, and is not used by any professional game designers. The subject is discussed in detail in the blog post Remember not to waste your memory.

Effects

Remember effects require WebGL to display, which is not always supported. Be sure to set up appropriate fallbacks and test your project with WebGL disabled to ensure it will appear correctly for users whose systems do not support it.

Managing projects

If you are working in a team, you will probably find source-control software like SVN very useful for managing a folder-based project. It can merge changes and highlight the changes each person has made. There is also a history of all changes available and rollbacks can be made at any time. Construct 2 saves project data in XML format so it is well suited to this type of management. For more information see the tutorial How to collaborate on projects with SVN.

Working as an individual

If you are working on a project by yourself, it is probably easiest to use single-file projects (.capx files). If the project gets large over time, you may notice Construct 2 spends more time saving and loading projects with Decompressing CAPX... or Compressing CAPX... in the status bar. At this point it is probably useful to convert to a folder project which skips these steps and will make saving and loading faster.

Tags: