Hurry Hurry Heal Me would be no fun if it was only 1 player, so I now need to make sure that I can have 2 controllers moving 2 separate players.
Edit > Project Settings > Input
Is where most of the magic takes place. But before we start adding in inputs it is useful to know a little about how Unity keeps track of different controllers.
Is the function needed to know which Joystick Unity has mapped to the Joy Num. Now Input.GetJoystickNames is actually a string with all the information (names) of the controllers that Unity can see, but this is not the Joy Num. The Joy Num is the number that the controller appears in the GetJoystickName list (array). So to find this out, you need to run a little function.
This function returns something like this in the Debug Console. I was able to tell which was the ps4 controller and the xBo350 controller by plugging them in one at a time.
A few changes need to be made to the player movement script as I now want to specify which controller I want to use (rather than taking any input I give it).
I add a public string = controller;
This allows me to type into Unity the controller I am using for that player.
I now need to change the string I used to get the input to include my controller sting
So now my FixedUpdate looks something like this:
Now that we can distinguish the controls for the two players, we need to show this in the input manager.
So what to do next? Well, better start making some of the game mechanics. I think the most basic one to start with is character movement, so lets start with that one!
Creating the GameObjects
Adding player things to the player
Adding a playerMovement Script
The code for the player movement script. Here I’m going to be moving the player using forces. The walkSpeed is a public value so I can quickly change it later in Unity.
The only problem with this script is that the player does not land…
Adding a limit to the jump – so it looks like a jump rather than a jet pack.
Adding the right information to Ground
Attach your scripts to the player
Checking the right information is on the Player
At the moment I don’t want my player to rotate everywhere so I added in a FreezeRotation into the constraints. But I will later change this so that the right joystick pad controls the rotation of the player.
This is what my unity looks like at the end of doing these steps…
I am developing on a mac and there are no offical drivers for xBox 360 controllers but this one is very good: https://github.com/360Controller
You can download it from here: https://github.com/360Controller/360Controller/releases.
To check that it is all working go to System Preferences and it should appear down the bottom.
By clicking on it you are given a window where you can see if the computer is receiving inputs from the controller.
Go to Unity and Edit -> Project Settings -> Input to bring up the Input manager.
The Input Manager is where you can change the Inputs, for example to use the joystick controls rather than the keyboard ones.
I want to change the Horizontal and Vertical controls to be on the left joypad.
I want to use a joyStick button for the run and jump.
We worked out a couple of key milestones for developing Hurry Hurry Heal Me if we wanted a working demo by the 1st June.
We decided to use an agile working method so that by the end of each week we have an Minimum Viable Product (MVP) which means working on the code and art simultaneously, compared to doing all the code first and then the assets.
Hopefully this means that we can post lovely development photos and videos for everyone to see!
First things first is designing a landing page, check out our YouTube video showing a screen recording of how this was done.
There are 4 different designs for the website depending on which size you are viewing it at: phone, tablet, laptop, desktop.
These designs now needed turning into code, marking up the text in html then styling using css, you can check out our other process video.
We started with a https://html5boilerplate.com/ to work on top of to help ensure the same experience across different browsers. In the CSS there are 4 different breakpoints for each of the four designs.
In order make the website live we needed to host it somewhere and have a nice domain name. We used GoDaddy for the domain name provider and AWS to host the static website using S3 (part of the free tier) and Route 53 (about 50p per website).
Amazon Simple Storage Service is storage for the Internet, you can use S3 to store and retrieve any amount of data, at any time, from anywhere on the web.
This is going to store your landing page, for everyone to see.
Log into the AWS Services and go to S3
Create a Bucket
Name your bucket and choose a region that you want it to be stored. As most of our traffic will be UK based we selected our region to be London.
Note about naming: a bucket name is unique to the amazon server and if you are hosting a website it needs to be exactly the same as your domain name – hurryhurryhealme.com
It is also useful to create another bucket called http://www.hurryhurryhealme.com
The permissions need to be changed through the edit bucket policy.
Change the bucket policy to…
Static Web hosting needs to be enabled and you can choose which index document and error document you like.
Make a second bucket and call it http://www.hurryhurryhealme.com so that traffic that searches for www. and just the url will be directed to the same site.
The Static Website Hosting for this one is slightly different – as you want to redirect all requests to this bucket to your other bucket.
You can check that your website is working by copying and pasting the Endpoint url.
Amazon Route 53 is a Domain Name System (DNS) web service. It is designed to route end users to Internet applications by translating names like http://www.example.com into the numeric IP addresses like 192.0.2.1 that computers use to connect to each other.
This is going to direct anyone who types in your domain name to your aws bucket.
Log into the AWS Services and go to Route 53
Go to your hosted zones tab on the left.
Click on Create Hosted Zone
Enter your domain name (this should be the same as what you called your S3 bucket, e.g. hurryhurryhealme.com, keep it as a public hosted zone.
You can now create a Record Set.
You want to:
Create another Record Set.
Your hosted zone should now look like this!
Now you want a nice domain name for people to type in and access your website, I’m going to talk about the process with GoDaddy.
Register a Domain Name – Buy one!
Got to Manage My Domains
Find your domain name and go to Manage DNS by clicking on the little cog.
Go to your named servers and change them.
You want to name the servers the same as the ones on your Route 53.
Now wait – for .com names it will take up to 24hours and for other’s it could take up to 48hours.
Keep checking to see if your website is up by typing in your url: hurryhurryhealme.com
To make sure that people can search for HurryHurryHealMe.com there is one last thing to do, tell google that you own the site.
Click on Add a Property
Type in your website
You are then asked to verify your website, download the google file.
Then upload it to your S3 bucket.
You can now verify your site
You can also do this process again for the website name with www. in front. You wont need to upload the file again as it is already in your bucket.
You can now check that this works by going to google and searching for the site. Sometimes it takes a little while for this to happen to!
It has been said that for a successful indie game you need a good social media presence. So we decided to start up some key social media accounts.
For a little background research we looked into which tags are best to use, following the advice of https://ritetag.com/.
There are also a couple of hash tag events throughout the week on Twitter such as:
Finally Hash Tags should be used wisely – no more than 3 to a post!
The time, length and content of a post is important and differs for each social media account. For example tweets should go out between 1pm-4pm and Pintrest posts should happen between 8pm-1am.
We are two games designers who want to work on the same Unity file, each editing code and art work. Here I am going to explain how we set up an environment to do this:
Following this tutorial we set up our first source controlled repository.
This means that all our source code is stored in the cloud so that both us can access it at any time. It also has a version history, so that we can rewind time if things break and see who has worked on things when.
Bitbucket is free for 5 or less users letting us keep all the code private, we could also have stored the information publicly on github – but seeing as the tutorial was good for bitbucket it seemed a shame not to use it.
The tutorial shows you how to use SourceTree which is a graphical representation of using Git through Terminal. By using SourceTree it makes the process a little more apparent for first time source control users.
Inviting your team member(s) to your bitbucket project. They will receive an email that allows them to access the code.
Clone the repository using SourceTree onto the other persons computer. Choosing a folder to put the code into on their desktop.
Check everything in SourceTree. They might need to pull the code.
They can then open the unity project and check it is working
If they make a change in Unity, save and then go back to SourceTree. They should now have files that need to be staged -> committed -> pushed.
For more information on the process check out this tutorial.
You do not need to stage any: Library or Temp files.
You can now go back to your computer and check SourceTree and if you need to pull any of their files. For further reading on source code control check out the Git Documentation.
You have now set up a collaborative unity environment where you can share information between a small team!
The start of a new semester, we have 17 weeks to launch a game! Luckily we have a comprehensive games design document to get us started.
Check it out here: Chroma