Introduction
Whatever version of Unity you’re using, remember to always import the asset in an empty project, so that the engine’s project settings get properly imported. If you decide not to import in a blank project, at least make sure to remove the old TopDown Engine folder first to avoid conflicts.
This asset relies on a few Unity packages to function. On import this will very likely cause errors, that’s normal, and easily fixed. It’s all explained on this page.
Importing the TopDown Engine in your project
To import the asset, follow these steps :
- Create a new project from Unity Hub, pick the latest stable version of Unity as your Unity version, and 2D or 3D as the Template
- From the Package Manager window, import TopDown Engine (it has to be in an empty project, not an existing one)
- You will be warned that importing the TopDown Engine will overwrite your current project settings (that’s normal), click on Import.
- This will take a bit of time.
- Once this is complete, you’ll get a prompt saying “This Unity Package has Package Manager dependencies”. This is also normal, click on “Install/Upgrade”.
- After that you’ll get a list of the contents of the engine, don’t touch anything, and click on Import in the bottom right corner.
- Import will also take a while. Once import is complete, you’re ready to use the engine. Have fun!
Importing the asset in a URP project
The engine doesn’t do any rendering, it’ll work with any render pipeline.
The demos are made using the Standard Render Pipeline, as it’s still the only stable one, and the most common denominator, but you can use any RP you prefer. If you decide to use URP or HDRP in your project, the best approach would be to keep another project at hand, using SRP, to test the engine’s demos in, while you implement your own game in URP/HDRP.
Below are steps to install TDE on a URP project. It’s recommended to have at least basic knowledge of render pipelines before picking URP or HDRP, considering the many quirks of these two render pipelines.
- Create a new project in Unity 2019.4.28f1 (or higher), using the URP template
- Import the TopDown Engine from the Package Manager window
- Open the Colonel demo scene (or any other)
- Open your project settings, in Graphics, at the top of it, set a Scriptable render pipeline asset (the URP default template usually comes with a few, pick the HighQuality one)
- In the scene, select the UICamera, on its Camera component, set RenderType to Overlay
- Select the Canvas nested under UICamera, set its SortingLayer to Above
- Select the MainCamera, at the bottom of its Camera component, add the UICamera to its Stack
- If you want to convert all (or most) materials to URP, simply go to Edit > Render Pipeline > Universal Render Pipeline > Upgrade Project Materials to URP Materials, press play, the demo will play. Note that you’d also have to adapt post processing effects, as Unity went with a different system (volumes) on URP/HDRP. Thankfully MMFeedbacks come with dedicated URP and HDRP feedbacks targeting their specific Volumes.
Some of my materials are all pink!
While most of the materials used in the engine’s demos will display fine on all RPs, some of the demos use custom shaders, and these will break in HDRP or URP. Thankfully, you can convert them fairly easily, like so :
- select all materials that are using a BiRP shader (typically, the materials under Demos/Loft3D/Materials)
- if they’re not already using the Standard shader, in their inspector, at the top, set their shader to Standard
- then, go Edit > Rendering > Materials > Convert Selected Built-In Materials to URP They won’t look just as good as they would have in BiRP, but will let you enjoy the demo just fine
- repeat the operation for any pink material you want to convert
What’s the best way to update from an old version of the engine?
Whatever you do, make sure you have a commit / backup to rollback to if a problem happens. Then, remove the old TopDownEngine folder, and import the new one. If you don’t, due to the way the Asset Store importer works, some scripts may be duplicated, not removed, etc. Depending on what version you’re updating from, and what version you’re updating to, you may have some light refactoring to do. Make sure you check the release notes to see what changed and what may have an impact on your own code.
Tilemaps and 2D Extras
The engine uses tilemaps in some of its demos (Koala, Grasslands for example). If you wish to use or edit these tilemaps, you will need to add Unity’s 2D extras to your project, as most of the tiles in these demos’ tile palettes rely on them. To add the 2D extras to your project, simply download the latest release’s source as a zip, and extract its contents into your project in the folder of your choice. These used to be included in the asset, but Unity now has separate versions for different editor versions, and it’s still not available via the package manager, so this manual installation is unavoidable.
Unity versions not yet supported by the engine
Updates for the TopDown Engine usually support the latest stable version of Unity, but sometimes they lag behind a bit. If you’re importing the asset in a freshly released Unity version, you may have to update some packages via the Package Manager.