Introduction to Artificial Intelligence
the provided Bomber Belts Unity Project, write your own AI Script for
the character to play the game. Your script will be used on a
character while another classmate’s script will be used on the
opposing character. Please refer to the information below on how
and where to write the code.
Download the Bomber Belts
2014 Project from Moodle
Open the Scene named Menu
inside of the Assets folder
Locate the AI_Template.cs
file inside of the Assets / Resources / AI Scripts folder
This is the script you will
modify to create your AI algorithm
Refer to the information
below on available functions to call
You may also use the
AI_Sample.cs script to see an example implementation
the name of the script to AIScript_YourName.cs
will also need to change the class name
Do NOT make any
modifications to any other scripts in the project
modifications to the speed of the bombs or players, or any
adjustments to the game that grants an unfair advantage to a player
will automatically result in a zero for this assignment.
To test your script, simply
run the Menu screen and select your script.
InformationAll of the functionality for moving your
character, sending bombs, and positional/state information of the
belts and bombs have been written for you inside other scripts. You
can access those functions by using the mainScript variable
that is already declared and initialized for you inside of the
AI_Template.cs file. Below is a complete list of functions.
Moves the player up. The player will continue to move up until
Moves the player down. The player will continue to move down
until otherwise instructed.
Attempts to push the closest button. If the character is too
far from the button, the button is already engaged, or is on
cooldown, nothing will happen.
Returns the position of the character as a float
Returns the position of the opposing character as a float
Returns an array of floats for representing the position of
each button on your side
Returns an array of floats representing the time remaining
before each button may be pressed again.
Returns an array of Boolean values that corresponds to whether
or not the buttons on your side of the board have been engaged.
True means the belt/button is engaged and the bomb is moving
towards your opponent.
Returns an array of float values that represent the distance
each bomb is from its corresponding button on your side
Returns the speed at which the characters move
Returns the speed at which the bombs move
sure that you’ve changed the name of the script to
AIScript_YourName.cs and that you’ve also changed the class
name to match the file name. Upload your completed AI script to
A Few Points
Whenever a button is pressed,
that belt becomes disabled for 1.0 second. Neither player may press
a button on that belt until the second has elapsed. Example: the
blue player presses the button on belt 1. Both the blue player’s
button 1 and the red player’s button 1 become disabled for 1.0
You can access the list of
each bomb’s current cooldown by calling getButtonCooldowns().
the very top will have no effect. This is likewise true for
moveDown()at the bottom.
Make sure your script has
elements of AI. Simply copying what the opponent is doing (i.e.,
following) or doing the same time every time regardless of what
environmental percepts dictate is not AI.
Let’s block ads! (Why?)