File Structure Guide - Orhu/Summer2023Project GitHub Wiki

The following guide outlines a few structural guidelines for the Assets folder of the repository as well as instructions on how to import audio and art files (with some in-depth information included just in case). Note that all other folders will not be interacted with.

General Guidelines

  • No files should be placed directly in the assets folder. All files should be placed into subfolders.
  • Place files into folders corresponding to the type of file they are. For example, all scripts should be placed within a "Scripts" folder.
  • Organize subfolders. Try to group assets used for similar things together (i.e. all scripts for the player would go into a folder called "Player" within the Scripts folder).
  • Give files clear names. There should be no files named things like "HG37Sxuhe8shj.jpg".

Naming

When importing art do not use snake case (all lowercase with underscores between words) for assets. You should use Pascal case (no spaces with capital letters at the start of every word) with underscores to separate out different kinds of information.

Also, don't include Sprite in the name of your assets as that information is already included in the file type.

In general asset names should start with what in-game thing the asset is for, then if necessary what specifically for that in-game thing the asset is, then if there are variations or multiple frames add a number.

Good file names:

  • Bat_IdleAnimation_1
  • Bat_IdleAnimation_2
  • Bat_IdleAnimation_3
  • Goblin_Spear
  • Goblin
  • Fireball_CardIcon
  • Fireball_Projectile
  • Fireball_EmberParticles

Bad file names:

  • 3_Bat_IdleAnimation
  • Goblin_Sprite
  • bat_idle_animation_sprite_3
  • bat3
  • Bat3
  • BatIdleAnimationSprite3
  • batidleanimationsprite3
  • bat idle animation sprite 3
  • BAT

Structure Breakdown

The assets folder should be structured as follows:

  • Assets
    • Audio — All audio files
      • Music — Music files
      • SFX — SFX files (organized by purpose (i.e., "Enemies", "Cards", etc.))
    • Graphics — All files relating to graphics
      • Cutscenes — Cutscene videos/images (may not appear in this project)
      • Fonts — Font files
      • Images — Any large images that would fill an entire screen
      • Materials — Material files (may not appear in this project)
      • Particles — Particle effect files
      • Shaders — Shader files
      • Sprites — Sprite images/Sprite sheets
        • Animations — Animator Files/Animations (Organize this folder by animator)
      • Textures — Texture files (may not appear in this project)
      • Tilesets — Tileset sprites, tileset, and tile files
    • Prefabs — All prefab files (organize by purpose)
      • Scriptable Objects — Scriptable object files (what we are using for cards)
    • Resources — Misc. Resources and anything that is used in a Resources.Load call
    • Scenes — Unity Scene files
    • Scripts — All code/scripts.

Within each leaf folder, files should be organized based on their purpose/what they are related to (i.e. "Player", "Enemies", etc.)

Importing Instructions

Art

If you are importing Art files, place the file into the appropriate folder (Graphics/Cutscenes for cutscene images/videos, Graphics/Fonts for font files, Graphics/Images for full screen images, Graphics/Sprites for player/enemy/prop sprites, Graphics/Textures for background textures/shader textures/etc., or Graphics/Tilesets for tileset art).

If you are importing pixel art or want the image to have no compression on it, use the following import settings in the inspector:

  • Filter Mode: Point (no filter)
  • Compression: None

Otherwise, leave the import settings as is.

If you are importing a tileset or a sprite sheet, you will need to divide each piece of the image into individual components. To do this, select the image file in the Unity editor and set the image's Sprite Mode to Multiple, then click the Sprite Editor button to open the built-in Sprite Editor and click the Slice button in the top left corner. If the automatically generated division of the image looks correct (it rarely is), click the Slice button at the bottom of the menu to slice the image, then click "Apply" in the top right corner of the Sprite Editor to confirm before exiting the editor. Otherwise, you can set Type to either Grid by Cell Size to divide the image based on the pixel size of each cell, or Grid by Cell Count to divide the image based on the number of cells. You can also manually set the size of cells by clicking and dragging on the sprite directly. Make sure to click Slice to confirm and Apply before exiting the sprite editor.

Be sure to hit Apply at the bottom of the inspector to confirm any changes you made.

If you are making particle effects, shaders, etc., you will need to interact with Unity's built in shader/particle editor, or import premade files into the appropriate folder. Please test shaders/particle effects in an empty test scene when you import them from outside of Unity to verify they are working as expected. Please also make a note of who made the shader/particle effect so that you can be notified if any issues/questions arise.

Audio

If you are importing Audio files, place the file into the appropriate folder (Audio/SFX or Audio/Music). Ask Matt for more info on import settings for audio files.