Table of Contents
Overview
*FactoryFramework** is a paid asset taking advantage of Unity’s Jobs and Burst compile technologies to kickstart development for factory type games.
👨💻 Role
Co-developed
🎯 Goal
- Create an asset to kickstart development for factory games
- Keep asset setup as simple as possible for users, focus on smart default settings
- Keep asset as non-invasive as possible
✨ Implementation
The code is split into two major parts, one module for everything “path” related and one module for interfacing with Unity systems. Generating paths from point a to point b is complex, and we wanted to allow users to choose between several path types. The paths also needed to be representable within the Unity Jobs system, so they had to be backed by flat data structs. Through some clever unions and struct work we were able to make this work, and exposed a common path interface that the rest of the code used. The rest of the code is responsible for moving items and processing recipes. We created custom editor windows so users can easily add their own items, recipes, buildings, and belts.
⚙️ Thoughts
There were several optimizations that we had to forego for the sake of generalization. When creating an asset for Unity, you must respect a variety of use cases. Keeping the asset flexible enough to meet all of these cases while also optimizing where you can is a difficult balance, but I think we handled it well.
