Automated Script Execution Order in Unity (solve build issues)
TLDR : If you’ve ever had a unity project that works in-editor, but not in-build (because scripts run in a different order), and lost hours to a script-execution-order bug, this package will prevent this from happening again by automatically locking down the execution order of all scripts across editor and build.
The Problem
From the Unity docs, by default, the order in which scripts execute their functions (Start(), Awake(), Update(), etc) is arbitrary, and almost guaranteed to change when going from editor to build.
This is a big deal for most developers. Imagine you have two systems in your game…
If system A initializes first, all is good (system B can properly use it). If the reverse order were to happen, initialization of system B will fail, as system A (one of its dependencies) is not yet ready to provide service.
While certain patterns can get us past this, most developers do not use them (students definitely don’t), and thus the prospect of creating a build can be a terrifying one.
The Solution
The idea is very simple– if a script exists within your Unity project, automatically guarantee it has an explicit, unique position in the script execution order.
After this script runs, your project’s script execution editor view should look like this–
- The package notices and respects DefaultExecutionOrder attributes, such that if you have already configured a script to have an execution order, this ordering will not be clobbered.
- The package notices and respects any non-0 execution orders you may have already configured, so it will not clobber those values (though with most other scripts receiving a new default order, the relative position may still change.
The Solution
Thanks to Azure Ravens Entertainment for help with testing / verifying the package.
Arbor Interactive is becoming the leading producer of redhead-starring games. Perhaps we should change our name.
Not very scary yet, huh? Give it time– we’ve only put a week or two into it, and many successful itch.io horror games aren’t particularly scary either. We’re seeking inspiration from fantastic slow-burn games like Dead County, Blake McKinon’s fantastic, brief RE-inspired, fixed-camera game.
Blake McKinnon has an ongoing video devblog which is informative, fascinating, and inspiring.
The coolest part of this production is the existence of a partner– PrairieVille games is, at this moment, ~58% owner of the project (with equity fluctuating based on weekly investment of time and money), and is responsible for animation, environmental art, and level design. You have no idea the weight lifted off my shoulders– if I never need to place another bush or log, it will be too soon. On this project, I can reserve all of my discipline and mental energy for programming and systems design, which is where my strengths and interests lie.
Goodbye Groundhog Progress
Locally Sourced is a popular and impactful organizer of the Michigan gamedev community, and as part of his (Michael Klamerus’) efforts, a quarterly bundle of Michigan-made games and demos gets released on itch.io for the purposes of showcasing the community (and scounging up some minor revenue for all involved).
The upcoming February bundle (set to release on the 2nd) will include a game from Arbor Interactive powered by our Tower Defense Engine. Set on a lonely, frigid mountainside, Goodbye Groundhog tasks players with escaping a ravenous mob of formerly fuzzy friends– enraged by a seemingly never-ending winter they believe you caused (by looking at your shadow). As times get tough, even the most absurd of rumors can take on a life of their own. Will the groundhog and his family survive the night? Decide for yourself in early February.
This project has value for Arbor Interactive outside of the small number of sales it will generate– this project, being more cinematic and story-dependent than our other ones– has forced us to create new technology, including…
- Deformable snow maps (easy to re-use for other materials, such as sand)
- Connected-Area Exploration (walk from area to area, rather than be plopped down into one each round).
- Anytime-Launchable Wavesets (invisible triggers in a room cause certain wavesets to activate and play out).
- Customizable, animating gameplay backgrounds (starry-night sky).
- Improved dialog technology.
Regardless of the game’s final quality (it isn’t exactly receiving our full attention), this production and the new techniques / technology that comes with it, should improve the quality and expressiveness of all our future tower-defense-style games.
Museum Tower Defense / Life’s a Beach Progress
Life’s a Beach and Museum Tower Defense are still progressing, albeit slowly. If you’ve forgotten, we’re talking about this game–
And this one–
The business model these games had been planned for–
- Create a game
- Put it on the web
- ???
- Profit
hasn’t proven itself out in the case of Life’s a Beach, and this is causing a delay of Museum Tower Defense (why throw a second game to the wolves?). Should Life’s a Beach reach a truly finished point, it would make sense to release it on itch.io and steam at a low cost, but a new business model and plan has come into focus for these two games– one inspired by profitable artists at expo artist alleys. Here’s the basic outline–
- Create a game with cute characters.
- Create stickers, decals, misc artist-alley swag from the game assets, like this.
- Associate each piece of swag with a code that “unlocks” that character in the game.
- Make the game itself free to download and accessible (desktop and mobile platforms).
- ???
- Profit (cash + people joining the arbor interactive community)
When purchasing a piece of art at an expo, the purchaser has no context for the original-IP character in that artwork. If they can see that this is a video game character, and can see that they are actually purchasing an experience (the ability to learn about that character), then this entire purchase begins to resemble that of a comic book for a new, original character (something that I have seen sell reasonably well at comic conventions, such as Motor City comic con).
I feel this business model is unique, doable, and has at-worst a small chance of mild success. It does, unfortunately, require the pandemic to end, so these projects are in a bit of limbo until then.
Subscribe to Future Devblogs!
Subscribe here to be notified when we publish future devblogs, tutorials, etc.