🦇
Monster Survivors Template Documentation
  • Welcome
  • CHARACTER
    • Add a Character
    • Starting Ability
  • Stages
    • Stage Creator
    • Tracks And Clips
    • Stage Settings
    • Create a Stage
  • Enemies
    • Simple Enemies
    • Ranged Enemies
    • Bosses
    • Add a Simple Enemy
    • Add a Boss
  • Abilities
    • Ability Types
    • Abilities System Structure
    • Add Abilities
  • Upgrades
    • Upgrade Types
    • Upgrades System Structure
    • Add an Upgrade
  • Game structure
    • Main Menu Scene
    • Game Scene
  • Input
    • Input System
    • Menu Navigation
  • Known Issues
    • IOS Build
  • Testing
    • Abilities Testing Overlay
    • Presets
Powered by GitBook
On this page
  • Stage Data
  • Stage Background
  • How To Change Background
  • Stage Prop
  • How to Add Stage Prop
  1. Stages

Stage Settings

PreviousTracks And ClipsNextCreate a Stage

Last updated 4 months ago

Stage Data

Besides timeline sequence, each stage has separate settings file, also called Stage Data.

When you open a Stage Data file, it should look like this:

Here you can see a list of parameters in order:

Parameter
Description

Icon

An image that will represent this stage in the main menu

Display Name

Stage name for the main menu preview image

Timeline

Reference to a specific timeline file for this stage

Stage Type

Shape and direction of this stage

Stage Field Data

Reference to a field data file

Spawn Prop*

Whether or not to spawn prop

Remove Prop from Boss*

Destroys prop inside of the boss fight arena

Spotlight

Color of the decorative spotlight effect in the center

Spotlight Shadow

Color of the vignette effect around the edges

Enemy Damage

Damage multiplier for this stage

Enemy HP

Enemy health multiplier for this stage

*Available in version 1.0.2 and above.

Stage Background

Among the parameters you will find Stage Field Data. This file lets you set up different level backgrounds and shapes.

When opened, the file should look like this:

There you can see a list of assigned Background Prefabs. Every field corresponds to a specific point of the level grid. An example set of background images can be seen below.

Background Prefab contains the main background image that you will see most often. It's in the center of the grid above.

Depending on your level shape, you will need a different number of background images:

  • Endless will require only the center prefab, as it will repeat endlessly:

  • Horizontal requires top and bottom rows, along with the center one:

  • Vertical requires side rows and the center one:

  • Rect requires all prefabs:

If you are building a stage with only one specific shape, you can assign only the prefabs that are needed, while the other fields can be empty.

How To Change Background

1

Preparation

2

Background Prefabs

A typical background prefab will have a following structure:

Background child typically holds a Sprite Renderer component, with a sprite for background attached:

This holds true, with one important exception: center background prefab should also hold a special script, as seen below:

3

Sprite Swap

To change the background, click on the Sprite field in the Sprite Renderer, and select your new background. Repeat this step for all the other prefabs that you require.

If your newly set background doesn't match the size of the previous one, tweak its Pixel Per Unit value.

4

Additional Info

Each background prefab has to hold at least one image, but you are also free to place additional layers to your liking. This can be useful if you want to decorate a background somehow, or add depth, etc. An example of this can be seen in the border prefabs, as they have an additional decorative object.

Stage Prop

Version 1.0.2 introduces a new feature - Stage Prop. It allows to randomly spawn a set of predefined objects, specific for each stage.

Prop has two types of collision:

  • Collision for the player only.

  • Collision for both enemies and the player.

How to Add Stage Prop

Here's how to populate your stages with prop:

1

Preparation

Before you begin, make sure you have the sprites for obstacles you want to add. The template features demo prop sprites for each stage:

For better sorting results, we recommend setting the pivot of these sprites to bottom.

2

Prop Prefab

Lets take a look at a typical prop prefab. Open one from the directory above. In the inspector you will find several components attached:

Sprite Renderer, 2D Collider, and the Prop Behavior Script.

The easiest way to add your Prop Prefab is to copy an existing one.

To change the visuals assign the sprite you want in the Sprite Renderer.

If you want to have a more complex structure, with several layers inside, you can do that by copying the parent object and changing it to your needs.

3

Obstacle Layers

  1. For these prop objects to properly collide, you need to make sure the object has a proper Layer set up.

In the same Inspector window, take a look at the Layer field on top.

Make sure it has a proper Layer you need:

If you want for both the Player and Enemies to collide with an object, choose Player & Enemy Obstacle Layer.

If you want a prop that only the Player collides with, choose Player Only Obstacle Layer.

Open a desired prefab, and change its Layer to Player & Enemy Obstacle Helper, like in the screenshot below:

In some cases you might want to change obstacle's Sorting Layer, to display this prop above or below something. You will find this setting in the Sprite Renderer component of a prop prefab.

4

Collision

For this to work properly, make sure all the prop objects have a 2D Collider attached.

For the best performance, its recommended to use Circle Collider 2D, however, you can replace it with any 2D Collider of your choice.

5

Adding Prop Prefabs to a Stage

Now you can add your prop prefabs to a stage you want.

  1. In the Inspector you will see an array of prop prefabs. It should look like this:

  1. There you will find a prop prefab field. Assign your newly created prefab.

  2. Under the Prefab field you will find prop spawn settings:

Max Amount determines the amount of this prop objects to spawn (In a range of 1 to Max Amount).

Chance, naturally, determines the chance of set prop to spawn, in percentages.

  1. Set these settings according to your needs.

You can add as many prop objects to a Stage as you like, but keep in mind that every collision and additional rendered object will cause a drop in performance.

6

Enabling Prop Spawn

When you're done, test your obstacles in the game.

If you want to spawn prop in more orderly fashion, you may want to disable Spawn Prop option in the Stage Data, and manually add everything you need in the Stage Background prefab. Make sure to use proper Layering and Colliders.

You can access the file either by clicking on the field in the screenshot above, or simply navigating to this path: .

Before starting, check if you have all the components needed. Depending on the stage shape, you will need a set of images. On how to decide what you need, check the . Additionally, the background images must be configured as sprites. For the best quality, we recommend images with at least 1024x1024 resolution.

Navigate to . There you will find the prefabs for all the stages in the game. Select a prefab you want to change and open it.

If you experience unexpected results with bosses and obstacle collision, try enabling the Remove Prop from Bossfight option in the .

Every prop needs to have its own prefab. You can find them here:

For this to work properly, you also need to set an appropriate Layer for the Character itself. To do that, navigate to your Characters prefab folder, typically located here: .

To do that, navigate to Stage Field Data folder . Select a stage you need, and open it.

Last important thing is to enable the prop spawn in .

previous step
Stage Data
Stage Data
Stage Data example
Stage Field Data example
Set of images forming a background grid
Endless
Horizontal
Vertical
Rectangular
Background Prefab example
Background Sprite Renderer example
Center Background script
Demo Prop
Prop Prefab
Prop Layer
Character Layer
Stage Prop