Category: GameDev

  • Unity Web build configuration

    I always have issues when publishing to a Unity Web target – usually the issues stem from compressed builds. Here is the configuration I use.

    Build Profiles / Platform Settings

    • Set Code Optimization to Runtime Speed rather than Shorter Build Time

    Player Settings

    • Set Company Name
    • Set Product Name
    • Set Version

    Player Settings / Resolution and Presentation

    • Set Default Canvas Width and Height to same as game
    • Set WebGL template to PWA
    • Set Product Description

    Player Settings / Other Settings

    • Set Managed Stripping Level to Minimal (if you get errors with the default of Low)

    Player Settings / Publishing Settings

    • Set Compression Format to Gzip

    Apache 2

    Add a .htaccess file with the content from the section Use the virtual host in .htaccess method.

    Ensure the user and group of the folder is set to www-data:www-data (chown) otherwise the Content-Type set in the .htaccess is not run (despite the .htaccess file is still parsed and shows up in the Apache error log).

  • Asteroids

    It’s been a while (I got busy with a new job, and kind of forgotten about doing this gaming series), but the next game I’ve made using Unity is an Asteroids clone. Source code on GitHub.

  • Pong

    The next game I’ve made using Unity is a Pong clone. Supports two players on keyboard. Source code on GitHub.

  • Snek

    The next game I’ve made using Unity is a Snake clone – Snek. Supports two players on keyboard. Source code on GitHub.

  • Floppy Bird

    I’ve played around with Unity a few years ago (which never eventuated in anything), Roblox Studio last year (which was great to introduce programming to my kids), and Unreal Engine this year (which I felt was overwhelmingly the most difficult). I’ve come back to Unity with a view of recreating some simple games to understand their mechanics and keep me up-to-date on C# and .NET. The first game I’ve created is a Flappy Bird clone, and I got my kids to help me with the graphics for the game.

    Thanks to the WebGL compilation target, you can play it here (use space or click/touch to fly) and and find the source code on GitHub.