top of page
Elemental Bots
Elemental Bots

Elemental Bots is a puzzle-platformer I created in Unity as part of my senior thesis at Mt Sierra. All scripts and most assets were done by me. It was selected as a semi-finalist in the 2013 IEEE GameSIG Intercolligiate Game Showcase. On this page you can read about the design of the game as well as see samples of the scripting that went into making it.

Download Game For PC or Mac

You will need to unzip the folder before running the application.

Design

Anchor 1

The premise of Elemental Bots is that players control 4 different small robots, each with its own set of unique elemental-themed abilities, and the challenge is to switch between control of each of them in order to combine their powers to solve puzzles and traverse the level. The idea for the game started when my senior thesis instructor suggested making a sidescroller. I decided I wanted to try something less predicable than a straightforward platformer or shooter. In my experience playing games I felt that having multiple player-controlled characters working together, whether done with cooperative play or by giving one player the ability to control different characters, often created interesting gameplay scenarios. I remembered seeing an old game called The Lost Vikings that had utilized on-the-fly character switching in a fashion similar to what I had in mind. After researching that game, I began developing my own ideas for different characters, and from there the 4 titular bots were born.

Elemental Bots

Perhaps because I had recently played a browser game called Demon Thesis that heavily featured elemental powers, I decided that said powers would be a simple and interesting theme for my characters and their different powers. (If nothing else, which exact elements I used admittedly came from Demon Theis.) As I began to brainstorm ideas for different powers and the potential synergy between them, I ended up deciding that a uniform 2 abilities and one passive bonus for each bot would be appropriate for the scope of the project. I then decided for the sake of a simple contorl scheme to have one of each bots ability be directional and able to be fired up, left, or right with down dedicated to the other, nondirectional ability. This would allow all the abilities to be readily available rather than having to be selected before use, which is great because swapping characters is already enough to keep track of. The different bots and their abilities are as follows.

ElementalBots

Rock Bot's directional ability allows it to extend itself outward as a platform, becoming immobile and indestructble in the process. This allows it to block lasers and other hazards, press buttons in dangerous spots, and give other bots a patform to use. Its nonderectional ability is a simple shockwave that can break cracked walls. Rock Bot is also passively immune to rock hazards. Wind Bot has an air blast for its directional ability that can push buttons at a distance. For its nondirectional ability it can create a constant upward lift for other bots, immobilizing itself in the process. Wind bot is also the highest jumper. For Fire Bot's directional ability, it can shoot fire, which melts ice. It's nondirectional ability is a shield that protects it from fire hazards, but greatly limits jump height while active. Fire bot has a higher air speed, which translates into longer jumps. Finally, Ice bot has a directional freeze ability, which lets it make platforms out of water jets or other bots. Its nondirectional ability lets it ice wet ground, which lets immobile bots be moved around and turns slopes into ski jumps to reach new areas. Ice bot also has the highest speed.

Elemental Bots

Elemental Bots only has one level designed to showcase the mechanics with a basic tutorial and about 4 complex puzzle rooms. If I were ever to turn it into a full-fledged game, the learning curve would be much more gradual with a less condensed and text-heavy tutorial, as well as a much more gradual introduction of the more elaborate ability interactions. And naturally there'd be more in the environment to interact with than just doors, switches, and hazards.

Scripting

Anchor 2

Elemental Bots was coded entirely in Unity's version of Javascript.  You can view a sampling of the scripts used in the zip file linked above. The scripts can be viewed in any program that can read .js files, such as Notepad++. Some further notes and explanation for each of them follows.

 

CharManager

This script is responsible for managing which of the 4 characters is currently selected. It takes user input to toggle the index of the selected character, which is then checked by other scripts such as the camera and movement scripts.  It also displays a GUI toolbar of the 4 characters.

 

CharMove

One of the biggest and most important scripts, this one handles all the user-controlled movement of each character as well as their abilities. I opted to use rigid bodies for characters and control them by applying forces because I felt it would be conducive to setting up physics-based abilities like ice and wind blasts, as well as bouncing characters off each other in collisions. This led to difficulties with smooth and natural movement, as well as problems running on different hardware and graphics qualities until I made sure that the forces applied were also dependent on "Time.deltaTime" (the passage of time between frames). However, in the end I'm happy with the choice to use rigid bodies because elements like the ice "ski jump ramps" (which are still unfortunately not 100% reliable) would've been much more complicated and time consuming to implement without Unity's physics engine helping out.

 

Checkpoint

This script handles respawning bots that get destroyed.  Each individual checkpoint can be activated by any of the 4 bots, which makes that checkpoint responsible for creating a new bot if it finds that bot has been destroyed (I thought it'd be too frustrating for players if one bot's destruction reset all the bots and the level).  The checkpoints also have visual and audio purposes such as displaying their flags for which bots are assigned to each point as well as playing the death sound (since bots are respawned instantly the camera with its audio listener will already be at the checkpoint when the sound starts).

 

Door

Doors are a pretty important element in many puzzle platformers, and Elemental Bots is no exception. This script handles everything dealing with moving doors around and coloring indicator lights to show how many switchs each door needs. Doors open on the z-axis, giving a 3d look to the 2d gameplay. They can be blue (closed when inactive) or yellow (closed when active), and can require 1-4 switches to be activated (limited by the number of lights they can have). The indicator lights are spawned and positioned in the "Start" function.

 

Freeze

Each ability has its own object with a unique script created by the movement script when the player gives the appropriate input. Freeze is an example of one of the more straightforward abilities. It's a trigger volume that creates an ice block if it detects something freezable, and immobilizes it if that something is another bot.

 

PlatformDisp

This script done towards the end of the project when I was adding graphics.  I had created the level mostly out of stretched cubes for walls and platforms, and wanted to use tiling to make more organic platforms without having to scale models and textures to the greatly varied sizes, which would result in ugly stretching. The existing primitives are still used for collision detection because sliding rigid bodies between adjacent surfaces of the same height created physics problems and the level was already built with that in mind. Rather than manually placing the handful of tiles I had made everywhere, I thought it'd be more fun and efficient to write this simple script to procedurally place them for me (and doing so at runtime makes the level look ever so slightly different each playthrough). Since the script was based on my limited tile set and how the level was built it does still have some limitations.  The 2 "ski jump ramps" are just a prefab, and the script won't work for odd shapes, sizes, or angles.  One challenge from choosing to add this feature late was that I had to accound for vertical walls that were made in the level in 2 different ways: having a higher y scale than x scale or simple rotation.

bottom of page