<img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=4958233&amp;fmt=gif">
 
RSS Feed

Software Engineering | Olaf Spiewok |
04 July 2023

Unity, the popular cross-platform game engine, already comes with a ton of features and many user-friendly tools. However, all of us might have reached the point where we recognised the need for a missing feature and thought: “Ok, that is something that Unity should have built-in already!” The moment you realise this, you might want to start working on your own packages, which you then share with like-minded developers across the world.

That’s precisely how we think here at Endava! When we detect that a piece of code or a tool is used more than once within multiple projects, we build a shared package to improve maintenance and simplify reusability.

Creating tools helps you to improve your productivity. Tools can save time, reduce the cost spent on repetitive tasks and reduce the risk of errors by streamlining the build and deploy processes. The time and effort saved by using a tool will enable you to spend that time on more important tasks or may simply help you to shorten your time to market and make your builds available much faster – especially for Games as a Service, shortening release cycles is critical for the success of a game.

We think sharing our experience with you is the next logical step in trying to make such tools universal since every piece of feedback and usage will help to improve them further – and maybe convince Unity to include these features into their product…

Let’s take a look at some of our new tools and Unity packages in this 2-part series!

Unity Build And Deploy

  • Developers: Robert Stamm, Christopher Etmer, Olaf Spiewok
  • Unity compatibility: 2020.x – latest
  • BuildAndDeploy on Github

 

Introduction

Once your development gets to the point where you can build your project for your target platform and test it there, you may need to create variants for each build target and environment. Unity is doing a great job of streamlining the build process by using platform-specific project build settings where you can configure all the parameters properly. But as soon as you want to have multiple builds on the same platform – like having Production, Staging and Development builds with different properties, like project name, version, ID, preprocessor flags etc. – you reach the limit of Unity’s current build capabilities.

With our BuildAndDeploy package, you can reconfigure the build settings of a project by using multiple build configurations, thus bypassing the restrictions of the general Unity Build Settings.

Our motivation

BuildAndDeploy allows you to create multiple different build configurations, so-called Build Process files, for the same target platform. Think of targeting a standalone Windows build, which needs Steam, Epic and retail build configurations that all share the same Project Player Settings. Thanks to Build Process objects, we can support different target properties and library configurations since each process takes care of the necessary preprocessing and building steps. Another example could be an Android build, which needs to adapt depending on Google, Amazon or Amazon Kids targeting, with different keychain settings and library configurations.

Each build can be configured and extended through various settings and pre- and post-build steps, including code adjustments, library inclusion, asset building, file process methods and more. You can also add custom steps and custom ‘modules’, which will allow you to completely adjust the build to your needs and desires.

Streamlining the build properties and the options for pre- and post-build tasks can be quite a time saver since every task that has to be adjusted manually takes away from other great things you could do during that time.

Control your build using build process objects

Once the package is installed using the Package Manager, Build Process objects are available on the BuildAndDeploy menu and allow you to re-adjust the build as you need:

In general, every Build Process will ‘mimic’ the main build settings, which you can find within the Unity Build Settings menu, but it includes many additional features.

Unity-Tools-Part-1_image1

The Build Process contains so-called ‘modules’ that allow you to configure every part of the build pipeline.

Unity-Tools-Part-1_image2

Any inconsistencies or errors flagged by the package will help you configure each build process correctly. Validation is an essential part of the build process since it can become very frustrating to wait for a build – which can take hours – and then discover that some steps were misconfigured. In addition, you can toggle, extend and properly test every module, including specific parts of your pre-executed steps, like file copying. You can also choose to create an isolated logging file within the build process, making it easy to track and inspect any errors and warnings without the need to navigate through all of the Unity log files and their complexities.

Unity-Tools-Part-1_image3

Once you have completed your Build Process file, you build your variant using the ‘Build’ button and wait – as you would typically do since this is generally a time-consuming process.

BuildAndDeploy can be used if the build is started within the Editor, is a Unity Cloud Build or is started as part of a command line pipeline.

Customise your Unity build

Since building a cross-platform game always requires adjustments in several of the platform-specific project settings, a core element of the build process is its extensibility. For example, if you need an additional module that takes responsibility for downloading additional data, like updated localisation information or assets, before building, you can create your own module to do this and add it to your build process.

Unity-Tools-Part-1_image4

There are several ways in which you can customise the build process to your needs:

The package itself includes the ability to perform some common steps, like changing compiler flags or running platform-dependent tasks. These are a good starting point for understanding the possibilities of build customisation.

Furthermore, every build process can detect additional ‘module code snippets’ within the project and render them inside its Build Process Inspector. There are no limits to the code you can add; within a module, you can do whatever you want. Just bear in mind that a module should be something essential that every part of your build requires.

Unity-Tools-Part-1_image5

Finally, if you just need to adjust a small part of your settings for a specific platform, consider customising the pre-/post-build steps. These are responsible for performing tasks before and after the execution of a build and are a good place to include simple file execution processes, like renaming files, changing project setting properties, adjusting Xcode or Android Studio project files, increasing version numbers etc. It’s up to you what you want to use these steps for, and extending them is usually good practice.

Unity-Tools-Part-1_image6

Validation and parameterisation of each build step entry provide flexibility and create well-documented, highly reusable tasks within your custom build process.

Conclusion

Our BuildAndDeploy package enables you to easily create highly customised builds for multiple platforms. We’ve added many customisation capabilities that allow you to include and extend our package within your project code base or build an add-on package on top of it. Streamlining a build can spare you a lot of time and headache, and using a continuous integration system for your build will increase the benefits further since every place where we can automate configuration adjustments is a win.

Even if Unity decides to extend the existing build process feature to allow for similar platform setting entries, our tool will still be useful since having pre- and post-execution tasks is a valuable feature that our engineers love to use.

In the next part of our Unity tools series, we’ll meet our UXML Binding Generator.

 

Olaf Spiewok

Senior Developer

Olaf has been part of Endava for more than 13 years, with his focus being on game development. As a universal game development whizz, he is comfortable working with different platforms, like standalone systems, Nintendo DS, television, or mobile, and frameworks, among them Unity, React, Cocos, Android, and iOS – and the associated variety of programming language skills. Olaf is proficient in a diverse range of game development areas, including UI, workflow, gameplay, integration, and maintenance. Besides his development work, Olaf spends his free time with his family and dog, playing games – digital and analogue, indoors and outdoors – as well as learning to understand the Berlin dialect.

 

FROM THIS AUTHOR

  • 11 July 2023

    Boost Your Game’s Success with Tools – Part 2

  • 04 January 2022

    Create Production-Ready, Automated Deliverables Using a Build Pipeline for Games – Part 2

  • 16 November 2021

    Create Production-Ready, Automated Deliverables Using a Build Pipeline for Games – Part 1

 

Archive

  • 13 November 2023

    Delving Deeper Into Generative AI: Unlocking Benefits and Opportunities

  • 07 November 2023

    Retrieval Augmented Generation: Combining LLMs, Task-chaining and Vector Databases

  • 19 September 2023

    The Rise of Vector Databases

  • 27 July 2023

    Large Language Models Automating the Enterprise – Part 2

  • 20 July 2023

    Large Language Models Automating the Enterprise – Part 1

  • 11 July 2023

    Boost Your Game’s Success with Tools – Part 2

  • 04 July 2023

    Boost Your Game’s Success with Tools – Part 1

  • 01 June 2023

    Challenges for Adopting AI Systems in Software Development

  • 07 March 2023

    Will AI Transform Even The Most Creative Professions?

  • 14 February 2023

    Generative AI: Technology of Tomorrow, Today

  • 25 January 2023

    The Joy and Challenge of being a Video Game Tester

  • 14 November 2022

    Can Software Really Be Green

  • 26 July 2022

    Is Data Mesh Going to Replace Centralised Repositories?

  • 09 June 2022

    A Spatial Analysis of the Covid-19 Infection and Its Determinants

  • 17 May 2022

    An R&D Project on AI in 3D Asset Creation for Games

  • 07 February 2022

    Using Two Cloud Vendors Side by Side – a Survey of Cost and Effort

  • 25 January 2022

    Scalable Microservices Architecture with .NET Made Easy – a Tutorial

  • 04 January 2022

    Create Production-Ready, Automated Deliverables Using a Build Pipeline for Games – Part 2

  • 23 November 2021

    How User Experience Design is Increasing ROI

  • 16 November 2021

    Create Production-Ready, Automated Deliverables Using a Build Pipeline for Games – Part 1

  • 19 October 2021

    A Basic Setup for Mass-Testing a Multiplayer Online Board Game

  • 24 August 2021

    EHR to HL7 FHIR Integration: The Software Developer’s Guide – Part 3

  • 20 July 2021

    EHR to HL7 FHIR Integration: The Software Developer’s Guide – Part 2

  • 29 June 2021

    EHR to HL7 FHIR Integration: The Software Developer’s Guide – Part 1

  • 08 June 2021

    Elasticsearch and Apache Lucene: Fundamentals Behind the Relevance Score

  • 27 May 2021

    Endava at NASA’s 2020 Space Apps Challenge

  • 27 January 2021

    Following the Patterns – The Rise of Neo4j and Graph Databases

  • 12 January 2021

    Data is Everything

  • 05 January 2021

    Distributed Agile – Closing the Gap Between the Product Owner and the Team – Part 3

  • 02 December 2020

    8 Tips for Sharing Technical Knowledge – Part 2

  • 12 November 2020

    8 Tips for Sharing Technical Knowledge – Part 1

  • 30 October 2020

    API Management

  • 22 September 2020

    Distributed Agile – Closing the Gap Between the Product Owner and the Team – Part 2

  • 25 August 2020

    Cloud Maturity Level: IaaS vs PaaS and SaaS – Part 2

  • 18 August 2020

    Cloud Maturity Level: IaaS vs PaaS and SaaS – Part 1

  • 08 July 2020

    A Virtual Hackathon Together with Microsoft

  • 30 June 2020

    Distributed safe PI planning

  • 09 June 2020

    The Twisted Concept of Securing Kubernetes Clusters – Part 2

  • 15 May 2020

    Performance and security testing shifting left

  • 30 April 2020

    AR & ML deployment in the wild – a story about friendly animals

  • 16 April 2020

    Cucumber: Automation Framework or Collaboration Tool?

  • 25 February 2020

    Challenges in creating relevant test data without using personally identifiable information

  • 04 January 2020

    Service Meshes – from Kubernetes service management to universal compute fabric

  • 10 December 2019

    AWS Serverless with Terraform – Best Practices

  • 05 November 2019

    The Twisted Concept of Securing Kubernetes Clusters

  • 01 October 2019

    Cognitive Computing Using Cloud-Based Resources II

  • 17 September 2019

    Cognitive Computing Using Cloud-Based Resources

  • 03 September 2019

    Creating A Visual Culture

  • 20 August 2019

    Extracting Data from Images in Presentations

  • 06 August 2019

    Evaluating the current testing trends

  • 23 July 2019

    11 Things I wish I knew before working with Terraform – part 2

  • 12 July 2019

    The Rising Cost of Poor Software Security

  • 09 July 2019

    Developing your Product Owner mindset

  • 25 June 2019

    11 Things I wish I knew before working with Terraform – part 1

  • 30 May 2019

    Microservices and Serverless Computing

  • 14 May 2019

    Edge Services

  • 30 April 2019

    Kubernetes Design Principles Part 1

  • 09 April 2019

    Keeping Up With The Norm In An Era Of Software Defined Everything

  • 25 February 2019

    Infrastructure as Code with Terraform

  • 11 February 2019

    Distributed Agile – Closing the Gap Between the Product Owner and the Team

  • 28 January 2019

    Internet Scale Architecture

OLDER POSTS