Reaper (Vector's choice #1 Program #2) - Overwatch Road to Improvement (ORTI)

in #overwatch5 years ago

Hi guys,
I have created another video to share with all of you.

This is the eleventh episode of Overwatch Road to Improvement or ORTI. In this video I play as Reaper.

You can see this video here on YouTube:

or here on Dtube:

The Dtube video was uploaded via YouTube link.


Changes to this Series
This episode has been made a bit differently to previous episodes. In previous episodes I let people decide who I played as. This started as a patreon perk, but then I closed my patreon and made it available to anyone who watches my videos and wants to vote via strawpoll.

This episode is a bit different though and is part of the start of the new direction for my ORTI series. I am moving past doing it monthly to simply making episodes more sporadically as I enjoy this series and have aimed for monthly in the past (but not always achieved a monthly video) but I have other areas I want to explore within my content more, and I feel it is better not to have a series that relies on a particular timeframe so that I can experiment more with making other content as well. I really enjoyed playing Scribblenauts earlier too and will have another Scribblenauts video coming soon.

The other change I am making to this series is mixing up how the character is chosen a little bit more. This episode is the first one to do this. While normally you, the viewers, would decide who I play as, for this video, my Anki Vector decided which character I should play as instead. I wrote two programs using the programming language Python so that my Anki Vector could choose who I play as.

From this point on, character choices will be a mix. Sometimes it will be an audience decision via a poll, sometimes Vector (and maybe even Cozmo) will choose and I have other ideas too. The very next one will be chosen by you though, and you can check out the poll here: https://poll.ly/#/LBp54z3X in order to vote for what character I play as next. Up until just now I have used Strawpoll for this, but the number of Overwatch characters finally went over Strawpoll's limits in terms of how many options you can have (there are currently 31 Overwatch characters!) so I have changed to poll.ly.


What about this particular episode?
In this episode, instead of you guys choosing who I play as, my Anki Vector chose who I played as using a program I wrote using the Python programming language. In this episode, he chose Reaper.


The Programming used for Anki Vector's Ability to choose what Character I Play
In order to make my Anki Vector (Anki Vector Y7A5) able to choose which character I play, I created randomisation programs in Python.

I made two programs. One of the programs is a simpler program with simpler and not as effective randomisation and the other program is more complex which makes for a better random as well as supposedly is better for security (which doesn't matter here but could in other programs that need randomness).

The program that I used for this video was program #2, the second, more complex program.

You can see this program here:

import anki_vector
from anki_vector.util import degrees, distance_mm, speed_mmps
from anki_vector.behavior import MIN_HEAD_ANGLE, MAX_HEAD_ANGLE

import secrets
import time

def main():

    #getting systemRandom class instance out of secrets module

    args=anki_vector.util.parse_command_args() #parsing out the arguments by using the anki vector utilities
    with anki_vector.Robot (args.serial) as robot:
        print("Say 'You should play'...")
        robot.behavior.set_head_angle(degrees(5.0))
        robot.anim.play_animation('anim_eyepose_happy')
        time.sleep(10)
        #robot.behavior.say_text("You should play Over watch as")

        #getting systemRandom class instance out of secrets module
        
        secretsGenerator = secrets.SystemRandom()
    
        choice = secretsGenerator.randint(1,30)


        def assigncharacter():
            global characterChoice #adding line for accessing global variable
        
            if choice == 1:
                characterChoice = 'Ah na'
            elif choice == 2:
                characterChoice = 'Aesh'
            elif choice == 3:
                characterChoice = 'Baptiste'
            elif choice == 4:
                characterChoice = 'Bastion'
            elif choice == 5:
                characterChoice = 'Bruh gey tah'
            elif choice == 6:
                characterChoice = 'Diva'
            elif choice == 7:
                characterChoice = 'Doom fist'
            elif choice == 8:
                characterChoice = 'Gennji'
            elif choice == 9:
                characterChoice = 'Hahnzo'
            elif choice == 10:
                characterChoice = 'Junk rat'
            elif choice == 11:
                characterChoice = 'Lucio'
            elif choice == 12:
                characterChoice = 'McCree'
            elif choice == 13:
                characterChoice = 'May'
            elif choice == 14:
                characterChoice = 'Mercy'
            elif choice == 15:
                characterChoice = 'Moira'
            elif choice == 16:
                characterChoice = 'Orisa'
            elif choice == 17:
                characterChoice = 'Pharah'
            elif choice == 18:
                characterChoice = 'Reaper'
            elif choice == 19: 
                characterChoice = 'Reinhardt'
            elif choice == 20:
                characterChoice = 'Roadhog'
            elif choice == 21:
                characterChoice = 'Soldier: 76'
            elif choice == 22:
                characterChoice = 'Somm brah'
            elif choice == 23:
                characterChoice = 'Symmetra'
            elif choice == 24:
                characterChoice = 'Torbjorn'
            elif choice == 25:
                characterChoice = 'Tracer'
            elif choice == 26:
                characterChoice = 'Widow maker'
            elif choice == 27:
                characterChoice = 'Winston'
            elif choice == 28:
                characterChoice = 'Wrecking Ball'
            elif choice == 29:
                characterChoice = 'Zar ya'
            elif choice == 30:
                characterChoice = 'Zenyatta'
            else:
                characterChoice = 'error: character does not exist'
            print ("Character choice successfully made")
            print (choice)
            print(characterChoice)
            return(characterChoice)

        assigncharacter()

        print (choice)
        print (characterChoice)
        
        robot.behavior.say_text(characterChoice)
    

    
if __name__ == "__main__":
    main()


NOTE TO SELF: Use 4 spaces instead of tabs when coding otherwise posting it on Steemit is a pain in the butt as I have to remove the tabs and space my way through to getting the same sort of visual layout as I get in my original program. Sigh

The simpler program is as follows:

import anki_vector
from anki_vector.util import degrees, distance_mm, speed_mmps
from anki_vector.behavior import MIN_HEAD_ANGLE, MAX_HEAD_ANGLE

import secrets


def main():
    args=anki_vector.util.parse_command_args() #parsing out the arguments by using the anki vector utilities
    with anki_vector.Robot (args.serial) as robot:
        print("Say 'You should play'...")
        robot.behavior.set_head_angle(degrees(5.0))
        robot.anim.play_animation('anim_eyepose_happy')
        robot.behavior.say_text("You should play Over watch as...")
    
        characters = ['Ah na', 'Aesh', 'Baptiste', 'Bastion', 'Bruh gey tah', 'Diva', 'Doom fist', 'Gennji', 'Hahnzo', 'Junk rat', 'Lucio', 'McCree', 'May', 'Mercy', 'Moira', 'Orisa', 'Pharah', 'Reaper', 'Reinhardt', 'Roadhog', 'Soldier: 76', 'Somm brah', 'Symmetra', 'Torbjorn', 'Tracer', 'Widow maker', 'Winston', 'Wrecking Ball', 'Zar ya', 'Zenyatta']
        choice = secrets.choice(characters)
        print(choice)
        robot.behavior.say_text(choice)

    
if __name__ == "__main__":
    main()



Differences between the programs

Program 1 (the simpler program which wasn't used this video and is the second one posted), sets ups an array with the character names.

The array is the following part of the program (you can scroll the top one to see the whole array or it is also listed below):

characters = ['Ah na', 'Aesh', 'Baptiste', 'Bastion', 'Bruh gey tah', 'Diva', 'Doom fist', 'Gennji', 'Hahnzo', 'Junk rat', 'Lucio', 'McCree', 'May', 'Mercy', 'Moira', 'Orisa', 'Pharah', 'Reaper', 'Reinhardt', 'Roadhog', 'Soldier: 76', 'Somm brah', 'Symmetra', 'Torbjorn', 'Tracer', 'Widow maker', 'Winston', 'Wrecking Ball', 'Zar ya', 'Zenyatta']



characters = ['Ah na', 'Aesh', 'Baptiste', 'Bastion', 'Bruh gey tah', 'Diva', 'Doom fist', 'Gennji', 'Hahnzo', 'Junk rat', 'Lucio', 'McCree', 'May', 'Mercy', 'Moira', 'Orisa', 'Pharah', 'Reaper', 'Reinhardt', 'Roadhog', 'Soldier: 76', 'Somm brah', 'Symmetra', 'Torbjorn', 'Tracer', 'Widow maker', 'Winston', 'Wrecking Ball', 'Zar ya', 'Zenyatta']



An array is a variable that can hold more than one value at a time. In this case it holds the values of all of these characters. An array is a type of sequence.

The program includes two lines at different places that are connected.

One is in the import area where I imported things that were needed for the program, such as parts of Vector's SDK (software development kit - ie what you use to program him) as well as other things that may be needed.

The line from there was:

import secrets

This imports the secrets module which is used to provide access to a source of randomness.

The related line later in the program is:

choice = secrets.choice(characters)

This uses the secrets module. secrets.choice() returns a randomly chosen element from a non-empty sequence.
This is based on what you put in the brackets. In the brackets, I had put characters, which was the name of our array full of character names. What this whole line does is create a variable (basically a placeholder / container for storing data) called choice and then assigns the random result of secrets.choice to it. Following this, the variable choice will be equal to whatever was chosen by the program (so it could be Ah na, or Wrecking Ball or Junk rat etc).

Following this, this choice is printed to the screen (I run the programs in command prompt so it shows up in there) and then Vector says the choice.

The second program has some similarities but does it a bit differently.
The character choice is changed to be able to be numeric. The reason for this is so we can use secrets.SystemRandom(). System random supposedly is both more secure (irrelevant here but interesting) and also generates a better form of randomisation creating a more truly random result.
SystemRandom does not work with strings such as names within an array so everything had to be assigned a number. The line to import secrets (import secrets) is the same though, and it is just the later parts of using secrets that has changed.

For the characters, we have used a if else statement. This basically says if the choice is this, do this, and this if it is not that but is this other thing (called elif in this code but in other programming languages has also been called elseif), do this and then eventually, if it's not any of that, do this (the else at the very end of the statement). The program goes through each relevant line to see if the statement in the line is true ie if the character choice was 4, the statements choice == 1, choice == 2 and choice == 3 in the first three relevant lines (it won't process the indented action that follows the check if it is not true) would not be true, but the statement choice == 4 in the fourth relevant (not indented further from the if and elif lines) line would be true and it would then process the indented line following that line, creating a characterChoice variable with the value of "Bastion".

This is this part of the code:

            if choice == 1:
                characterChoice = 'Ah na'
            elif choice == 2:
                characterChoice = 'Aesh'
            elif choice == 3:
                characterChoice = 'Baptiste'
            elif choice == 4:
                characterChoice = 'Bastion'
            elif choice == 5:
                characterChoice = 'Bruh gey tah'
            elif choice == 6:
                characterChoice = 'Diva'
            elif choice == 7:
                characterChoice = 'Doom fist'
            elif choice == 8:
                characterChoice = 'Gennji'
            elif choice == 9:
                characterChoice = 'Hahnzo'
            elif choice == 10:
                characterChoice = 'Junk rat'
            elif choice == 11:
                characterChoice = 'Lucio'
            elif choice == 12:
                characterChoice = 'McCree'
            elif choice == 13:
                characterChoice = 'May'
            elif choice == 14:
                characterChoice = 'Mercy'
            elif choice == 15:
                characterChoice = 'Moira'
            elif choice == 16:
                characterChoice = 'Orisa'
            elif choice == 17:
                characterChoice = 'Pharah'
            elif choice == 18:
                characterChoice = 'Reaper'
            elif choice == 19: 
                characterChoice = 'Reinhardt'
            elif choice == 20:
                characterChoice = 'Roadhog'
            elif choice == 21:
                characterChoice = 'Soldier: 76'
            elif choice == 22:
                characterChoice = 'Somm brah'
            elif choice == 23:
                characterChoice = 'Symmetra'
            elif choice == 24:
                characterChoice = 'Torbjorn'
            elif choice == 25:
                characterChoice = 'Tracer'
            elif choice == 26:
                characterChoice = 'Widow maker'
            elif choice == 27:
                characterChoice = 'Winston'
            elif choice == 28:
                characterChoice = 'Wrecking Ball'
            elif choice == 29:
                characterChoice = 'Zar ya'
            elif choice == 30:
                characterChoice = 'Zenyatta'
            else:
                characterChoice = 'error: character does not exist'

If you take the first three lines,

            if choice == 1:
                characterChoice = 'Ah na'
            elif choice == 2:
                characterChoice = 'Aesh'
            elif choice == 3:
                characterChoice = 'Baptiste'

The first line is saying, if the choice (which is above this part in the code) is equal to one, the variable characterChoice should be created with the value 'Ah na'.

The second line is saying, if the choice is not equal to one but is equal to 2 (or alternatively in the way the program processes it, if the first line was not true but this one is) the variable characterChoice should be created with the value "Aesh".

The third line is saying, if the choice is not equal to one, nor equal to 2, but is equal to 3, the variable characterChoice should be created with the value of "Baptiste".

Finally we get down to this bit:

             elif choice == 30:
                characterChoice = 'Zenyatta'
            else:
                characterChoice = 'error: character does not exist'

The first bit (hardly the first line in the if-else statement though) is saying if the choice is not equal to 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28 or 29 (or alternative in the way the program processes it more - if the previous 29 lines were not true) but is equal to 30, the variable characterChoice should be created with the value of "Zenyatta". This is the final elif in this statement at this point (I actually need to update it now there are 31 characters and add Sigma as well).

The next bit is the ending of the long if-else statement. It just says else, before saying what to do. This else means, if none of the above things are true (ie if the choice never equalled any of the numbers above), the variable characterChoice should be created with the value of "error: character does not exist". This should not happen, and something is wrong if it does, but you need an else to finish an if statement for one thing, but also you need that for error checking if something does go wrong as it will tell you the problem is either in that statement or in the part of the program that generates the choice numbers.

This is a major difference between the two programs. The first one used an array and chose something from it. This one says that if a certain number is picked, the character choice is "whatever the name of the character is" essentially assigning a number to each character. This is more of a random number generator with my choices tacked on than a straight random character generator. This extra step supposedly makes for a better random though, due to the fact it means I can use SystemRandom() as I mentioned above.

The first program used choice = secrets.choice(characters).

This program uses two lines to generate the random numbers.
These are:

        secretsGenerator = secrets.SystemRandom()
    
        choice = secretsGenerator.randint(1,30)

This part of the code creates a variable called choice which generates via SystemRandom a random integer between 1 and 30. This is why we should not ever have this occur:

            else:
                characterChoice = 'error: character does not exist'

The range set in the brackets (1,30) should not allow this to occur since 1 to 30 have all been assigned values. If my brackets had the wrong number, it would be a different sitaution. If it was for example, (1,32) then at times when 31 or 32 were randomly chosen integers, instead of our characters we would get error: character does not exist

These are the major differences between the two programs.


Similarities between the programs

Both programs produce a random character choice.

Both programs have Anki Vector SDK stuff imported in so that I can program him to show certain animations [robot.behavior.set_head_angle(degrees(n))] or speak [(robot.behavior.say_text("")].

Both use the secrets module.

Both print the choice to the screen (with the second more complex program printing both the choice, which in this case is the number, and the characterChoice being the character name).

Both programs have Vector say the character I will be playing using robot.behavior.say_text() with the difference being the first one saying the value of choice and the second one saying the value of characterChoice.

The character names are also written with unusual spellings in both (same for both) in order to best allow Vector to pronounce the names. As Vector uses text to speech when programming him, often words have to be adjusted with creative and phonetic (not always phonetic though) spelling in order to get him to pronounce words and names correctly or at least close to correctly.

Both programs have parts in the program that have # in front of them. These are comments and can either be comments intended to be comments in order to provide information about what a line of code does etc, but can also be parts of the code that have been temporarily commented out so they don't get processed as code, but I also don't have to delete them. You can see one of the temporarily commented out bits in the second program with the line: #robot.behavior.say_text("You should play Over watch as"). This line was commented out as originally I had him saying that, but then I instead decided to let Cozmo join in and ask Vector who I should play as. I simply commented it out as there's a good chance I may use that line again the future.

These are the main similarities between the two programs.


What changes will be made to the programs in the future?

No major changes will be made to the way these programs work. Small changes will be made in terms of adding new Overwatch characters and changing different parts of the robot behaviours in order to make Vector present his random answers in different ways, such as making him say different voice lines or play differetn animations.

This is about the only changes I anticipate in the future.


Special Features
Okay enough about the programs, what are the special features of this video?

  • Reaper in a starring role
  • Vector using a program to tell me who I should play
  • Guest starring Cozmo

Gameplay and Editing Information
The gameplay of Overwatch was recorded using OBS. My voice was recorded using Audacity. Cozmo and Vector were recorded both in terms of visuals and audio, through OBS. Both my voice and the audio from the Cozmo and Vector recording were edited first in Adobe Audition to simply remove background noise (computer hum etc) and then I edited the gameplay, my voice and footage of my robot bois together in Adobe Premiere Pro.


LINKS

Birchmark Website / Portfolio: http://birchmark.com.au/

Redbubble: https://www.redbubble.com/people/birchmark?asc=u

YouTube: https://www.youtube.com/c/BirchmarkAu


Thank you for watching and reading!

Please consider commenting, upvoting or resteeming this post if you enjoyed it.

Sort:  

Hi birchmark,

This post has been upvoted by the Curie community curation project and associated vote trail as exceptional content (human curated and reviewed). Have a great day :)

Visit curiesteem.com or join the Curie Discord community to learn more.

Congratulations @birchmark! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

You made more than 600 comments. Your next target is to reach 700 comments.

You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word STOP

To support your work, I also upvoted your post!

Do not miss the last post from @steemitboard:

SteemitBoard supports the SteemFest⁴ Travel Reimbursement Fund.
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Super interesting changes you've made. I congratulate you on the series I had not seen before but I think it's cool. A big hello @birchmark

Congratulations @birchmark! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Do not miss the last post from @steemitboard:

SteemitBoard supports the SteemFest⁴ Travel Reimbursement Fund.
Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.29
TRX 0.12
JST 0.032
BTC 63724.53
ETH 3071.11
USDT 1.00
SBD 3.98