Tools tools and more tools

During the last week, I have spent a lot of time focusing on creating tools in Unity for shortcuts and usefulness during the next project. At the moment, some of these tools seem incomplete to me, but I’m sure as I find needs to use them, I will realise what is missing and will be able to expand upon them to make them even more useful.

1. Transform Extension

I created a small extension for the transform compoent that adds buttons in that allows me to reset the position, rotation and scale sperately. Many times I have found I am tying 0, then pressing tab, then typing 0 again just to reset one of the three. If you right click on the transform compoent, there is a reset option, but that resets all of them back to 0. Majority of the time, that is not what I want, so I created this small tool to add the buttons.

Screenshot_1

 

 

2. Reset PlayerPrefs

In the past when I was creating a highscore table and saving the highscore in playerprefs, I found that sometimes I would want to reset all the data and I would have to put that in the code, then comment it out when I didn’t need it. Sometimes I forgot to uncomment when I needed to and that messed with me a little. So I created a really simple tool that just resets all the playerprefs. In the future, I want to expand it so you can specify which one to delete.

Screenshot_2

 

 

3. Text mesh Extension

Another really simple tool here. I have always disliked how text meshes only have 1 line which you can write stuff. If I needed multiple lines, I would have to write it in notepad or some other equivalent then copy it into the text mesh text field. I struggled with this one because ororiginallyanted to override the original text field with my own which would mean implementing everything again. I was using a text area, but that requires a rectangle parameter, and I couldn’t find a good way to get the correct position because (0,0) is the top left of the whole inspector, not just that component. In the end, I just settled for adding a larger text area at the end of the component which updates the single line text one when modified to keep consistency.

Screenshot_3

 

4. Path builder

This one was created for the project I am currently working on. As it has tower defense in it, I thought that we would need paths for them to follow. So I created a tool that allows the player to place points, choose the path object and click a button to create the path so it perfectly lines up. During the creation of this tool, I ran into an issue with rotating to look at objects in a 2D space. I forgot that LookAt was a 3D space function and it was making them do weird things. So I used a bit of trigonometry to work out the angle, and then it was all good. My problem with this tool is that the paths overlap and if you have a sprite, it will look weird. I will need to reconsider how to do this in the future to make it more useful. This and my next tool are ones I really want to keep working on to make them much more useful.

Screenshot_4 Screenshot_5 Screenshot_6

 

5. GUI Anchor Points

This one I am quite happy with so far, mainly because I completed it while I was half asleep at 3am in the morning. This tool allows a user to give it sprites and an anchor point then press the button to automatically apply them to the camera as a child. It makes aligning things a lot easier. My main problem I ran into here was that getting the camera size in ortho was the height and not the width. So if the size was 5, that is 5 up and down, but not left to right. This meant that anchors are not exactly on the side. To counter this, I added a padding section allowing the user to move them left and right as well and up and down as desired after they were anchored. At the moment, it will support any gameobjects, so that means it can be quite flexible by allowing the user to put sprites and even text in there, but I want to do more with this tool. I wanted to make a preview window so the user can see what it will look like before it is generated, but so far, I haven’t found a really good solution to that. So in the mean time, there is a delete GUI button to remove it without the user having to manually delete the objects. Anyway, enough rambling, here are the pics.

Screenshot_7 Screenshot_8

Tasks completed and change of direction

After working on Walter’s Wizard Warehouse, I delved deeper into writing my own inspectors and windows in unity that would make the tasks easier and I really enjoyed that. While making one to overhaul the default text field for text meshes, I realised that this is something I really enjoying doing. Thus, I have decided that I would prefer to work on making tools to make the lives of game devs easier. I have been looking at a lot of tutorials recently to determine the boundaries of what is possible in unity and I have found that some really useful tools can be created.

Before deciding that I really wanted to get involved with this, I had just created a few inspectors that made my life a little easier. But following a tutorial, I learnt how to create a grid with things being able to be be cloned in the scene by pressing “a” and they snap to it. This would be extremely useful if creating a 2D tile based game. Overall, I have decided that I want to head towards being a tools programmer more so than an AI Programmer now. I am still interested in exploring AI and how it all works, but I have found I really enjoy making tools that others will use to get their jobs done faster.

GridEditor

Now for a list of all the items I completed on Walter’s Wizard Warehouse:

Code:

  • Buttons
  • Pressure Players
  • Doors
  • Minions (Heavy and Mini)
  • Editors
  • Tutorial prompts
  • Portals
  • Teleporters

Level Design:

  • Linking all the items in the level together (such as buttons to doors)
  • Fixing up little mistakes that were over looked (such as the hight of an area for the mini minion was too small to enter)

Credits document: https://drive.google.com/file/d/0B3jSePrZ157XVmsxTV9qRDl6TFU/view?usp=sharing