Random Material for Maps


IN-DEPTH LOOK: arena dimensional swapping

Hello people, gab here! Today I’ll explain why and how we introduced the random material mechanic, also known as "Arena Dimensional Swapping" (A.D.S.), in our game!

-------WHAT-------

What is the “Arena Dimensional Swapping” mechanic? The A.D.S. is a mechanic that, as the game progresses, will visually (and possibly mechanically) change the maps by replacing textures randomly by selecting from a pool of possible materials, each with their own custom shader.  

-------WHY-------

We have decided that, given the time restriction that we have, creating a large number of maps might have been a bad idea since we try and focus on giving each map a good level of detail, but we still wanted to increase the replayability of the game by making the maps look less monotonous to look at.


We also needed a way to show the player how long the match has been going for, and we found out that this mechanic might be the best way to do so without adding UI elements that might seem distracting. As the game progresses, the chance for a set of objects in the level to change materials increases.

Another reason for creating this mechanic is the number of cool and interesting materials and shaders that can be created in unity, and given the “multidimensional” aspect of our game, we thought that we could kill two birds with one stone by showcasing interesting effects in a way that fits the game.

--------HOW-------

For the how, I’m going to explain how the maps are set up in game and what they need for the code to work:

Each map is a game object composed of different parts, it can’t be a single mesh for the entire map, which means that every object (like the rocks and trees of the island map) is its own game object with materials and meshes, this also helps with the level design aspect giving me more freedom when tweaking and fixing elements of the map.

Now that I’ve explained how the maps are set up, I’ll explain the core of the mechanic:

  • The material list: this is the list of the possible materials that can be selected by the script.

  • Childed objects: each object on the map is part of a group of children to an empty parent object, the parent object is the one to have the script attached to it. Each group of object has a percentage of activating the A.D.S., when they do the script chooses one of the materials on the list and applies it to all childed object.


The script has access to the round system, which means that it keeps tracks of the number of rounds, this is used when calculating the percentage of activation of the A.D.S.

The script also takes in consideration the fact that some objects have more than one material, rolling twice on the table for selecting the new one, which is something that i'm really proud of.

 

Get E-Racer

Buy Now$1.50 USD or more

Leave a comment

Log in with itch.io to leave a comment.